/**
 * =============================================================================
 * FinCustomer Admin Dashboard Styles (Light Theme)
 * =============================================================================
 */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
    box-shadow: 1px 0 3px rgba(0,0,0,0.02);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.brand-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.brand-text span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.85rem;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 0.85rem 0.85rem 0.4rem;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-main);
    background: #f1f5f9;
    transform: translateX(2px);
}

.nav-item.active {
    color: var(--primary);
    background: #eff6ff;
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.nav-item .nav-badge {
    margin-left: auto;
    font-size: 0.72rem;
    background: #e2e8f0;
    color: var(--text-main);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-subtle);
    background: #f8fafc;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    margin-left: 270px;
    min-height: 100vh;
    min-width: 0;
    max-width: calc(100vw - 270px);
    width: calc(100% - 270px);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Top Navigation Bar */
.topbar {
    min-height: 68px;
    height: auto;
    padding: 0.65rem 1.75rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.page-title {
    min-width: 0;
}

.page-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.content-body {
    padding: 1.75rem;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* KPI Metric Cards */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.metric-info h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.metric-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Clickable KPI Metric Card Links */
a.metric-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

a.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    border-color: var(--primary);
}

a.metric-card:hover .metric-drilldown {
    color: var(--primary);
}

a.metric-card:hover .metric-drilldown i {
    transform: translateX(4px);
}

.metric-drilldown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--border-subtle);
    transition: all 0.2s ease;
}

.metric-drilldown i {
    transition: transform 0.2s ease;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.icon-blue   { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.icon-purple { background: #faf5ff; color: #9333ea; border: 1px solid #e9d5ff; }
.icon-green  { background: #f0fdf4; color: #059669; border: 1px solid #bbf7d0; }
.icon-amber  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

/* Filter Bar */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filter-search {
    flex: 1;
    min-width: 240px;
}

/* Visual Progress & Bar Charts */
.bar-chart-item {
    margin-bottom: 1.25rem;
}

.bar-chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.bar-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease-in-out;
}

.bar-primary { background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%); }
.bar-success { background: linear-gradient(90deg, #059669 0%, #10b981 100%); }
.bar-warning { background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%); }

/* Mobile Sidebar Toggle */
.menu-toggle {
    display: none;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
    .main-content {
        margin-left: 0;
        max-width: 100%;
        width: 100%;
    }
    .menu-toggle {
        display: block;
    }
}
