/* =====================================================
   EE PARTNERS - ULTRA PREMIUM DESIGN SYSTEM
   Cupertino-Inspired with Depth & Glass Effects
   ===================================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Premium Color Palette */
    --primary-color: #1d1d1f;
    --primary-hover: #000000;
    --secondary-color: #f5f5f7;
    --accent-color: #0071e3;
    --accent-hover: #0077ed;
    --accent-light: rgba(0, 113, 227, 0.1);
    --accent-glow: rgba(0, 113, 227, 0.25);

    /* Text Colors - Apple Typography */
    --text-primary: #1d1d1f;
    --text-secondary: #424245;
    --text-muted: #86868b;
    --text-light: #f5f5f7;

    /* Background Colors with Depth */
    --background: #ffffff;
    --background-secondary: #f5f5f7;
    --background-tertiary: #fafafa;
    --card-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.18);

    /* Border & Divider */
    --border-color: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.03);
    --border-medium: rgba(0, 0, 0, 0.1);

    /* Status Colors - iOS Style */
    --success: #30d158;
    --success-bg: rgba(48, 209, 88, 0.15);
    --warning: #ff9f0a;
    --warning-bg: rgba(255, 159, 10, 0.15);
    --info: #0a84ff;
    --info-bg: rgba(10, 132, 255, 0.15);
    --error: #ff453a;
    --error-bg: rgba(255, 69, 58, 0.15);

    /* Sidebar - Premium Dark */
    --sidebar-bg: linear-gradient(180deg, #1a1a1c 0%, #0d0d0e 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(255, 255, 255, 0.1);

    /* Shadows - Multi-layered for Depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm:
        0 1px 2px rgba(0, 0, 0, 0.03),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    --shadow-md:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 16px 32px rgba(0, 0, 0, 0.04);
    --shadow-lg:
        0 4px 8px rgba(0, 0, 0, 0.02),
        0 16px 32px rgba(0, 0, 0, 0.08),
        0 32px 64px rgba(0, 0, 0, 0.06);
    --shadow-xl:
        0 8px 16px rgba(0, 0, 0, 0.04),
        0 24px 48px rgba(0, 0, 0, 0.1),
        0 48px 96px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 40px rgba(0, 113, 227, 0.15);
    --shadow-inner: inset 0 1px 2px rgba(0, 0, 0, 0.06);

    /* Transitions - Apple Smooth */
    --transition-micro: 0.1s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-fast: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-normal: 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-slow: 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Border Radius - Refined Apple Style */
    --radius-xs: 6px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-primary);
    line-height: 1.47059;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR - Premium Dark Glass Effect
   ===================================================== */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow:
        4px 0 24px rgba(0, 0, 0, 0.15),
        1px 0 0 rgba(255, 255, 255, 0.05) inset;
}

.sidebar-header {
    padding: 32px 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.logo-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    filter: brightness(1.1) contrast(1.05);
    transition: all var(--transition-normal);
}

.logo-image:hover {
    filter: brightness(1.2) contrast(1.1);
    transform: scale(1.02);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f5 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.logo-text {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #ffffff;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

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

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

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 6px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-color);
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-fast);
}

.nav-item a:hover {
    background-color: var(--sidebar-hover);
    color: rgba(255, 255, 255, 0.85);
}

.nav-item.active a {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #ffffff;
}

