/**
 * Main Application Styles - Fintech Light Theme
 *
 * Professional investment management interface
 * IBM Plex Sans + IBM Plex Mono typography
 */

/* ============================================ */
/* CSS Variables */
/* ============================================ */

:root {
    --bg-primary: #fafbfc;
    --bg-white: #ffffff;
    --bg-hover: #f3f4f6;
    --bg-accent: #f0f4ff;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent-blue: #2563eb;
    --accent-blue-dark: #1d4ed8;
    --accent-green: #059669;
    --accent-green-bg: #ecfdf5;
    --accent-red: #dc2626;
    --accent-red-bg: #fef2f2;
    --accent-orange: #ea580c;
    --accent-orange-bg: #fff7ed;
    --accent-yellow: #ca8a04;
    --accent-yellow-bg: #fefce8;
}

/* ============================================ */
/* Base Styles */
/* ============================================ */

body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.font-mono {
    font-family: 'IBM Plex Mono', monospace;
}

/* ============================================ */
/* Bloomberg-style Header Strip */
/* ============================================ */

.header-strip {
    height: 3px;
    background: linear-gradient(90deg,
        var(--accent-blue) 0%,
        var(--accent-blue) 25%,
        var(--accent-orange) 25%,
        var(--accent-orange) 50%,
        var(--accent-green) 50%,
        var(--accent-green) 75%,
        var(--accent-red) 75%,
        var(--accent-red) 100%
    );
}

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

