/* ============================================================
   MicroFinance Pro - Main Stylesheet
   Clean, modern banking UI built on Bootstrap 5.3
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-color: #cbd5e1;
    --sidebar-active: #3b82f6;
    --sidebar-hover-bg: #1e293b;
    --topbar-height: 60px;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --body-bg: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: #1e293b;
    font-size: 0.9rem;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.login-card .brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .brand i {
    font-size: 2.5rem;
    color: var(--primary);
}

.login-card .brand h2 {
    margin-top: 0.5rem;
    font-weight: 700;
    color: #0f172a;
}

.login-card .form-control {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-card .btn-primary {
    border-radius: 10px;
    padding: 0.75rem;
    font-weight: 600;
    background: var(--primary);
    border-color: var(--primary);
}

.login-card .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-logo {
    max-height: 40px;
    max-width: 180px;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-item {
    margin: 2px 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: var(--sidebar-color);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 500;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.08);
    margin: 0.5rem 0.75rem;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topbar-title {
    font-weight: 600;
    color: #0f172a;
}

.sidebar-toggle {
    color: #64748b;
    text-decoration: none;
    padding: 0;
}

.page-content {
    padding: 1.5rem;
    flex: 1;
}

.app-footer {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.bg-blue { background: var(--primary); }
.bg-green { background: var(--success); }
.bg-orange { background: #f97316; }
.bg-purple { background: #8b5cf6; }
.bg-red { background: var(--danger); }
.bg-teal { background: #14b8a6; }

/* ============================================================
   BALANCE DISPLAY (Client)
   ============================================================ */
.balance-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    color: #fff;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 50%;
}

.balance-card .balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.balance-card .balance-label {
    font-size: 0.85rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.balance-card .account-number {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    opacity: 0.7;
}

/* ============================================================
   CARD DESIGN (Bank Cards)
   ============================================================ */
.bank-card {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 16px;
    padding: 1.5rem;
    color: #fff;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.bank-card.visa { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.bank-card.mastercard { background: linear-gradient(135deg, #9a3412, #f97316); }

.bank-card .card-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.bank-card .card-number {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.bank-card .card-holder {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
}

/* ============================================================
   TABLE STYLES
   ============================================================ */
.table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.85rem 1rem;
}

.table-card .table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-card .table tbody tr:hover {
    background: #f8fafc;
}

/* ============================================================
   FORM CARDS
   ============================================================ */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.form-card .form-label {
    font-weight: 500;
    color: #334155;
    font-size: 0.85rem;
}

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.chart-card h6 {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 1rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    #main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

.icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Print styles */
@media print {
    .sidebar, .topbar, .app-footer, .btn, .pagination { display: none !important; }
    #main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
}
