/* WaestaPay Custom Styles */

:root {
    --sidebar-width: 250px;
    --color-indigo: #6366f1;
    --color-emerald: #10b981;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar > .p-3 {
    flex-shrink: 0;
}

.sidebar > .nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: #f8f9fa;
}

.text-indigo {
    color: var(--color-indigo) !important;
}

.bg-indigo {
    background-color: var(--color-indigo) !important;
}

/* Sidebar nav links */
.sidebar .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.375rem;
    margin-bottom: 2px;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Stats cards */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

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

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

/* Metric cards (wallet system, fee revenue, reports) */
.metric-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.metric-card .metric-indicator {
    width: 4px;
    border-radius: 4px;
    flex-shrink: 0;
}

.metric-card .metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.metric-card .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.metric-card .metric-sub {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Status badges */
.badge-pending {
    background-color: #f59e0b;
    color: #000;
}

.badge-approved {
    background-color: #10b981;
}

.badge-rejected {
    background-color: #ef4444;
}

.badge-suspended {
    background-color: #6b7280;
}

.badge-completed {
    background-color: #10b981;
}

.badge-failed {
    background-color: #ef4444;
}

.badge-processing {
    background-color: #3b82f6;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #6b7280;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Collapsible sidebar */
.sidebar {
    transition: width 0.25s ease;
}

.sidebar .nav-link .nav-label,
.sidebar .sidebar-subtitle {
    transition: opacity 0.2s ease;
}

.sidebar-collapsed .sidebar {
    width: 60px;
}

.sidebar-collapsed .sidebar .p-3 {
    padding: 0.75rem 0.5rem !important;
    text-align: center;
}

.sidebar-collapsed .sidebar .p-3 a span {
    display: none;
}

.sidebar-collapsed .sidebar .p-3 a::after {
    content: 'W';
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-indigo);
}

.sidebar-collapsed .sidebar .sidebar-subtitle,
.sidebar-collapsed .sidebar .badge {
    display: none !important;
}

.sidebar-collapsed .sidebar .nav-link {
    text-align: center;
    padding: 0.6rem 0.5rem;
    position: relative;
}

.sidebar-collapsed .sidebar .nav-link i {
    margin-right: 0 !important;
    font-size: 1.1rem;
}

.sidebar-collapsed .sidebar .nav-link .nav-label {
    display: none;
}

.sidebar-collapsed .main-content {
    margin-left: 60px;
}

/* Tooltip for collapsed sidebar */
.sidebar-collapsed .sidebar .nav-link:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 200;
    margin-left: 8px;
    pointer-events: none;
}

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

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

    .main-content {
        margin-left: 0 !important;
    }

    #sidebarCollapseBtn {
        display: none !important;
    }
}

/* API key display */
.api-key-display {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background-color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    word-break: break-all;
}

/* Provider logos */
.provider-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.provider-mpesa {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.provider-mtn_momo {
    background-color: #fff8e1;
    color: #f57f17;
}

.provider-airtel {
    background-color: #ffebee;
    color: #c62828;
}

.provider-airtel_ke {
    background-color: #fce4ec;
    color: #b71c1c;
}

.provider-buni_kcb {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.provider-jenga_equity {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

/* Empty state */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    margin-bottom: 0.5rem;
}

.empty-state .btn {
    margin-top: 0.5rem;
}

/* Wallet cards */
.wallet-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Section cards (card-header based sections) */
.card {
    border-radius: 0.75rem;
}

.card-header {
    border-bottom: 1px solid #f0f0f0;
}

/* Transaction type badges */
.badge-collection {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-disbursement {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

/* ── Admin Sidebar Sections ── */
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.sidebar-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    padding: 0.85rem 0.75rem 0.25rem;
    margin-top: 0.15rem;
    text-transform: uppercase;
    white-space: nowrap;
    user-select: none;
}

.sidebar-section-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0.5rem 0.75rem;
}

.sidebar .sidebar-icon {
    width: 20px;
    text-align: center;
    margin-right: 0.65rem;
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.sidebar .nav-link:hover .sidebar-icon,
.sidebar .nav-link.active .sidebar-icon {
    opacity: 1;
}

.sidebar .nav-link {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    border-radius: 0.375rem;
    margin-bottom: 1px;
    color: rgba(255, 255, 255, 0.55) !important;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.1));
    color: #fff !important;
    border-left: 3px solid var(--color-indigo);
    padding-left: calc(0.75rem - 3px);
}

.sidebar .nav-link.active .sidebar-icon {
    color: var(--color-indigo);
}

.sidebar-badge {
    font-size: 0.6rem;
    padding: 0.2em 0.55em;
    min-width: 18px;
}

/* Hide section labels and badges in collapsed mode */
.sidebar-collapsed .sidebar .sidebar-section-label {
    display: none;
}

.sidebar-collapsed .sidebar .sidebar-section-divider {
    margin: 0.25rem 0.5rem;
}

.sidebar-collapsed .sidebar .sidebar-badge {
    display: none !important;
}

.sidebar-collapsed .sidebar .sidebar-icon {
    margin-right: 0 !important;
}

.sidebar-collapsed .sidebar .sidebar-scroll {
    padding: 0.25rem !important;
}

/* Compact KPI strip (dashboard summary row) — denser than .stat-card so a
   single row can carry more figures without pushing the charts below the fold.
   Each tile is its own card with a gap between, not one flush divided bar. */
.kpi-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.kpi-tile {
    flex: 1 1 160px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    min-width: 0;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-tile .kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.kpi-tile .kpi-label {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.kpi-tile .kpi-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
}

.kpi-tile .kpi-sub {
    font-size: 0.72rem;
    color: #9ca3af;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .kpi-tile {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

/* Compact chart card body — charts render inside a fixed-height box so a
   30-day line or a status donut doesn't stretch to fill leftover column space. */
.chart-card-body {
    position: relative;
    height: 260px;
}

.chart-card-body.chart-card-body-sm {
    height: 200px;
}

/* Password visibility toggle — injected by app.js around every
   input[type=password] so no template needs its own markup for it. */
.password-toggle-wrap {
    position: relative;
}

.password-toggle-wrap input {
    padding-right: 2.5rem !important;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #9ca3af;
    padding: 0.25rem 0.4rem;
    line-height: 1;
    cursor: pointer;
}

.password-toggle-btn:hover {
    color: #6b7280;
}

.password-toggle-btn:focus {
    outline: none;
    color: var(--color-indigo);
}