.card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.btn-primary {
    background: var(--accent-blue);
    color: white;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary:hover {
    background: var(--accent-blue-dark);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: var(--accent-green);
    color: white;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
}

.btn-success:hover {
    background: #047857;
}

/* ============================================ */
/* Form Elements */
/* ============================================ */

.select-fintech {
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 32px;
    cursor: pointer;
}

.select-fintech:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.input-fintech {
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.15s ease;
    width: 100%;
}

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

.input-fintech::placeholder {
    color: var(--text-muted);
}

/* Search input with icon */
.search-wrapper {
    position: relative;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrapper input {
    padding-left: 38px;
}

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

.table-fintech {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-fintech th {
    background: var(--bg-primary);
    padding: 10px 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

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

.table-fintech tr:hover td {
    background: var(--bg-hover);
}

.table-fintech tr:last-child td {
    border-bottom: none;
}

/* Group header row */
.table-fintech .group-row td {
    background: var(--bg-accent);
    font-weight: 600;
    font-size: 12px;
    padding: 8px 12px;
}

.table-fintech .group-row:hover td {
    background: var(--bg-accent);
}

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

.badge-positive {
    color: var(--accent-green);
    background: var(--accent-green-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-negative {
    color: var(--accent-red);
    background: var(--accent-red-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-warning {
    color: var(--accent-orange);
    background: var(--accent-orange-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-neutral {
    color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

/* Legacy delta colors (for compatibility) */
.delta-green {
    color: var(--accent-green);
    font-weight: 500;
}

.delta-yellow {
    color: var(--accent-orange);
    font-weight: 500;
}

.delta-red {
    color: var(--accent-red);
    font-weight: 500;
}

/* ============================================ */
/* Value Display */
/* ============================================ */

.value-display {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #3b82f6 100%);
    color: white;
    border-radius: 8px;
    padding: 20px 24px;
}

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

.metric-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    position: relative;
}

.metric-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 2px 2px 0;
}

.metric-card.stocks::before { background: var(--accent-blue); }
.metric-card.bonds::before { background: var(--accent-green); }
.metric-card.funds::before { background: var(--accent-orange); }
.metric-card.cash::before { background: var(--text-muted); }

/* ============================================ */
/* Section Header */
/* ============================================ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.section-title-fintech {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.15s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

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

.icon-btn.danger:hover {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

/* ============================================ */
/* Ticker Badge */
/* ============================================ */

.ticker {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
}

/* ============================================ */
/* Live Indicator */
/* ============================================ */

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================ */
/* Compact Grid */
/* ============================================ */

.compact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

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

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

/* ============================================ */
/* Rebalance Items */
/* ============================================ */

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

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

.rebalance-item.buy {
    background: var(--accent-green-bg);
}

.rebalance-item.sell {
    background: var(--accent-red-bg);
}

/* ============================================ */
/* Editable Cell Styles */
/* ============================================ */

.editable-cell {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    font-family: 'IBM Plex Mono', monospace;
    background: var(--bg-white);
}

.editable-cell:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.editable-cell:hover {
    border-color: var(--border-medium);
}

/* ============================================ */
/* Outside Index Highlight */
/* ============================================ */

.outside-index {
    background-color: var(--accent-orange-bg) !important;
}

/* ============================================ */
/* HTMX Loading Indicators */
/* ============================================ */

.htmx-request {
    opacity: 0.5;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

/* ============================================ */
/* Animations */
/* ============================================ */

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================ */
/* Modal Styles - Fintech Light Theme */
/* ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: modalOverlayIn 0.2s ease-out;
}

@keyframes modalOverlayIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    margin: 16px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px var(--border-light);
    animation: modalContentIn 0.25s ease-out;
}

@keyframes modalContentIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-title-icon.blue {
    background: var(--bg-accent);
    color: var(--accent-blue);
}

.modal-title-icon.orange {
    background: var(--accent-orange-bg);
    color: var(--accent-orange);
}

.modal-title-icon.green {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.modal-title-icon.red {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.modal-close {
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Modal Info Box */
.modal-info-box {
    background: var(--bg-accent);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.modal-info-box.warning {
    background: var(--accent-orange-bg);
    border-color: rgba(234, 88, 12, 0.2);
}

.modal-info-box.danger {
    background: var(--accent-red-bg);
    border-color: rgba(220, 38, 38, 0.2);
}

.modal-info-box.success {
    background: var(--accent-green-bg);
    border-color: rgba(5, 150, 105, 0.2);
}

.modal-info-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.modal-info-box .modal-info-icon {
    color: var(--accent-blue);
}

.modal-info-box.warning .modal-info-icon {
    color: var(--accent-orange);
}

.modal-info-box.danger .modal-info-icon {
    color: var(--accent-red);
}

.modal-info-box.success .modal-info-icon {
    color: var(--accent-green);
}

.modal-info-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-info-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
}

.modal-footer.no-border {
    border-top: none;
    margin-top: 8px;
}

/* Modal Form Groups */
.modal-form-group {
    margin-bottom: 16px;
}

.modal-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Modal List Styles */
.modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-list li {
    position: relative;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 50%;
}

.modal-list li strong {
    color: var(--accent-red);
    font-weight: 500;
}

/* Modal Checkbox */
.modal-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.modal-checkbox-wrapper:hover {
    background: var(--bg-hover);
}

.modal-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-checkbox:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.modal-checkbox-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-checkbox-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Modal Divider */
.modal-divider {
    height: 1px;
    background: var(--border-light);
    margin: 16px 0;
}

/* Large Modal */
.modal-lg {
    max-width: 640px;
}

.modal-xl {
    max-width: 800px;
}

/* Modal with sticky header/footer */
.modal-scrollable {
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-scrollable .modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 20px 24px;
}

.modal-scrollable .modal-header-sticky {
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 1;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-scrollable .modal-footer-sticky {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Empty State in Modal */
.modal-empty-state {
    text-align: center;
    padding: 32px 16px;
}

.modal-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: var(--accent-green-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
}

.modal-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-empty-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* Loading State in Modal */
.modal-loading {
    text-align: center;
    padding: 40px 16px;
}

.modal-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

.modal-loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Changes Preview Table */
.changes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.changes-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border-light);
}

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

.changes-table tr:last-child td {
    border-bottom: none;
}

.changes-table .change-add {
    background: var(--accent-green-bg);
}

.changes-table .change-remove {
    background: var(--accent-red-bg);
}

.changes-table .change-update {
    background: var(--accent-orange-bg);
}

/* ============================================ */
/* Toast Notification System - Fintech Light */
/* ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    position: relative;
    background: var(--bg-white);
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 340px;
    max-width: 420px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.07),
        0 10px 20px -5px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transform: translateX(0);
    opacity: 1;
}

/* Toast entrance animation */
.toast-enter {
    animation: toastSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast exit animation */
.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

/* Toast icon container */
.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

/* Toast content */
.toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-wrap: break-word;
}

/* Toast close button */
.toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0;
}

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

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

.toast-close svg {
    width: 14px;
    height: 14px;
}

/* Toast progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    border-radius: 0 0 10px 10px;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Pause progress on hover */
.toast:hover .toast-progress {
    animation-play-state: paused;
}

/* ============================================ */
/* Toast Type Variants */
/* ============================================ */

/* Success Toast */
.toast.success {
    border-left: 4px solid var(--accent-green);
}

.toast.success .toast-icon {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.toast.success .toast-progress {
    color: var(--accent-green);
}

/* Error Toast */
.toast.error {
    border-left: 4px solid var(--accent-red);
}

.toast.error .toast-icon {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.toast.error .toast-progress {
    color: var(--accent-red);
}

/* Warning Toast */
.toast.warning {
    border-left: 4px solid var(--accent-orange);
}

.toast.warning .toast-icon {
    background: var(--accent-orange-bg);
    color: var(--accent-orange);
}

.toast.warning .toast-progress {
    color: var(--accent-orange);
}

/* Info Toast */
.toast.info {
    border-left: 4px solid var(--accent-blue);
}

.toast.info .toast-icon {
    background: var(--bg-accent);
    color: var(--accent-blue);
}

.toast.info .toast-progress {
    color: var(--accent-blue);
}

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

@media (max-width: 480px) {
    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* ============================================ */
/* Sync Stats */
/* ============================================ */

.sync-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 16px;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.sync-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sync-stat .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sync-stat .dot.success { background: var(--accent-green); }
.sync-stat .dot.error { background: var(--accent-red); }
.sync-stat .dot.warning { background: var(--accent-orange); }

/* ============================================ */
/* Footer Pagination */
/* ============================================ */

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    font-size: 13px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================ */
/* Custom Account Dropdown */
/* ============================================ */

.account-dropdown {
    position: relative;
}

.account-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    min-width: 180px;
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.account-dropdown-trigger:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
}

.account-dropdown-trigger.open {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.account-dropdown-placeholder {
    color: var(--text-muted);
    flex: 1;
}

.account-dropdown-value {
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-dropdown-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.account-dropdown-trigger.open .account-dropdown-chevron {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.account-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 280px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 4px;
    z-index: 100;
}

/* Dropdown Item */
.account-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s ease;
    text-align: left;
}

.account-dropdown-item:hover {
    background: var(--bg-hover);
}

.account-dropdown-item.selected {
    background: var(--bg-accent);
    font-weight: 500;
}

.account-dropdown-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-dropdown-check {
    color: var(--accent-blue);
    font-size: 14px;
    flex-shrink: 0;
}

.account-dropdown-empty {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================ */
/* Transfer Mode - Inline Selection */
/* ============================================ */

/* Transfer mode active state */
.table-fintech.transfer-mode tr:not(.group-row):hover td {
    background: var(--bg-accent);
    cursor: pointer;
}

/* Checkbox column */
.table-fintech .transfer-checkbox-cell {
    width: 40px;
    text-align: center;
    padding: 10px 8px;
}

.table-fintech .transfer-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    accent-color: var(--accent-blue);
}

.table-fintech .transfer-checkbox:hover {
    border-color: var(--accent-blue);
}

.table-fintech .transfer-checkbox:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Selected row highlighting */
.table-fintech tr.transfer-selected td {
    background: var(--bg-accent) !important;
    border-color: rgba(37, 99, 235, 0.2);
}

.table-fintech tr.transfer-selected:hover td {
    background: rgba(37, 99, 235, 0.12) !important;
}

/* ============================================ */
/* Transfer Action Bar - Floating Bottom Panel */
/* ============================================ */

.transfer-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 16px 24px;
    z-index: 40;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.transfer-action-bar.visible {
    transform: translateY(0);
    opacity: 1;
}

.transfer-action-bar-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Left section - selection info */
.transfer-selection-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.transfer-selection-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.transfer-selection-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: var(--accent-blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 14px;
}

.transfer-clear-btn {
    font-size: 13px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.transfer-clear-btn:hover {
    color: var(--accent-red);
    background: var(--accent-red-bg);
}

/* Middle section - target account selector */
.transfer-target-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 400px;
}

.transfer-target-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.transfer-target-select {
    flex: 1;
    min-width: 200px;
}

/* Right section - action buttons */
.transfer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.transfer-cancel-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.transfer-cancel-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.transfer-execute-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--accent-blue);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.transfer-execute-btn:hover:not(:disabled) {
    background: var(--accent-blue-dark);
}

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

/* Transfer mode toggle button active state */
.btn-transfer-mode {
    background: var(--accent-blue) !important;
    color: white !important;
    border-color: var(--accent-blue) !important;
}

.btn-transfer-mode:hover {
    background: var(--accent-blue-dark) !important;
}

/* Header checkbox for select all */
.transfer-select-all {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    accent-color: var(--accent-blue);
}

.transfer-select-all:hover {
    border-color: var(--accent-blue);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .transfer-action-bar {
        padding: 12px 16px;
    }

    .transfer-action-bar-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    .transfer-target-section {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .transfer-selection-info {
        flex: 1;
    }

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

/* Animate spin for loading states */
.animate-spin {
    animation: spin 1s linear infinite;
}
