/* ============================================
   מיאל השקעות - Dashboard Styles
   RTL Dark Theme
   ============================================ */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #1e2132;
    --bg-hover: #262a3e;
    --bg-input: #151822;
    --border-color: #2d3148;
    --border-light: #363b54;
    --text-primary: #e8eaf0;
    --text-secondary: #9ca3b8;
    --text-muted: #6b7280;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #10b981;
    --accent-green-dark: #059669;
    --accent-red: #ef4444;
    --accent-red-dark: #dc2626;
    --accent-orange: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --sidebar-width: 240px;
    --sidebar-collapsed: 60px;
    --topbar-height: 60px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    direction: rtl;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-blue);
    white-space: nowrap;
    overflow: hidden;
}

.logo i {
    font-size: 1.4rem;
    min-width: 28px;
    text-align: center;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
}

.nav-item i {
    min-width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.12);
    font-weight: 600;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sidebar.collapsed .date-display span {
    display: none;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-right: var(--sidebar-collapsed);
}

/* ============ TOP BAR ============ */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-right h1 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-picker-wrapper label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.date-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}
.btn-primary:hover {
    background: var(--accent-blue-hover);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}
.btn-danger:hover {
    background: var(--accent-red-dark);
}

.btn-success {
    background: var(--accent-green);
    color: white;
}
.btn-success:hover {
    background: var(--accent-green-dark);
}

