* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color: rgba(18, 35, 51, .7);
    --active-color: #3a3a3a;
    --disabled-color: rgba(18, 35, 51, .4);
    --hover-bg: rgba(207, 228, 233, .7);
    --active-bg: rgb(18 19 26 / 7%);
}

@font-face {
    font-family: Inter;
    src: url('./fonts/Inter/Inter_18pt-Regular.ttf');
    font-weight: 400;
}

body {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    background: #F8FAFA;
    color: #333;
}

#app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #eaf4f6;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.logo {
    padding: 0 20px 30px;
}

.logo img {
    width: 100px;
    height: auto;
}

.logo-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    margin: 0 20px;
}

.nav-menu-shadow {
    background: linear-gradient(270deg, rgba(55, 80, 94, .091) -25%, hsla(0, 0%, 85%, 0));
    bottom: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    z-index: 1;
}

.nav-menu {
    flex: 1;
}

.nav-item {
    height: 34px;
    margin: 5px 50px;
    padding: 8px 20px 8px 20px;
    position: relative;
    cursor: pointer;
    border-radius: 40px;
    user-select: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item-name {
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 16px;
    font-size: 13px;
}


.nav-item-icon, .nav-item-icon-active {
    margin-bottom: -4px;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
    background: var(--active-bg);
    color: var(--active-color);
}

.nav-item.active .nav-item-icon-active {
    display: block;
}

.nav-item .nav-item-icon-active {
    display: none;
}

.nav-item.active .nav-item-icon {
    display: none;
}

.nav-item .nav-item-icon {
    display: block;
}

.nav-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.user-info {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #999;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 32px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    color: #667eea;
}

.balance-badge {
    background: #4caf50;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn {
    background: none;
    border: 1px solid #ddd;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    background: #f0f0f0;
}

.subtitle {
    color: #999;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.period-selector label {
    color: #666;
    font-size: 14px;
}

.period-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-card.green {
    background: linear-gradient(135deg, #81c784 0%, #66bb6a 100%);
    color: white;
}

.stat-card.red {
    background: linear-gradient(135deg, #e57373 0%, #ef5350 100%);
    color: white;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    opacity: 0.95;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.stat-value {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    margin-bottom: 20px;
}

.stat-footer {
    font-size: 13px;
    opacity: 0.9;
}

/* Chart Section */
.chart-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.chart-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.chart-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.chart-tabs {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.chart-tab {
    padding: 6px 16px;
    border: none;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.chart-tab.active {
    background: #667eea;
    color: white;
}

.chart-legend {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.blue {
    background: #2196f3;
}

.legend-color.light-blue {
    background: #64b5f6;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Segments Table */
.segments-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.segments-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
}

.segments-table {
    width: 100%;
    border-collapse: collapse;
}

.segments-table th {
    text-align: left;
    padding: 12px;
    font-weight: 500;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid #f0f0f0;
}

.segments-table td {
    padding: 12px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}

.segment-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.segment-badge.dark {
    background: #37474f;
    color: white;
}

.segment-badge.orange {
    background: #ff9800;
    color: white;
}

.segment-badge.gray {
    background: #e0e0e0;
    color: #666;
}

.segment-badge.red {
    background: #f44336;
    color: white;
}

.segment-badge.yellow {
    background: #ffc107;
    color: #333;
}

/* Clients Page */
.clients-grid {
    display: grid;
    gap: 15px;
}

.client-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.client-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.client-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
    flex-shrink: 0;
}

.client-info {
    flex: 1;
}

.client-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.client-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.client-stats {
    display: flex;
    gap: 30px;
    margin-left: auto;
}

.client-stat {
    text-align: center;
}

.client-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
}

.client-stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* Client Detail Page */
.client-detail-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.client-detail-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 40px;
    flex-shrink: 0;
}

.client-detail-info {
    flex: 1;
}

.client-detail-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.client-detail-meta {
    display: flex;
    gap: 30px;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.client-detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.client-detail-stat {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.client-detail-stat-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.client-detail-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #667eea;
}

/* Orders Page */
.orders-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.orders-table table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: 15px 20px;
    font-weight: 500;
    font-size: 13px;
    color: #666;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.orders-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.orders-table tr:hover {
    background: #f8f9fa;
}

.order-id {
    color: #667eea;
    font-weight: 500;
}

.order-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.order-status.completed {
    background: #e8f5e9;
    color: #4caf50;
}

.order-status.pending {
    background: #fff3e0;
    color: #ff9800;
}

.order-status.cancelled {
    background: #ffebee;
    color: #f44336;
}

.order-amount {
    font-weight: 600;
    color: #333;
}

/* Search and Filters */
.filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    min-width: 150px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .logo-placeholder {
        font-size: 14px;
        padding: 8px;
    }
    
    .user-details {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .client-stats {
        flex-direction: column;
        gap: 10px;
    }
}
