@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Finexy Color System */
    --primary-orange: #fe5d26;
    --primary-dark: #1a1c1e;
    --bg-app: #f8f9fb;
    --bg-white: #ffffff;
    --text-main: #1a1c1e;
    --text-muted: #8e9196;
    --border-soft: rgba(0,0,0,0.05);
    --shadow-card: 0 10px 40px rgba(0,0,0,0.03);
    
    /* Spacing & Sizing */
    --sidebar-width: 80px;
    --radius-xl: 32px;
    --radius-lg: 20px;
    --radius-md: 12px;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html, body {
    height: 100%;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* --- Mini Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    z-index: 100;
}

.logo-container {
    margin-bottom: 40px;
}

.logo-img {
    width: 40px;
    height: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.nav-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-icon:hover {
    background: #f0f1f3;
    color: var(--primary-orange);
}

.nav-icon.active {
    background: var(--primary-dark);
    color: var(--bg-white);
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-app);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

/* --- Main Content --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px 40px;
    gap: 30px;
}

/* --- Top Header & Pill Nav --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-pills {
    display: flex;
    background: var(--bg-white);
    padding: 6px;
    border-radius: var(--radius-lg);
    gap: 5px;
    box-shadow: var(--shadow-card);
}

.nav-pill {
    padding: 10px 20px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-pill.active {
    background: var(--primary-dark);
    color: var(--bg-white);
}

.nav-pill:hover:not(.active) {
    background: #f0f1f3;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    cursor: pointer;
    position: relative;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--primary-orange);
    border-radius: 50%;
    border: 2px solid white;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-white);
    padding: 6px 16px 6px 6px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #eee;
    overflow: hidden;
}

/* --- Dashboard Specifics --- */
.welcome-section h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* --- Cards --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.balance-card {
    grid-column: span 4;
}

.metrics-column {
    grid-column: span 3;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-card {
    grid-column: span 5;
}

.metric-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.metric-card.accent {
    background: var(--primary-orange);
    color: white;
}

.metric-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 20px;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.metric-trend {
    font-size: 0.75rem;
    font-weight: 700;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.metric-card.accent .trend-up, .metric-card.accent .trend-down { color: white; opacity: 0.8; }

/* --- Table Styles --- */
.activities-section {
    grid-column: span 12;
}

.table-container {
    width: 100%;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 15px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-soft);
}

td {
    padding: 18px 15px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.9rem;
}

.status-badge {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-completed { background: rgba(16,185,129,0.1); color: var(--success); }
.status-pending { background: rgba(245,158,11,0.1); color: var(--warning); }
.status-progress { background: rgba(59,130,246,0.1); color: #3b82f6; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-completed .status-dot { background: var(--success); }
.status-pending .status-dot { background: var(--warning); }
.status-progress .status-dot { background: #3b82f6; }

/* Buttons */
.btn-transfer {
    background: var(--primary-dark);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.btn-request {
    background: transparent;
    border: 1px solid var(--border-soft);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* --- Keyframes & Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-fade-in { animation: fadeInUp 0.6s ease forwards; }

/* --- Section Switching --- */
.section-content {
    display: none;
    animation: fadeInUp 0.4s ease forwards;
}

.section-content.active {
    display: block;
}

/* --- Micro-Interactions --- */
.card, .metric-card, .nav-icon, .nav-pill, .btn-transfer, .btn-request {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.nav-pill:active { transform: scale(0.95); }

/* --- Search UI Enhanced --- */
.search-results-overlay {
    position: absolute;
    top: 55px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    border: 1px solid var(--border-soft);
}

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-item:hover {
    background: #f8f9fb;
}

.search-result-item i {
    color: var(--primary-orange);
}

/* --- Currency Standarization --- */
.currency-inr::before {
    content: '₹';
    margin-right: 2px;
}

/* Custom Table Styles */
.table-container {
    overflow-x: auto;
}

.status-badge {
    position: relative;
    overflow: hidden;
}

.status-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    to { left: 200%; }
}

/* --- Mobile Adjustments & Responsive Design --- */

/* Utility for Responsive Grid */
.card-grid.responsive {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .card-grid.responsive {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .card-grid.responsive > * {
        grid-column: span 1 !important;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    body {
        overflow-y: auto;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding-bottom: 80px; /* Space for bottom nav */
    }

    /* Transform Sidebar to Bottom Nav */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 0 20px;
        border-right: none;
        border-top: 1px solid var(--border-soft);
        justify-content: space-around;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
    }

    .logo-container {
        display: none; /* Hide logo in bottom nav */
    }

    .sidebar-nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }

    .sidebar-bottom {
        display: none; /* Hide secondary bottom icons or move them */
    }

    .main-wrapper {
        padding: 20px 15px;
        flex: none;
        width: 100%;
    }

    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .nav-pills {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding: 8px;
        display: flex;
        -ms-overflow-style: none;
        scrollbar-width: none;
        border-radius: 16px;
    }

    .nav-pills::-webkit-scrollbar {
        display: none;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .welcome-section {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 20px;
    }

    .welcome-section div {
        width: 100%;
    }

    .welcome-section h1 {
        font-size: 1.6rem !important;
    }

    /* Grid Stacking */
    .card-grid.responsive {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .card-grid.responsive > * {
        grid-column: span 1 !important;
    }

    /* Specific Card Fixes */
    .profit-badge {
        padding: 20px !important;
    }

    .profit-badge div:nth-child(2) {
        font-size: 2.2rem !important;
    }

    .metric-value {
        font-size: 1.4rem !important;
    }

    /* Table Responsiveness */
    .table-container {
        margin: 0 -15px;
        width: calc(100% + 30px);
        padding: 0 15px;
    }

    table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .nav-pill {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}


