/* ==============================================================================
   Grape Digital — Apple Clean Design System (Reseller Platform)
   Inspired by Apple macOS Sonoma & iOS 17 Cupertino Human Interface Guidelines
   STRICT RULE: ZERO Emojis. Exclusively clean SVGs and modern typography.
   ============================================================================== */

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

:root {
    /* Apple Palette */
    --bg-canvas: #fbfbfd;
    --bg-surface: #f5f5f7;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafc;
    
    --border: rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);
    --border-focus: #0071e3;
    
    --primary: #0071e3;
    --primary-hover: #0077ed;
    --primary-light: rgba(0, 113, 227, 0.08);
    --primary-gradient: linear-gradient(180deg, #0077ed 0%, #0071e3 100%);
    
    --text-main: #1d1d1f;
    --text-secondary: #515154;
    --text-muted: #86868b;
    --text-dim: #a1a1a6;
    
    --success: #34c759;
    --success-bg: rgba(52, 199, 89, 0.12);
    --success-text: #248a3d;
    
    --warning: #ff9500;
    --warning-bg: rgba(255, 149, 0, 0.12);
    --warning-text: #b26a00;
    
    --danger: #ff3b30;
    --danger-bg: rgba(255, 59, 48, 0.1);
    --danger-text: #d70015;
    
    --info: #5856d6;
    --info-bg: rgba(88, 86, 214, 0.1);
    
    /* Geometry & Squircles */
    --radius-xl: 22px;
    --radius: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 980px;
    
    /* Shadows */
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 10px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
    --shadow-modal: 0 24px 60px -12px rgba(0, 0, 0, 0.18), 0 10px 20px -5px rgba(0, 0, 0, 0.08);
    
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    letter-spacing: -0.012em;
}

/* Apple Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 980px;
    border: 2px solid var(--bg-canvas);
}
::-webkit-scrollbar-thumb:hover {
    background: #a1a1a6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-main);
}
p {
    color: var(--text-secondary);
    line-height: 1.5;
}
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

/* App Shell Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar (macOS Sonoma Fixed Style) */
.sidebar {
    width: 270px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.brand-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #0071e3 0%, #5856d6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}
.brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
}
.brand-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 7px;
    border-radius: 980px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 12px 14px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-dim);
    padding: 14px 12px 6px 12px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.nav-link svg {
    color: var(--text-muted);
    transition: var(--transition);
}
.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}
.nav-link:hover svg {
    color: var(--primary);
}
.nav-link.active {
    background-color: #ffffff;
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-subtle);
}
.nav-link.active svg {
    color: var(--primary);
}

/* Sidebar Footer / Balance Card (Permanently pinned to bottom left) */
.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    margin-top: auto;
    background: var(--bg-surface);
}
.balance-widget {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.balance-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.balance-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* Main Content Area (Offset by fixed sidebar width) */
.main-wrapper {
    margin-left: 270px;
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: calc(100% - 270px);
    background-color: var(--bg-canvas);
    min-height: 100vh;
    box-sizing: border-box;
}

/* Top Navigation Bar */
.topbar {
    height: 64px;
    border-bottom: 1px solid var(--border);
    background-color: rgba(251, 251, 253, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
}
.topbar-title {
    font-size: 18px;
    font-weight: 600;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Picker Dropdown */
.lang-selector-dropdown {
    position: relative;
    display: inline-block;
}
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 113, 227, 0.04);
}
.lang-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 155px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 9999;
}
.lang-dropdown-menu.show {
    display: flex !important;
}

/* Facilitador no PC Desktop: Hover e Foco revelam o menu suavemente */
@media (hover: hover) and (pointer: fine) {
    .lang-selector-dropdown:hover .lang-dropdown-menu {
        display: flex;
    }
}
.lang-selector-dropdown:focus-within .lang-dropdown-menu {
    display: flex;
}
.lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
}
.lang-item:hover {
    background: var(--bg-surface);
    color: var(--text-main);
}
.lang-item.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
}
.lang-abbr {
    font-size: 10px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 5px;
    border-radius: 4px;
}
.lang-check {
    margin-left: auto;
    color: var(--primary);
}

/* Page Content Container */
.content-body {
    padding: 28px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Cards & Containers */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-hover);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Stats Metric Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.metric-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}
.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.metric-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.metric-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}
.metric-big-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
}
.metric-badge {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Products Wholesale Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.product-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-subtle);
    transition: var(--transition);
}
.product-card:hover {
    border-color: rgba(0, 113, 227, 0.3);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.provider-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 8px;
    border-radius: 6px;
}
.stock-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 980px;
}
.stock-pill.in-stock {
    background: var(--success-bg);
    color: var(--success-text);
}
.stock-pill.out-of-stock {
    background: var(--danger-bg);
    color: var(--danger-text);
}
.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
}
.price-container {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.price-tag {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.03em;
}
.price-period {
    font-size: 12px;
    color: var(--text-muted);
}
.markup-chip {
    font-size: 11px;
    background: #f0f0f4;
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.28);
}
.btn-primary:hover {
    background: linear-gradient(180deg, #007bf8 0%, #0071e3 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.38);
}
.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: #e5e5ea;
    color: var(--text-main);
}
.btn-success {
    background: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background: #2db34f;
    color: #ffffff;
}
.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: #e03228;
    color: #ffffff;
}
.btn-block {
    width: 100%;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Forms & Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}
