/* ═══════════════════════════════════════════════
   SysWallet — Shared Styles
   ═══════════════════════════════════════════════ */

/* Layout */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 500; margin: 0; }
.page-sub { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Cards */
.card {
    background: #fff;
    border: 0.5px solid rgba(0,0,0,.1);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.card-hd {
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-hd-link { font-size: 12px; color: #185FA5; text-decoration: none; text-transform: none; letter-spacing: 0; }

/* Metrics */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.metric-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mcard { background: #f7f7f5; border-radius: 8px; padding: 14px 16px; }
.mcard-label { font-size: 12px; color: #888; margin-bottom: 5px; }
.mcard-value { font-size: 20px; font-weight: 500; }
.mcard-value.frozen { color: #185FA5; }
.mcard-sub { font-size: 11px; color: #aaa; margin-top: 3px; }

/* Status strip */
.status-strip {
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 13px;
}
.status-strip .strip-label { font-weight: 500; }
.status-strip .strip-rule { margin-left: 12px; font-size: 12px; color: inherit; opacity: .8; }
.status-active  { background: #E1F5EE; border: 0.5px solid #9FE1CB; color: #0F6E56; }
.status-frozen  { background: #E6F1FB; border: 0.5px solid #B5D4F4; color: #185FA5; }
.status-suspended { background: #FAEEDA; border: 0.5px solid #FAC775; color: #854F0B; }
.status-closed  { background: #FCEBEB; border: 0.5px solid #F7C1C1; color: #A32D2D; }
.status-pendingreview { background: #FAEEDA; border: 0.5px solid #FAC775; color: #854F0B; }

/* Status preview (in form) */
.status-preview {
    height: 30px;
    border-radius: 6px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    border: 0.5px solid transparent;
}

/* Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Balance bars */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-label { font-size: 12px; color: #888; min-width: 60px; }
.bar-track { flex: 1; height: 7px; background: #f0efeb; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.bar-green { background: #1D9E75; }
.bar-blue  { background: #378ADD; }
.bar-pct   { font-size: 12px; color: #888; min-width: 36px; text-align: right; }

/* Forms */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 10px; font-weight: 500; color: #888; text-transform: uppercase; letter-spacing: .3px; }
.field-input {
    height: 32px;
    border: 0.5px solid rgba(0,0,0,.18);
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: inherit;
    width: 100%;
    appearance: none;
}
.field-input:focus { outline: none; border-color: #378ADD; box-shadow: 0 0 0 2px rgba(55,138,221,.12); }
.field-textarea { height: auto; padding: 8px 10px; resize: vertical; }
.field-hint { font-size: 10px; color: #aaa; }

/* Bank accounts */
.bank-item {
    border: 0.5px solid rgba(0,0,0,.1);
    border-radius: 8px;
    padding: 13px 15px;
    margin-bottom: 10px;
    transition: border-color .15s;
}
.bank-item.primary-acc { border-color: #B5D4F4; background: rgba(230,241,251,.08); }
.bank-header { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.bank-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: #f0efeb; border: 0.5px solid rgba(0,0,0,.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 500; color: #888; flex-shrink: 0;
}
.bank-num.primary { background: #E6F1FB; border-color: #B5D4F4; color: #185FA5; }
.bank-title { font-size: 13px; font-weight: 500; flex: 1; }
.bank-label-tag { font-size: 12px; color: #888; font-weight: 400; }
.bank-actions { display: flex; align-items: center; gap: 6px; }
.badge-primary-acc {
    padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 500;
    background: #E6F1FB; color: #185FA5; border: 0.5px solid #B5D4F4;
}
.btn-set-primary {
    font-size: 11px; padding: 3px 9px; border-radius: 5px; border: 0.5px solid rgba(0,0,0,.12);
    background: transparent; cursor: pointer; color: #888;
}
.btn-set-primary:hover { background: #f0efeb; }
.btn-remove {
    width: 24px; height: 24px; border-radius: 5px; border: 0.5px solid rgba(0,0,0,.1);
    background: transparent; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 11px; color: #aaa;
}
.btn-remove:hover { background: #FCEBEB; border-color: #F7C1C1; color: #A32D2D; }

/* Add bank area */
.add-bank-area {
    border: 0.5px dashed rgba(0,0,0,.2);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: background .12s;
    margin-top: 4px;
}
.add-bank-area:hover { background: #f7f7f5; }
.add-bank-icon { font-size: 18px; color: #aaa; margin-bottom: 4px; }
.add-bank-text { font-size: 13px; font-weight: 500; color: #888; }
.add-bank-sub { font-size: 11px; color: #aaa; margin-top: 2px; }

/* Info note */
.info-note {
    font-size: 12px; color: #666; background: #f7f7f5;
    border: 0.5px solid rgba(0,0,0,.08); border-radius: 6px;
    padding: 8px 12px; margin-bottom: 12px;
}
.info-note strong { color: #185FA5; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; border: 0.5px solid rgba(0,0,0,.15); background: transparent; cursor: pointer; font-family: inherit; transition: background .12s; text-decoration: none; color: inherit; }
.btn:hover { background: #f0efeb; }
.btn-primary { background: #1a1a1a; color: #fff; border-color: transparent; }
.btn-primary:hover { opacity: .88; background: #1a1a1a; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-ghost { color: #666; }
.btn-danger { background: #FCEBEB; color: #A32D2D; border-color: #F7C1C1; }
.btn-add { background: #E6F1FB; color: #185FA5; border-color: #B5D4F4; padding: 5px 12px; font-size: 12px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Counter */
.counter { font-size: 11px; font-weight: 400; color: #aaa; margin-left: 4px; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 12px; }
.alert-success { background: #E1F5EE; color: #0F6E56; border: 0.5px solid #9FE1CB; }
.alert-danger  { background: #FCEBEB; color: #A32D2D; border: 0.5px solid #F7C1C1; }

/* Transactions */
.tx-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 0.5px solid rgba(0,0,0,.06); }
.tx-row:last-child { border-bottom: none; }
.tx-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.tx-body { flex: 1; }
.tx-title { font-size: 13px; }
.tx-time { font-size: 11px; color: #aaa; margin-top: 1px; }
.tx-amount { font-size: 13px; font-weight: 500; }
.credit { color: #0F6E56; }
.debit  { color: #A32D2D; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; padding: 7px 10px; font-weight: 500; color: #888; border-bottom: 0.5px solid rgba(0,0,0,.08); font-size: 10px; text-transform: uppercase; letter-spacing: .3px; }
.tbl td { padding: 9px 10px; border-bottom: 0.5px solid rgba(0,0,0,.06); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafaf8; }
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; color: #888; }

/* Action cards */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.act-card { border: 0.5px solid rgba(0,0,0,.1); border-radius: 8px; padding: 12px; background: #fff; cursor: pointer; text-align: left; font-family: inherit; transition: all .12s; }
.act-card:hover { background: #fafaf8; border-color: rgba(0,0,0,.2); }
.act-card.act-active { border-color: #9FE1CB; background: #E1F5EE10; }
.act-card-danger { display: flex; align-items: center; gap: 10px; width: 100%; border-color: #F7C1C1; }
.act-card-danger:hover { background: #FCEBEB20; }
.act-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; margin-bottom: 6px; }
.ai-green { background: #E1F5EE; color: #0F6E56; }
.ai-blue  { background: #E6F1FB; color: #185FA5; }
.ai-amber { background: #FAEEDA; color: #854F0B; }
.ai-gray  { background: #f0efeb; color: #666; }
.ai-red   { background: #FCEBEB; color: #A32D2D; }
.act-title { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.act-danger-title { font-size: 12px; font-weight: 500; color: #A32D2D; }
.act-desc { font-size: 11px; color: #aaa; }

/* Quick actions */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-card { border: 0.5px solid rgba(0,0,0,.1); border-radius: 8px; padding: 12px; text-decoration: none; color: inherit; display: block; transition: all .12s; }
.quick-card:hover { background: #fafaf8; border-color: rgba(0,0,0,.2); }
.quick-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; margin-bottom: 6px; font-weight: 500; }
.qi-blue   { background: #E6F1FB; color: #185FA5; }
.qi-purple { background: #EEEDFE; color: #534AB7; }
.qi-teal   { background: #E1F5EE; color: #0F6E56; }
.qi-gray   { background: #f0efeb; color: #666; }
.quick-title { font-size: 12px; font-weight: 500; }
.quick-desc { font-size: 11px; color: #aaa; margin-top: 2px; }

/* Rule summary card */
.rule-display { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.rule-value { font-size: 28px; font-weight: 500; }
.rule-name { font-size: 13px; font-weight: 500; }
.rule-scope, .rule-min { font-size: 11px; color: #888; margin-top: 2px; }
.simulate-preview { font-size: 12px; padding: 8px 10px; background: #f7f7f5; border-radius: 6px; }
.sim-label { color: #888; }
.sim-result { font-weight: 500; color: #0F6E56; margin-left: 6px; }

/* Bank summary */
.bank-summary { font-size: 13px; }
.bank-s-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 0.5px solid rgba(0,0,0,.05); }
.bank-s-row:last-child { border-bottom: none; }
.bank-s-label { color: #888; }
.bank-s-val { font-weight: 500; }
.mono { font-family: monospace; font-size: 12px; }
.bank-others { font-size: 11px; color: #aaa; margin-top: 8px; }

/* Flow steps */
.flow-card .card-hd { margin-bottom: 14px; }
.flow-steps { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 4px 0; }
.flow-step { text-align: center; min-width: 80px; }
.flow-icon { font-size: 22px; margin-bottom: 6px; }
.flow-step-label { font-size: 11px; color: #888; }
.flow-step.active .flow-step-label { color: #0F6E56; font-weight: 500; }
.flow-arrow { color: #ccc; font-size: 18px; padding: 0 4px; margin-bottom: 20px; flex-shrink: 0; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal { background: #fff; border-radius: 12px; padding: 22px 24px; width: 100%; max-width: 380px; border: 0.5px solid rgba(0,0,0,.1); }
.modal-title { font-size: 15px; font-weight: 500; margin-bottom: 10px; }
.modal-body { font-size: 13px; color: #666; margin-bottom: 4px; }

/* States */
.loading-state, .empty-state { padding: 40px; text-align: center; color: #888; font-size: 14px; }

@media (max-width: 700px) {
    .two-col { grid-template-columns: 1fr; }
    .metric-grid, .metric-grid-3 { grid-template-columns: 1fr 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
}
.alert-strip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    border: 0.5px solid transparent;
}

    .alert-strip .alert-icon {
        font-size: 16px;
        flex-shrink: 0;
        margin-top: 1px;
    }

    .alert-strip .alert-title {
        font-size: 13px;
        font-weight: 500;
        display: block;
    }

    .alert-strip .alert-sub {
        font-size: 12px;
        display: block;
        margin-top: 2px;
        opacity: .85;
    }

.alert-warn {
    background: #FAEEDA;
    border-color: #FAC775;
    color: #854F0B;
}

.alert-danger {
    background: #FCEBEB;
    border-color: #F7C1C1;
    color: #A32D2D;
}

.bank-item.expanded {
    border-color: var(--color-border-primary);
}

.bank-edit-body {
    border-top: 0.5px solid var(--color-border-tertiary);
    padding-top: 12px;
    margin-top: 10px;
    animation: fadeIn .15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bank-iban-preview {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-left: 4px;
    font-family: monospace;
}

.bank-name-preview {
    font-weight: 500;
}


.rule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 0.5px solid var(--color-border-tertiary);
}

    .rule-row:last-child {
        border-bottom: none;
    }

    .rule-row.rule-active {
        background: rgba(29,158,117,.04);
        border-radius: 6px;
        padding: 12px 8px;
    }

.rule-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rule-info {
    flex: 1;
}

.rule-name {
    font-size: 13px;
    font-weight: 500;
}

.rule-detail {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.rule-val {
    font-size: 18px;
    font-weight: 500;
    min-width: 60px;
    text-align: right;
}

.type-btn {
    flex: 1;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: var(--font-sans);
}

.type-btn-sel {
    flex: 1;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: var(--color-text-primary);
    color: var(--color-background-primary);
    font-family: var(--font-sans);
}