.nav-item.active a::before {
    height: 24px;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.6;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.sidebar-footer {
    padding: 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.03);
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.user-role {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    flex: 1;
    margin-left: 300px;
    padding: 40px 52px;
    min-height: 100vh;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 44px;
}

.header-left h1 {
    font-size: 40px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.035em;
    line-height: 1.1;
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subline {
    color: var(--text-secondary);
    font-size: 18px;
    margin-top: 10px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

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

.search-box input {
    padding: 14px 22px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    width: 300px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    color: var(--text-primary);
    font-weight: 400;
}

.search-box input:focus {
    outline: none;
    box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-light);
    transform: translateY(-1px);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Buttons - Premium Apple Style */
.btn-primary {
    background: linear-gradient(180deg, #0077ed 0%, #0071e3 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: -0.01em;
    box-shadow:
        0 2px 8px rgba(0, 113, 227, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
    pointer-events: none;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #0084ff 0%, #0077ed 100%);
    transform: translateY(-2px);
    box-shadow:
        0 4px 16px rgba(0, 113, 227, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(0, 113, 227, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--background-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(180deg, #34d058 0%, #30d158 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow:
        0 2px 8px rgba(48, 209, 88, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 16px rgba(48, 209, 88, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-success.disabled,
.btn-secondary.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* =====================================================
   KPI SECTION - Premium Cards with Depth
   ===================================================== */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 44px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-inner);
}

.kpi-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text-secondary);
    stroke-width: 1.6;
}

.kpi-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}

.kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.3;
    max-width: 100%;
}

.kpi-trend {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.kpi-trend.positive {
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.15) 0%, rgba(48, 209, 88, 0.1) 100%);
    color: var(--success);
}

.kpi-trend.negative {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.15) 0%, rgba(255, 69, 58, 0.1) 100%);
    color: var(--error);
}

/* =====================================================
   CONTENT GRID
   ===================================================== */
.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 28px;
}

/* =====================================================
   CARDS - Premium Glass Style
   ===================================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    z-index: 1;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 250, 1) 100%);
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.view-all {
    font-size: 15px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.view-all:hover {
    opacity: 0.7;
}

.badge {
    font-size: 13px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-weight: 500;
    box-shadow: var(--shadow-xs);
}

/* =====================================================
   TABLES - Premium Clean Style
   ===================================================== */
.table-container {
    overflow-x: auto;
}

.appointments-table,
.clients-table,
.catalog-table,
.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.appointments-table th,
.appointments-table td,
.clients-table th,
.clients-table td,
.catalog-table th,
.catalog-table td,
.analytics-table th,
.analytics-table td {
    padding: 20px 32px;
    text-align: left;
}

.appointments-table th,
.clients-table th,
.catalog-table th,
.analytics-table th {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f7 100%);
}

.appointments-table tr,
.clients-table tr,
.catalog-table tr,
.analytics-table tr {
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.appointments-table tbody tr:hover,
.clients-table tbody tr:hover,
.catalog-table tbody tr:hover,
.analytics-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(0, 113, 227, 0.02) 0%, transparent 100%);
}

.appointments-table tbody tr:last-child,
.clients-table tbody tr:last-child,
.catalog-table tbody tr:last-child,
.analytics-table tbody tr:last-child {
    border-bottom: none;
}

/* Client Cell */
.client-cell {
    display: flex;
    align-items: center;
    gap: 16px;
}

.client-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

/* Tags */
.service-tag {
    display: inline-block;
    padding: 7px 16px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 6px;
    box-shadow: var(--shadow-xs);
}

.product-tag {
    display: inline-block;
    padding: 7px 16px;
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.12) 0%, rgba(10, 132, 255, 0.08) 100%);
    color: var(--info);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 6px;
}

/* Status Badges */
.status {
    display: inline-block;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status.completed {
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.15) 0%, rgba(48, 209, 88, 0.1) 100%);
    color: var(--success);
}

.status.in-progress {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.15) 0%, rgba(10, 132, 255, 0.1) 100%);
    color: var(--info);
}

.status.scheduled {
    background: linear-gradient(135deg, rgba(255, 159, 10, 0.15) 0%, rgba(255, 159, 10, 0.1) 100%);
    color: var(--warning);
}

.status.no-show {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.15) 0%, rgba(255, 69, 58, 0.1) 100%);
    color: var(--error);
}