.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* Tables */
.table-container {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}
.data-table th {
    background: var(--bg-surface);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
}
.data-table tr:last-child td {
    border-bottom: none;
}
.data-table tr:hover td {
    background: #fafafc;
}

/* Badges & Status */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}
.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}
.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}
.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* Flash Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(52, 199, 89, 0.2);
}
.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* Modal Cupertino Style */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
}
.modal-sheet {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    padding: 28px;
    box-shadow: var(--shadow-modal);
    position: relative;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-close-btn {
    background: #f0f0f2;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}
.modal-close-btn:hover {
    background: #e5e5ea;
    color: var(--text-main);
}

/* Pagination Cupertino Design */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 28px 0 12px;
    flex-wrap: wrap;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}
.pagination-btn:hover:not(.active):not(:disabled) {
    background: var(--bg-surface);
    border-color: rgba(0, 113, 227, 0.4);
    color: var(--primary);
    transform: translateY(-1px);
}
.pagination-btn.active {
    background: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
    pointer-events: none;
}
.pagination-btn:disabled,
.pagination-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 10px;
    align-self: center;
}

/* Mobile Navigation Bar & Overlay */
.mobile-topbar {
    display: none;
    height: 56px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 990;
}
.mobile-menu-btn {
    background: transparent;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
}
.mobile-menu-btn:hover {
    background: var(--bg-surface);
}
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments (Mobile & Tablet Cupertino) */
@media (max-width: 900px) {
    .mobile-topbar {
        display: flex;
    }
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1100;
        background: #ffffff;
        box-shadow: var(--shadow-modal);
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
        min-width: 0;
        width: 100%;
    }
    .topbar {
        display: none; /* Substituído pelo mobile-topbar */
    }
    .content-body {
        padding: 16px;
    }
    .metrics-grid, .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .modal-sheet {
        padding: 20px;
        max-width: 95vw;
        max-height: 92vh;
        overflow-y: auto;
        border-radius: var(--radius);
    }
}

/* ==============================================================================
   CUPERTINO METRICS & STATS WIDGETS (Matching Apple Clean Design)
   ============================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.stat-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}
.stat-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--text-main);
    line-height: 1.1;
}
.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.stat-icon.green  { background: rgba(52, 199, 89, 0.12); color: #34c759; }
.stat-icon.orange { background: rgba(255, 149, 0, 0.12); color: #ff9500; }
.stat-icon.purple { background: rgba(88, 86, 214, 0.1); color: #5856d6; }
.stat-icon.red    { background: rgba(255, 59, 48, 0.1); color: #ff3b30; }

/* Status Pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 980px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}
.pill.green  { background: rgba(52, 199, 89, 0.12); color: #248a3d; }
.pill.yellow { background: rgba(255, 149, 0, 0.12); color: #b26a00; }
.pill.blue   { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.pill.purple { background: rgba(88, 86, 214, 0.1); color: #5856d6; }
.pill.red    { background: rgba(255, 59, 48, 0.1); color: #d70015; }

/* ==============================================================================
   APPLE SEGMENTED TAB BAR & COMPACT SETTINGS CARDS
   ============================================================================== */
.apple-tabs-container {
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
}
.apple-segmented-bar {
    display: inline-flex;
    background: rgba(118, 118, 128, 0.1);
    padding: 4px;
    border-radius: 980px;
    gap: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
.apple-segment-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 980px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}
.apple-segment-btn:hover {
    color: var(--text-main);
}
.apple-segment-btn.active {
    background: #ffffff;
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.segment-icon-badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 11px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.segment-icon-badge.api         { background: linear-gradient(135deg, #0071e3, #2563eb); }
.segment-icon-badge.markup      { background: linear-gradient(135deg, #ff9500, #f97316); }
.segment-icon-badge.binance     { background: linear-gradient(135deg, #f0b90b, #d4a000); }
.segment-icon-badge.wallet      { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.segment-icon-badge.email       { background: linear-gradient(135deg, #34c759, #10b981); }
.segment-icon-badge.telegram    { background: linear-gradient(135deg, #0284c7, #06b6d4); }
.segment-icon-badge.all         { background: linear-gradient(135deg, #64748b, #475569); }

/* Apple Settings Card with Squircle Icon */
.apple-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    margin-bottom: 24px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.apple-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.apple-card-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}
.apple-squircle-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}
.apple-squircle-icon.api      { background: linear-gradient(135deg, #0071e3, #1d4ed8); }
.apple-squircle-icon.markup   { background: linear-gradient(135deg, #ff9500, #ea580c); }
.apple-squircle-icon.binance  { background: linear-gradient(135deg, #f0b90b, #b38600); }
.apple-squircle-icon.wallet   { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.apple-squircle-icon.email    { background: linear-gradient(135deg, #34c759, #15803d); }
.apple-squircle-icon.telegram { background: linear-gradient(135deg, #0284c7, #0369a1); }