.btn-icon {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}
.btn-icon:hover {
    color: var(--text-primary);
    background: var(--border-color);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* ============ SECTIONS ============ */
.content-section {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
}

.summary-card.green::before { background: var(--accent-green); }
.summary-card.blue::before { background: var(--accent-blue); }
.summary-card.orange::before { background: var(--accent-orange); }
.summary-card.positive::before { background: var(--accent-green); }
.summary-card.negative::before { background: var(--accent-red); }

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.summary-card.green .card-icon { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.summary-card.blue .card-icon { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.summary-card.orange .card-icon { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.summary-card.positive .card-icon { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.summary-card.negative .card-icon { background: rgba(239,68,68,0.15); color: var(--accent-red); }

.card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.chart-card {
    min-height: 300px;
}

.chart-container {
    padding: 16px;
    height: 250px;
    position: relative;
}

/* Quick View */
.quick-view-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* ============ TABLES ============ */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 12px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table.compact td,
.data-table.compact th {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.totals-row {
    background: var(--bg-secondary) !important;
    font-weight: 600;
}

.totals-row td {
    border-top: 2px solid var(--accent-blue);
}

/* Inline editable cells */
.data-table td .cell-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    padding: 4px 6px;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    border-radius: 4px;
    transition: var(--transition);
}

.data-table td .cell-input:focus {
    background: var(--bg-input);
    border-color: var(--accent-blue);
    outline: none;
}

.data-table td .cell-input[type="number"] {
    text-align: left;
    direction: ltr;
}

/* Checkbox in table */
.table-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.badge-paid { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-cancelled { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.badge-estimated { background: rgba(139,92,246,0.15); color: var(--accent-purple); }

/* Action buttons in rows */
.row-actions {
    display: flex;
    gap: 4px;
}

.row-actions .btn-icon {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    border: none;
}

/* ============ FORMS & INPUTS ============ */
.input-field {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    transition: var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.inline-input {
    width: 140px;
    text-align: left;
    direction: ltr;
}

.select-field {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.select-field:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ============ BANKS CARDS ============ */
.banks-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.bank-card {
    padding: 18px;
    position: relative;
}

.bank-card .bank-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bank-card .bank-name i {
    color: var(--accent-blue);
}

.bank-detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.bank-detail:last-child {
    border-bottom: none;
}

.bank-detail .label {
    color: var(--text-secondary);
}

.bank-detail .amount {
    font-weight: 600;
    direction: ltr;
    text-align: left;
}

.bank-detail .amount.liquid {
    color: var(--accent-green);
}

.bank-warning {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(239,68,68,0.1);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============ FINANCING CARDS ============ */
.financing-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.financing-card .financing-details {
    padding: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-of-type {
    border-bottom: none;
}

.detail-row.total {
    font-weight: 700;
    color: var(--accent-blue);
    padding-top: 12px;
    margin-top: 4px;
    border-top: 2px solid var(--accent-blue);
    border-bottom: none;
}

.financing-details .note {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 8px;
    text-align: center;
}

/* ============ LIQUIDITY FLOW ============ */
.liquidity-summary {
    margin-top: 20px;
}

.liquidity-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px;
    flex-wrap: wrap;
}

.flow-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    min-width: 110px;
}

.flow-item.positive {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
}

.flow-item.negative {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
}

.flow-item.highlight {
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.25);
}

.flow-item.result {
    background: rgba(139,92,246,0.1);
    border: 2px solid rgba(139,92,246,0.3);
    padding: 14px 20px;
}

.flow-item.result.surplus {
    background: rgba(16,185,129,0.12);
    border-color: var(--accent-green);
}

.flow-item.result.deficit {
    background: rgba(239,68,68,0.12);
    border-color: var(--accent-red);
}

.flow-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.flow-value {
    font-size: 1rem;
    font-weight: 700;
}

.flow-operator {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 4px;
}

/* ============ TASKS ============ */
.tasks-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.task-column {
    min-height: 400px;
}

.urgency-high {
    border-bottom-color: var(--accent-red) !important;
}
.urgency-high h3 { color: var(--accent-red); }

.urgency-medium {
    border-bottom-color: var(--accent-orange) !important;
}
.urgency-medium h3 { color: var(--accent-orange); }

.urgency-low {
    border-bottom-color: var(--accent-green) !important;
}
.urgency-low h3 { color: var(--accent-green); }

.task-list {
    padding: 12px;
    min-height: 300px;
}

.task-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    cursor: default;
    transition: var(--transition);
}

.task-item:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.task-item .task-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.task-item .task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.task-item .task-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-item.completed {
    opacity: 0.5;
}

.task-item.completed .task-title {
    text-decoration: line-through;
}

.tasks-quick-list {
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.tasks-quick-list .task-item {
    border-right: 3px solid var(--accent-red);
}

/* ============ IMPORT ============ */
.import-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.import-body {
    padding: 20px;
}

.drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59,130,246,0.05);
}

.drop-zone i {
    font-size: 3rem;
    color: var(--accent-blue);
    margin-bottom: 12px;
}

.drop-zone p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.drop-zone small {
    color: var(--text-muted);
}

.import-options {
    margin-top: 20px;
    display: flex;
    gap: 16px;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.import-preview h4 {
    margin-bottom: 12px;
    color: var(--accent-blue);
}

.preview-table-container {
    max-height: 300px;
    overflow: auto;
    margin-bottom: 16px;
}

.import-summary {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.import-actions {
    display: flex;
    gap: 10px;
}

.import-history {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.import-history-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.import-history-item:last-child {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 0.9rem;
}

/* ============ SETTINGS ============ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.settings-body {
    padding: 16px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label {
    color: var(--text-secondary);
}

.setting-row .input-field {
    width: 120px;
    text-align: left;
    direction: ltr;
}

.categories-list {
    list-style: none;
    padding: 0;
}

.categories-list li {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.categories-list li::before {
    content: '•';
    color: var(--accent-blue);
    font-size: 1.2rem;
}

.categories-list li:last-child {
    border-bottom: none;
}

/* Exchange Rates */
.exchange-rates {
    padding: 16px;
    display: flex;
    gap: 30px;
}

.rate-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-item label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Minimum Balance */
.minimum-balance {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* Modal Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s ease;
    border-right: none;
    border-left: 4px solid var(--accent-blue);
}

.toast.success { border-left-color: var(--accent-green); }
.toast.error { border-left-color: var(--accent-red); }
.toast.warning { border-left-color: var(--accent-orange); }

.toast i {
    font-size: 1.2rem;
}

.toast.success i { color: var(--accent-green); }
.toast.error i { color: var(--accent-red); }
.toast.warning i { color: var(--accent-orange); }

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-30px); }
}

/* ============ MOBILE MENU BUTTON ============ */
.mobile-menu-btn {
    display: none;
}

/* Mobile overlay backdrop */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.mobile-overlay.active {
    display: block;
}

/* ============ RESPONSIVE - TABLET (1200px) ============ */
@media (max-width: 1200px) {
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .quick-view-row { grid-template-columns: 1fr; }
    .tasks-columns { grid-template-columns: 1fr; }
    .banks-cards { grid-template-columns: repeat(2, 1fr); }
    .financing-cards { grid-template-columns: 1fr; }
    .import-area { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .liquidity-flow { flex-wrap: wrap; }
}

/* ============ RESPONSIVE - MOBILE (768px) ============ */
@media (max-width: 768px) {
    html {
        font-size: 13.5px;
    }

    /* --- SIDEBAR: Full overlay on mobile --- */
    .sidebar {
        width: 280px;
        transform: translateX(100%);
        box-shadow: none;
        z-index: 200;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    }

    .sidebar .nav-item span,
    .sidebar .logo span,
    .sidebar .date-display span {
        display: inline;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar.collapsed {
        width: 280px;
        transform: translateX(100%);
    }
    .sidebar.collapsed.mobile-open {
        transform: translateX(0);
    }
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .logo span,
    .sidebar.collapsed .date-display span {
        display: inline;
    }

    /* --- MAIN CONTENT: Full width on mobile --- */
    .main-content {
        margin-right: 0 !important;
        width: 100%;
    }

    .sidebar.collapsed ~ .main-content {
        margin-right: 0;
    }

    /* --- MOBILE MENU BUTTON --- */
    .mobile-menu-btn {
        display: flex;
        margin-left: 8px;
        font-size: 1.15rem;
        width: 40px;
        height: 40px;
    }

    /* --- TOP BAR --- */
    .top-bar {
        height: auto;
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .top-bar-right {
        display: flex;
        align-items: center;
    }

    .top-bar-right h1 {
        font-size: 1.1rem;
    }

    .top-bar-left {
        width: 100%;
        justify-content: space-between;
    }

    .date-picker-wrapper {
        flex: 1;
    }

    .date-picker-wrapper label {
        display: none;
    }

    .date-input {
        width: 100%;
        max-width: 160px;
    }

    /* --- SECTIONS --- */
    .content-section {
        padding: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .section-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* --- SUMMARY CARDS --- */
    .summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .summary-card {
        padding: 14px 12px;
        gap: 10px;
    }

    .card-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .card-value {
        font-size: 1.15rem;
    }

    .card-label {
        font-size: 0.72rem;
    }

    /* --- CHARTS --- */
    .charts-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chart-card {
        min-height: 240px;
    }

    .chart-container {
        height: 200px;
        padding: 10px;
    }

    /* --- QUICK VIEW --- */
    .quick-view-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* --- LIQUIDITY FLOW: Vertical on mobile --- */
    .liquidity-flow {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 14px 10px;
    }

    .flow-item {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 14px;
        min-width: auto;
    }

    .flow-item.result {
        padding: 12px 14px;
        margin-top: 4px;
    }

    .flow-label {
        font-size: 0.82rem;
    }

    .flow-value {
        font-size: 1.05rem;
    }

    .flow-operator {
        font-size: 1.1rem;
        text-align: center;
        padding: 2px 0;
    }

    /* --- BANKS CARDS --- */
    .banks-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* --- FINANCING CARDS --- */
    .financing-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* --- FILTER BAR --- */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group .select-field {
        flex: 1;
        width: 100%;
    }

    /* --- TASKS --- */
    .tasks-columns {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .task-column {
        min-height: auto;
    }

    .task-list {
        min-height: 100px;
    }

    /* --- IMPORT --- */
    .import-area {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .drop-zone {
        padding: 24px 16px;
    }

    .drop-zone i {
        font-size: 2rem;
    }

    /* --- SETTINGS --- */
    .settings-grid {
        grid-template-columns: 1fr;
    }

    /* --- EXCHANGE RATES --- */
    .exchange-rates {
        flex-direction: column;
        gap: 12px;
    }

    /* --- FORM --- */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* --- MODAL: Full screen on mobile --- */
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        flex: 1;
        max-height: none;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
    }

    /* --- TABLES: Card view on mobile --- */
    .data-table:not(.compact) thead {
        display: none;
    }

    .data-table:not(.compact) tbody tr {
        display: block;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: 10px;
        padding: 12px;
        position: relative;
    }

    .data-table:not(.compact) tbody tr:hover {
        background: var(--bg-hover);
    }

    .data-table:not(.compact) tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid rgba(45,49,72,0.4);
        text-align: right;
    }

    .data-table:not(.compact) tbody td:last-child {
        border-bottom: none;
    }

    .data-table:not(.compact) tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.8rem;
        flex-shrink: 0;
        margin-left: 12px;
        min-width: 80px;
    }

    .data-table:not(.compact) tbody td:empty {
        display: none;
    }

    /* Card view: cell inputs in card layout */
    .data-table:not(.compact) tbody td .cell-input {
        text-align: left;
        max-width: 55%;
        min-width: 80px;
    }

    .data-table:not(.compact) tbody td .cell-input[type="text"] {
        text-align: right;
    }

    /* Card view: row actions centered */
    .data-table:not(.compact) tbody td .row-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .data-table:not(.compact) tbody td:has(.row-actions)::before {
        display: none;
    }

    .data-table:not(.compact) tbody td:has(.table-checkbox) {
        position: absolute;
        top: 10px;
        left: 10px;
        border: none;
        padding: 0;
    }

    .data-table:not(.compact) tbody td:has(.table-checkbox)::before {
        display: none;
    }

    /* Card view: totals row */
    .data-table:not(.compact) tfoot {
        display: block;
    }

    .data-table:not(.compact) tfoot .totals-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
        background: var(--bg-secondary);
        border: 2px solid var(--accent-blue);
        border-radius: var(--radius-md);
    }

    .data-table:not(.compact) tfoot .totals-row td {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border: none;
        font-size: 0.82rem;
        border-top: none;
    }

    .data-table:not(.compact) tfoot .totals-row td:empty {
        display: none;
    }

    .data-table:not(.compact) tfoot .totals-row td::before {
        content: attr(data-label);
        font-weight: 400;
        color: var(--text-secondary);
        font-size: 0.75rem;
    }

    /* Compact tables (dashboard quick view) */
    .data-table.compact thead {
        display: none;
    }

    .data-table.compact tbody tr {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border-color);
    }

    .data-table.compact tbody td {
        padding: 2px 0;
        border-bottom: none;
    }

    .data-table.compact tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.72rem;
        margin-left: 4px;
    }

    /* --- TOAST on mobile --- */
    .toast-container {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* --- Minimum balance card header --- */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .minimum-balance {
        width: 100%;
    }

    .minimum-balance .inline-input {
        flex: 1;
    }

    /* --- Inline input wider --- */
    .inline-input {
        width: 100%;
        max-width: 160px;
    }
}

/* ============ RESPONSIVE - SMALL MOBILE (480px) ============ */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .content-section {
        padding: 8px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .summary-card {
        padding: 12px;
        gap: 10px;
    }

    .card-value {
        font-size: 1.1rem;
    }

    .card-icon {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    /* Liquidity flow even more compact */
    .flow-item {
        padding: 8px 10px;
    }

    .flow-label {
        font-size: 0.75rem;
    }

    .flow-value {
        font-size: 0.95rem;
    }

    .flow-operator {
        font-size: 1rem;
        padding: 1px 0;
    }

    /* Table card view more compact */
    .data-table:not(.compact) tbody tr {
        padding: 10px;
    }

    .data-table:not(.compact) tbody td {
        font-size: 0.82rem;
    }

    .data-table:not(.compact) tbody td .cell-input {
        font-size: 0.82rem;
        padding: 4px 6px;
    }

    /* Button full width */
    .btn {
        padding: 10px 14px;
    }

    /* Top bar compact */
    .top-bar-right h1 {
        font-size: 1rem;
    }
}

/* ============ UTILITY ============ */
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-orange { color: var(--accent-orange); }
.text-blue { color: var(--accent-blue); }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.dir-ltr { direction: ltr; text-align: left; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

/* ============ DASHBOARD GRID - DRAG & DROP ============ */

/* Controls bar above dashboard */
.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.dashboard-controls .btn {
    font-size: 0.82rem;
    padding: 6px 14px;
}

.dashboard-controls .edit-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--accent-orange);
    font-size: 0.82rem;
    font-weight: 600;
    margin-right: auto;
    animation: pulse-glow 2s ease-in-out infinite;
}

.dashboard-controls .edit-indicator.visible {
    display: flex;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.dashboard-controls .widget-toggles {
    display: none;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid var(--border-color);
    margin-right: 8px;
}

.dashboard-controls .widget-toggles.visible {
    display: flex;
}

.widget-toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.widget-toggle-chip:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.widget-toggle-chip.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.widget-toggle-chip i {
    font-size: 0.7rem;
}

/* Dashboard grid container */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: gap 0.3s ease;
}

.dashboard-grid.edit-mode {
    gap: 8px;
}

/* Individual widget wrapper */
.grid-widget {
    position: relative;
    border-radius: var(--radius-md);
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.grid-widget.hidden-widget {
    display: none;
}

/* Widget drag handle */
.widget-handle {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: 1px dashed var(--border-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: grab;
    user-select: none;
    transition: var(--transition);
}

.widget-handle:active {
    cursor: grabbing;
}

.widget-handle:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
}

.widget-handle-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-handle-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.handle-grip {
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 2px;
    line-height: 1;
    opacity: 0.6;
}

.widget-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.widget-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.widget-btn:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.widget-btn.hide-btn:hover {
    color: var(--accent-red);
}

/* Widget content area */
.widget-content {
    transition: opacity 0.2s ease;
}

/* Edit mode active state */
.edit-mode .widget-handle {
    display: flex;
}

.edit-mode .grid-widget {
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
}

.edit-mode .grid-widget .widget-content {
    opacity: 0.85;
    pointer-events: none;
}

.edit-mode .grid-widget:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Dragging state */
.grid-widget.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    box-shadow: none;
}

/* Drop indicators */
.grid-widget.drag-over-top {
    border-top: 3px solid var(--accent-blue) !important;
    padding-top: 2px;
}

.grid-widget.drag-over-bottom {
    border-bottom: 3px solid var(--accent-blue) !important;
    padding-bottom: 2px;
}

/* Placeholder shown during drag */
.grid-widget-placeholder {
    background: rgba(59, 130, 246, 0.06);
    border: 2px dashed var(--accent-blue);
    border-radius: var(--radius-md);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-size: 0.85rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

/* Smooth reorder animation */
.grid-widget.reordering {
    animation: widgetReorder 0.35s ease;
}

@keyframes widgetReorder {
    0% { opacity: 0.5; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Responsive for drag grid */
@media (max-width: 768px) {
    .dashboard-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-controls .widget-toggles {
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding-right: 0;
        padding-top: 8px;
        margin-right: 0;
        flex-wrap: wrap;
    }

    .widget-handle {
        padding: 6px 10px;
    }
}

/* ============================================
   Login Screen Styles
   ============================================ */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0f1117 0%, #1a1d27 50%, #0f1117 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(59, 130, 246, 0.1);
    animation: loginSlideIn 0.5s ease;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 48px;
    color: var(--accent-blue);
    margin-bottom: 15px;
    display: block;
}

.login-logo h1 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.login-field:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-field i {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.login-field input {
    width: 100%;
    padding: 14px 45px 14px 14px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

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

.login-error {
    color: var(--accent-red);
    font-size: 0.9rem;
    text-align: center;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-error.show {
    opacity: 1;
}

.login-btn {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-hover) 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    margin-top: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--accent-red);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-red);
}

.logout-btn i {
    font-size: 1.1rem;
}

.sidebar.collapsed .logout-btn span {
    display: none;
}

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 12px;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    margin-top: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--accent-red);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-red);
}

.logout-btn i {
    font-size: 1.1rem;
}

.sidebar.collapsed .logout-btn span {
    display: none;
}

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 12px;
}