/* DateTime Cell */
.datetime-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.datetime-cell .date {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.datetime-cell .time {
    font-size: 13px;
    color: var(--text-muted);
}

/* =====================================================
   CROSS-SELL COMBOS
   ===================================================== */
.combos-card .combo-list {
    list-style: none;
}

.combo-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 32px;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.combo-item:hover {
    background: linear-gradient(90deg, rgba(0, 113, 227, 0.02) 0%, transparent 100%);
}

.combo-item:last-child {
    border-bottom: none;
}

.combo-rank {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.combo-item:nth-child(1) .combo-rank {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #7a5c00;
    box-shadow: 0 4px 12px rgba(255, 183, 0, 0.35);
}

.combo-item:nth-child(2) .combo-rank {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    color: #5a5a5a;
    box-shadow: 0 4px 12px rgba(168, 168, 168, 0.35);
}

.combo-item:nth-child(3) .combo-rank {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(184, 115, 51, 0.35);
}

.combo-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.combo-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.combo-stats {
    font-size: 14px;
    color: var(--text-muted);
}

.combo-revenue {
    font-size: 17px;
    font-weight: 700;
    color: var(--success);
}

/* =====================================================
   PAGE VISIBILITY
   ===================================================== */
.page {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.page.active {
    display: block;
}

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

/* =====================================================
   MODALS - Premium Glass Sheet Style
   ===================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-drawer {
    width: 520px;
    max-width: 100%;
    height: 100%;
    background: var(--card-bg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.active .modal-drawer {
    transform: translateX(0);
}

.modal-drawer-wide {
    width: 640px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 36px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 250, 1) 100%);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.modal-close {
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all var(--transition-fast);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-xs);
}

.modal-close:hover {
    background: linear-gradient(135deg, #e8e8ed 0%, #d2d2d7 100%);
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-body {
    flex: 1;
    padding: 36px;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-footer {
    display: flex;
    gap: 16px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
    margin-top: 32px;
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    flex: 1;
}

/* =====================================================
   FORMS - Apple Style
   ===================================================== */
.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.form-group select,
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f5f7 0%, #ebebf0 100%);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-inner);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: var(--card-bg);
    box-shadow: 0 0 0 4px var(--accent-light), var(--shadow-sm);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-height: 260px;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f7 0%, #ebebf0 100%);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-inner);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--card-bg);
    box-shadow: var(--shadow-xs);
}

.checkbox-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.checkbox-item:has(input:checked) {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.1) 0%, rgba(0, 113, 227, 0.05) 100%);
    color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.checkbox-single {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
}

.checkbox-single input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.checkbox-single span {
    user-select: none;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 80px 32px;
}

.empty-state .empty-icon {
    display: block;
    margin-bottom: 28px;
    color: var(--text-muted);
}

.empty-state .empty-icon svg {
    width: 72px;
    height: 72px;
    stroke-width: 1;
    opacity: 0.6;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 17px;
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.5;
}

.empty-state-row td {
    border-bottom: none !important;
}

/* =====================================================
   BACK BUTTON
   ===================================================== */
.btn-back {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    opacity: 0.7;
}

.btn-back span {
    font-size: 20px;
}

/* =====================================================
   DETAILS LAYOUT
   ===================================================== */
.details-layout {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 28px;
}

.details-main,
.details-sidebar {
    min-width: 0;
}

.details-card .details-content {
    padding: 36px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--border-light);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-value {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.detail-section {
    margin-bottom: 32px;
}

.detail-section .detail-label {
    margin-bottom: 14px;
    display: block;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-notes {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 24px 28px;
    background: linear-gradient(135deg, #f5f5f7 0%, #ebebf0 100%);
    border-radius: var(--radius-md);
    margin-top: 12px;
    box-shadow: var(--shadow-inner);
}

.no-products {
    color: var(--text-muted);
    font-size: 15px;
    font-style: italic;
}

/* =====================================================
   RECOMMENDATIONS
   ===================================================== */
.recommendations-card {
    position: sticky;
    top: 28px;
}

.recommendations-content {
    padding: 28px 32px 36px;
}

.recommendations-group {
    margin-bottom: 36px;
}

.recommendations-group:last-child {
    margin-bottom: 0;
}

.recommendations-group h3 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.no-recommendations {
    font-size: 15px;
    color: var(--text-muted);
    font-style: italic;
    padding: 28px;
    text-align: center;
    background: linear-gradient(135deg, #f5f5f7 0%, #ebebf0 100%);
    border-radius: var(--radius-md);
}

.recommendation-card {
    background: linear-gradient(135deg, #f5f5f7 0%, #ebebf0 100%);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.recommendation-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 12px;
}

.rec-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.rec-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    background: var(--card-bg);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.rec-reason {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}

.rec-actions {
    display: flex;
    gap: 12px;
}

.btn-add {
    flex: 1;
    background: linear-gradient(180deg, #0077ed 0%, #0071e3 100%);
    color: #ffffff;
    border: none;
    padding: 12px 18px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
}

.btn-dismiss {
    background: var(--card-bg);
    color: var(--text-muted);
    border: none;
    padding: 12px 18px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.btn-dismiss:hover {
    background: var(--background-tertiary);
    color: var(--text-secondary);
}

/* =====================================================
   CLIENTS
   ===================================================== */
.client-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.client-tag {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.visit-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 36px;
    padding: 0 16px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xs);
}

/* Profile Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 28px;
}

.profile-main,
.profile-sidebar {
    min-width: 0;
}

.profile-summary-card {
    margin-bottom: 28px;
}

.profile-summary-content {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 36px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 250, 1) 100%);
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.profile-info {
    flex: 1;
    display: flex;
    gap: 48px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.profile-details {
    padding: 36px;
}

.profile-detail-section {
    margin-bottom: 32px;
}

.profile-detail-section:last-child {
    margin-bottom: 0;
}

.detail-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 10px;
}

/* Insights Card */
.insights-card {
    position: sticky;
    top: 28px;
    margin-bottom: 28px;
}

.insights-content {
    padding: 32px;
}

.insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.insight-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.insight-item:first-child {
    padding-top: 0;
}

.insight-label {
    font-size: 15px;
    color: var(--text-secondary);
}

.insight-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Suggested Content */
.suggested-content {
    padding: 32px;
}

.suggested-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.suggested-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f5f5f7 0%, #ebebf0 100%);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.suggested-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.suggested-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggested-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.suggested-reason {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-suggest {
    background: linear-gradient(180deg, #0077ed 0%, #0071e3 100%);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.btn-suggest:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
}

/* =====================================================
   CATALOG (Services & Products)
   ===================================================== */
.catalog-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.price-cell {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 7px 18px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

/* Use Case Badges */
.usecase-badge {
    display: inline-block;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

/* Toggle Switch - Apple Style */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9e9eb;
    border-radius: 31px;
    transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* =====================================================
   RULES PAGE
   ===================================================== */
.rules-tabs {
    display: flex;
    gap: 4px;
    background: rgba(118, 118, 128, 0.12);
    padding: 3px;
    border-radius: var(--radius-sm);
    margin-bottom: 36px;
    width: fit-content;
}

.rules-tab {
    padding: 11px 24px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rules-tab:hover {
    color: var(--text-primary);
}

.rules-tab.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.rules-section {
    display: none;
}

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

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.rules-info h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.025em;
}

.rules-info p {
    font-size: 16px;
    color: var(--text-muted);
}

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.empty-rules {
    text-align: center;
    padding: 80px 32px;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.empty-rules .empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 24px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-rules p {
    color: var(--text-muted);
    font-size: 17px;
}

.rule-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.rule-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

.rule-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.rule-card.inactive {
    opacity: 0.5;
    background: var(--background-tertiary);
}

.rule-content {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.rule-trigger {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rule-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
}

.rule-service {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1d1d1f 0%, #3d3d3f 100%);
    color: #ffffff;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.rule-arrow {
    font-size: 24px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.rule-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.rule-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rule-item {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.rule-reason {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f5f5f7 0%, #ebebf0 100%);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    box-shadow: var(--shadow-inner);
}

.rule-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-icon.btn-delete:hover {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.15) 0%, rgba(255, 69, 58, 0.1) 100%);
    color: var(--error);
}

.btn-icon span {
    font-size: 20px;
}

/* =====================================================
   ANALYTICS PAGE
   ===================================================== */
.data-label {
    font-size: 13px;
    color: var(--text-muted);
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    box-shadow: var(--shadow-xs);
}

.analytics-kpi-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 36px;
}

.analytics-kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.analytics-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

.analytics-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
}

.analytics-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.analytics-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    z-index: 1;
}

.analytics-card .card-header {
    padding: 24px 32px;
}

.chart-container {
    padding: 32px;
    min-height: 240px;
}

/* Revenue Split Chart */
.revenue-split-chart {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.split-bar {
    height: 64px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    border-radius: var(--radius-md);
    display: flex;
    overflow: hidden;
    box-shadow: var(--shadow-inner);
}

.split-segment {
    height: 100%;
    transition: width 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.split-segment.services {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.split-segment.products {
    background: linear-gradient(90deg, #30d158 0%, #28b14c 100%);
}

.split-legend {
    display: flex;
    gap: 56px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    box-shadow: var(--shadow-xs);
}

.legend-color.services {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.legend-color.products {
    background: linear-gradient(135deg, #30d158 0%, #28b14c 100%);
}

.legend-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Trend Chart */
.trend-chart {
    height: 220px;
}

.trend-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    gap: 10px;
}

.trend-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 12px;
}

.trend-bar {
    width: 100%;
    max-width: 44px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px 10px 0 0;
    min-height: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    transition: height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: 0 -4px 12px rgba(102, 126, 234, 0.25);
}

.trend-value {
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    position: absolute;
    top: 8px;
}

.trend-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.analytics-tables-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

/* Combo Cell */
.combo-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.combo-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.combo-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    width: fit-content;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
}

.combo-count {
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 14px;
    box-shadow: var(--shadow-xs);
}

/* Rate Cell */
.rate-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rate-bar-bg {
    width: 90px;
    height: 10px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: var(--shadow-inner);
}

.rate-bar {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.rate-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 48px;
}

.rec-type-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
}

/* =====================================================
   OUTREACH PAGE
   ===================================================== */
.outreach-tabs {
    display: flex;
    gap: 4px;
    background: rgba(118, 118, 128, 0.12);
    padding: 3px;
    border-radius: var(--radius-sm);
    margin-bottom: 36px;
    width: fit-content;
    overflow-x: auto;
}

.outreach-tab {
    padding: 11px 20px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.outreach-tab:hover {
    color: var(--text-primary);
}

.outreach-tab.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.outreach-kpi-section {
    margin-bottom: 36px;
}

.outreach-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    gap: 24px;
}

.suggestion-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.suggestion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

.suggestion-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}

.suggestion-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.suggestion-client {
    display: flex;
    align-items: center;
    gap: 18px;
}

.suggestion-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.suggestion-client-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-client-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.suggestion-reason {
    font-size: 14px;
    color: var(--text-muted);
}

.suggestion-type-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.suggestion-preview {
    margin-bottom: 28px;
}

.suggestion-subject {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.suggestion-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.suggestion-actions {
    display: flex;
    gap: 14px;
}

.suggestion-actions .btn-preview {
    flex: 1;
    background: linear-gradient(180deg, #0077ed 0%, #0071e3 100%);
    color: #ffffff;
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.suggestion-actions .btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.4);
}

.suggestion-actions .btn-dismiss-suggestion {
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-muted);
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.suggestion-actions .btn-dismiss-suggestion:hover {
    background: linear-gradient(135deg, #e8e8ed 0%, #d2d2d7 100%);
    color: var(--text-secondary);
}

/* Email Preview */
.email-preview {
    background: linear-gradient(135deg, #f5f5f7 0%, #ebebf0 100%);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-inner);
}

.email-preview-header {
    padding: 32px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
}

.email-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.email-meta-item {
    display: flex;
    align-items: center;
    gap: 18px;
}

.email-meta-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 90px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.email-meta-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.email-type-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.email-preview-body {
    padding: 36px;
    background: #ffffff;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    min-height: 240px;
    max-height: 440px;
    overflow-y: auto;
}

.outreach-suggestions .empty-state {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 80px 32px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

/* =====================================================
   NOTIFICATIONS - Apple Toast Style
   ===================================================== */
.notification {
    position: fixed;
    bottom: 36px;
    right: 36px;
    background: linear-gradient(135deg, #1d1d1f 0%, #3d3d3f 100%);
    color: #ffffff;
    padding: 20px 36px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    transform: translateY(140px);
    opacity: 0;
    transition: all 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 2000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Loading State */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 64px 32px;
    color: var(--text-secondary);
    font-size: 16px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-row td {
    padding: 0 !important;
}

/* Clickable Row */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: linear-gradient(90deg, rgba(0, 113, 227, 0.02) 0%, transparent 100%);
}

/* =====================================================
   SCROLLBAR - Premium Apple Style
   ===================================================== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
    border: 3px solid transparent;
    background-clip: padding-box;
}

/* =====================================================
   SELECTION
   ===================================================== */
::selection {
    background-color: rgba(0, 113, 227, 0.2);
    color: inherit;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 1400px) {
    .analytics-kpi-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-charts-row,
    .analytics-tables-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .kpi-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .details-layout,
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .recommendations-card,
    .insights-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 84px;
    }

    .sidebar-header {
        padding: 24px 16px;
    }

    .logo-image {
        max-width: 48px;
    }

    .logo-text,
    .nav-text,
    .user-details {
        display: none;
    }

    .nav-item a {
        justify-content: center;
        padding: 16px;
    }

    .nav-item a::before {
        display: none;
    }

    .user-info {
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        margin-left: 84px;
        padding: 24px;
    }

    .main-header {
        flex-direction: column;
        gap: 24px;
    }

    .header-right {
        width: 100%;
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
    }

    .kpi-section {
        grid-template-columns: 1fr;
    }

    .outreach-suggestions {
        grid-template-columns: 1fr;
    }

    .rules-tabs,
    .outreach-tabs {
        width: 100%;
    }

    .rules-tab,
    .outreach-tab {
        flex: 1;
        text-align: center;
        padding: 12px 16px;
        font-size: 13px;
    }

    .rules-header {
        flex-direction: column;
        gap: 20px;
    }

    .rules-header .btn-primary {
        width: 100%;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}
