/* =============================================================================
   TIMOLOGISI ERP v3.60 - E-Banking Styles
   Bank Statement Import & Reconciliation
   ============================================================================= */

/* ─── Summary Cards ─────────────────────────────────────────────────────────── */
.ebanking-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.ebanking-summary-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.15s, box-shadow 0.15s;
}

.ebanking-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.ebanking-summary-card.total { border-left-color: #22B2A8; }
.ebanking-summary-card.matched { border-left-color: #28a745; }
.ebanking-summary-card.unmatched { border-left-color: #dc3545; }
.ebanking-summary-card.ignored { border-left-color: #6c757d; }

.ebanking-summary-card .card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 4px;
}

.ebanking-summary-card .card-value {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
}

.ebanking-summary-card.total .card-value { color: #22B2A8; }
.ebanking-summary-card.matched .card-value { color: #28a745; }
.ebanking-summary-card.unmatched .card-value { color: #dc3545; }
.ebanking-summary-card.ignored .card-value { color: #6c757d; }

/* ─── Match Status Badges ───────────────────────────────────────────────────── */
.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.match-badge.unmatched {
    background: #fde8e8;
    color: #dc3545;
}

.match-badge.auto-matched {
    background: #d4edda;
    color: #155724;
}

.match-badge.manual-matched {
    background: #fff3cd;
    color: #856404;
}

.match-badge.ignored {
    background: #e9ecef;
    color: #6c757d;
}

/* ─── Amount Colors ─────────────────────────────────────────────────────────── */
.amount-credit {
    color: #28a745;
    font-weight: 600;
}

.amount-debit {
    color: #dc3545;
    font-weight: 600;
}

/* ─── Score Badges ──────────────────────────────────────────────────────────── */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.score-badge.high { background: #28a745; }
.score-badge.medium { background: #d97706; }
.score-badge.low { background: #dc3545; }

/* ─── Detail Page Header ────────────────────────────────────────────────────── */
.ebanking-detail-header {
    background: linear-gradient(135deg, #22B2A8, #1a8f87);
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.ebanking-detail-header h4 {
    margin: 0 0 12px 0;
    font-weight: 600;
}

.ebanking-detail-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.ebanking-detail-info .info-item {
    display: flex;
    flex-direction: column;
}

.ebanking-detail-info .info-label {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ebanking-detail-info .info-value {
    font-size: 15px;
    font-weight: 600;
}

/* ─── Detail Action Bar ─────────────────────────────────────────────────────── */
.ebanking-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ebanking-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.ebanking-actions .btn-auto-match {
    background: #22B2A8;
    color: #fff;
}

.ebanking-actions .btn-auto-match:hover {
    background: #1a8f87;
}

.ebanking-actions .btn-processed {
    background: #28a745;
    color: #fff;
}

.ebanking-actions .btn-processed:hover {
    background: #218838;
}

.ebanking-actions .btn-back {
    background: #6c757d;
    color: #fff;
}

.ebanking-actions .btn-back:hover {
    background: #5a6268;
}

/* ─── Lines Table ───────────────────────────────────────────────────────────── */
.ebanking-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ebanking-lines-table thead th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    font-size: 12px;
}

.ebanking-lines-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.ebanking-lines-table tbody tr:hover {
    background: #f8f9fa;
}

.ebanking-lines-table tbody td {
    padding: 8px 12px;
    vertical-align: middle;
}

.ebanking-lines-table .col-amount {
    text-align: right;
    font-family: 'Consolas', 'Courier New', monospace;
    white-space: nowrap;
}

.ebanking-lines-table .col-actions {
    text-align: center;
    white-space: nowrap;
}

.ebanking-lines-table .col-date {
    white-space: nowrap;
}

/* ─── Line Action Buttons ───────────────────────────────────────────────────── */
.line-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: #6c757d;
    font-size: 13px;
}

.line-action-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.line-action-btn.match:hover { background: #d4edda; color: #155724; }
.line-action-btn.unmatch:hover { background: #fde8e8; color: #dc3545; }
.line-action-btn.ignore:hover { background: #e9ecef; color: #6c757d; }

/* ─── Import Modal ──────────────────────────────────────────────────────────── */
.import-step {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #22B2A8;
}

.import-step .step-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-step .step-title .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #22B2A8;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.import-preview {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.import-preview-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.import-preview-row:last-child {
    border-bottom: none;
}

.import-preview-row .label {
    color: #6c757d;
}

.import-preview-row .value {
    font-weight: 600;
    color: #212529;
}

/* ─── Candidate Cards ───────────────────────────────────────────────────────── */
.candidate-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.candidate-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.candidate-card:hover {
    border-color: #22B2A8;
    background: #f0fdfb;
    box-shadow: 0 2px 6px rgba(34,178,168,0.15);
}

.candidate-info {
    flex: 1;
    min-width: 0;
}

.candidate-info .ref-no {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
}

.candidate-info .trader-name {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.candidate-info .match-reason {
    font-size: 11px;
    color: #22B2A8;
    margin-top: 2px;
}

.candidate-amount {
    text-align: right;
    white-space: nowrap;
}

.candidate-amount .amount {
    font-weight: 600;
    font-size: 14px;
}

.candidate-amount .date {
    font-size: 11px;
    color: #6c757d;
}

/* ─── Bank Selection Cards ─────────────────────────────────────────────────── */
.bank-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.bank-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.bank-card:hover {
    border-color: #adb5bd;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.bank-card.selected {
    border-color: #22B2A8;
    background: #f0fdfb;
    box-shadow: 0 3px 10px rgba(34,178,168,0.2);
}

.bank-card.selected::after {
    content: '\f058';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 14px;
    color: #22B2A8;
}

.bank-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.bank-card-logo.alpha { background: linear-gradient(135deg, #002d72, #004db3); }
.bank-card-logo.eurobank { background: linear-gradient(135deg, #a50034, #d4004a); }
.bank-card-logo.piraeus { background: linear-gradient(135deg, #006747, #009e6d); }
.bank-card-logo.nbg { background: linear-gradient(135deg, #f47920, #ff9a4d); }
.bank-card-logo.auto { background: linear-gradient(135deg, #6c757d, #adb5bd); }

.bank-card-info {
    flex: 1;
    min-width: 0;
}

.bank-card-name {
    font-weight: 600;
    font-size: 13px;
    color: #212529;
    line-height: 1.2;
}

.bank-card-format {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.bank-card.auto-detect {
    grid-column: 1 / -1;
    background: #f8f9fa;
    border-style: dashed;
}

.bank-card.auto-detect.selected {
    background: #f0fdfb;
    border-style: solid;
}

@media (max-width: 480px) {
    .bank-selection-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Upload Drop Zone ──────────────────────────────────────────────────────── */
.upload-dropzone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.2s;
}

.upload-dropzone.has-file {
    background: #f0fdf4;
    border-color: #28a745;
}

.upload-dropzone .upload-icon {
    font-size: 32px;
    color: #adb5bd;
    margin-bottom: 8px;
}

.upload-dropzone.has-file .upload-icon {
    color: #28a745;
}

/* ─── Processing Indicator ──────────────────────────────────────────────────── */
.ebanking-processing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #22B2A8;
    font-size: 13px;
}

.ebanking-processing .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #22B2A8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Reconciliation View ───────────────────────────────────────────────────── */
.reconciliation-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.reconciliation-top-bar .stats {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #495057;
}

.reconciliation-top-bar .stats .stat-value {
    font-weight: 700;
    font-size: 15px;
}

.reconciliation-top-bar .stats .stat-value.green { color: #28a745; }
.reconciliation-top-bar .stats .stat-value.red { color: #dc3545; }

.reconciliation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 500px;
}

.reconciliation-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    max-height: 70vh;
}

.reconciliation-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    flex-shrink: 0;
}

.reconciliation-panel-header.bank {
    background: #f0fdfb;
    border-bottom-color: #22B2A8;
}

.reconciliation-panel-header.trans {
    background: #f0f4ff;
    border-bottom-color: #4a7dff;
}

.reconciliation-panel-header .panel-count {
    font-size: 12px;
    font-weight: 400;
    color: #6c757d;
}

.reconciliation-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.reconciliation-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.12s;
    font-size: 13px;
}

.reconciliation-row:hover {
    background: #f8f9fa;
}

.reconciliation-row.selected {
    background: #f0fdfb;
    border-left: 3px solid #22B2A8;
    padding-left: 13px;
}

.reconciliation-row .row-main {
    flex: 1;
    min-width: 0;
}

.reconciliation-row .row-desc {
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reconciliation-row .row-sub {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.reconciliation-row .row-amount {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    font-family: 'Consolas', 'Courier New', monospace;
}

.reconciliation-row .row-date {
    white-space: nowrap;
    color: #6c757d;
    font-size: 12px;
    min-width: 75px;
}

.reconciliation-row .row-score {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.reconciliation-row .row-score.high { background: #28a745; }
.reconciliation-row .row-score.medium { background: #d97706; }
.reconciliation-row .row-score.low { background: #dc3545; }

.reconciliation-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #adb5bd;
    text-align: center;
}

.reconciliation-empty i {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.reconciliation-empty .empty-text {
    font-size: 13px;
}

.btn-reconcile {
    background: #4a7dff;
    color: #fff;
}

.btn-reconcile:hover {
    background: #3a6ae0;
    color: #fff;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .reconciliation-container {
        grid-template-columns: 1fr;
    }

    .reconciliation-panel {
        max-height: 50vh;
    }
}

@media (max-width: 768px) {
    .ebanking-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .ebanking-detail-info {
        grid-template-columns: 1fr 1fr;
    }

    .ebanking-lines-table {
        font-size: 12px;
    }

    .ebanking-lines-table thead th,
    .ebanking-lines-table tbody td {
        padding: 6px 8px;
    }
}
