/* EVO MicroLend - Custom Styles */
:root {
    --primary: #1a5490;
    --primary-dark: #0d3b6f;
    --primary-light: #2a6cb5;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #1a1a2e;
    --sidebar-width: 260px;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --sidebar-active: #0f3460;
    --sidebar-text: #8899aa;
    --sidebar-text-active: #ffffff;
    --topbar-height: 56px;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: #f0f2f5;
    color: #333;
    overflow-x: hidden;
}

.bg-primary { background-color: var(--primary) !important; }
.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.text-primary { color: var(--primary) !important; }

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

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: 64px;
}

.sidebar-logo {
    font-size: 28px;
    color: var(--info);
}

.sidebar-brand {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 10px;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    border-left-color: var(--info);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-divider {
    padding: 14px 20px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.25);
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 12px 16px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10px;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
}

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

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

.main-content-full {
    margin-left: 0;
}

/* ===== TOP BAR ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    min-height: var(--topbar-height);
}

.top-bar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-date {
    font-size: 13px;
    color: var(--secondary);
}

.top-bar-date i { margin-right: 5px; }

/* ===== SIDEBAR TOGGLE (mobile) ===== */
.sidebar-toggle-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1035;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ===== CARDS ===== */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}

.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.card-header { background: white; border-bottom: 1px solid #e9ecef; font-weight: 600; padding: 1rem 1.25rem; border-radius: 10px 10px 0 0 !important; }
.card-stats .card-body { padding: 1.25rem; }
.card-stats h3 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.card-stats .icon {
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    font-size: 1.5rem;
}

/* ===== TABLES ===== */
.table { background: white; }
.table thead th { background: #f8f9fa; border-bottom: 2px solid #dee2e6; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.table-hover tbody tr:hover { background: #f8f9fa; }

.badge { padding: 0.4em 0.7em; font-weight: 500; }

.btn { font-size: 0.9rem; padding: 0.45rem 1rem; border-radius: 6px; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.825rem; }

.form-control, .form-select { border-radius: 6px; border: 1px solid #ced4da; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgba(26,84,144,0.15); }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    max-width: 420px; width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.login-card .card-header {
    background: var(--primary); color: white;
    text-align: center; padding: 2rem 1rem;
    border: none;
}
.login-card .card-header h2 { margin: 0; }
.login-card .card-body { padding: 2rem; }

/* ===== STAT CARDS ===== */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    height: 100%;
    display: flex; align-items: center; gap: 1rem;
}
.stat-card .icon { font-size: 2rem; }
.stat-card .stat-label { font-size: 0.85rem; color: #6c757d; text-transform: uppercase; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: #212529; }

/* ===== RECEIPT PRINT ===== */
.print-receipt { max-width: 80mm; margin: 20px auto; padding: 15px; font-family: 'Courier New', monospace; border: 1px dashed #333; }
@media print {
    .sidebar, .sidebar-overlay, .sidebar-toggle-btn, .top-bar, .btn-toolbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    body { background: white; }
    .print-receipt { border: none; }
}

.alert { border-radius: 8px; border: none; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info { background: #d1ecf1; color: #0c5460; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 1.5rem; margin: 0; }

.text-money { font-family: 'Courier New', monospace; font-weight: 600; }
.text-amount-positive { color: var(--success); font-weight: 600; }
.text-amount-negative { color: var(--danger); font-weight: 600; }

.list-empty { text-align: center; padding: 3rem 1rem; color: #6c757d; }
.list-empty i { font-size: 3rem; opacity: 0.3; }

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-toggle-btn {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        padding-top: 0;
    }
    .top-bar {
        padding: 12px 16px 12px 56px;
    }
    .top-bar-title {
        font-size: 15px;
    }
}
