/**
 * CXEntegrasyon — Apple-Inspired Global Design System
 * Inspired by macOS, iPadOS, Apple Business Manager & Human Interface Guidelines
 */

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

:root {
    /* Color Palette */
    --app-background: #F5F5F7;
    --surface-primary: rgba(255, 255, 255, 0.96);
    --surface-secondary: #FFFFFF;
    --surface-muted: #F2F2F4;
    --surface-hover: rgba(0, 0, 0, 0.025);
    --surface-active: rgba(0, 122, 255, 0.06);

    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #86868B;

    --separator: rgba(0, 0, 0, 0.08);
    --separator-strong: rgba(0, 0, 0, 0.12);

    /* Apple System Colors */
    --accent: #007AFF;
    --accent-hover: #0066D6;
    --accent-active: #0055B3;
    --accent-subtle: rgba(0, 122, 255, 0.09);

    --brand-purple: #6E5CFF;
    --brand-purple-subtle: rgba(110, 92, 255, 0.09);

    --success: #34C759;
    --success-subtle: rgba(52, 199, 89, 0.12);
    --success-text: #248A3D;

    --warning: #FF9F0A;
    --warning-subtle: rgba(255, 159, 10, 0.12);
    --warning-text: #B26A00;

    --danger: #FF3B30;
    --danger-subtle: rgba(255, 59, 48, 0.10);
    --danger-text: #D70015;

    /* Marketplace Accents (Subtle) */
    --mp-ty: #F27A1A;
    --mp-ty-subtle: rgba(242, 122, 26, 0.10);
    --mp-hb: #FF6000;
    --mp-hb-subtle: rgba(255, 96, 0, 0.10);
    --mp-n11: #5E2D91;
    --mp-n11-subtle: rgba(94, 45, 145, 0.10);
    --mp-pz: #002D72;
    --mp-pz-subtle: rgba(0, 45, 114, 0.10);

    /* Typography */
    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", sans-serif;
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Border Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-panel: 20px;
    --radius-modal: 22px;
    --radius-pill: 999px;

    /* Elevation / Shadows */
    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 220ms cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Layout Dimensions */
    --sidebar-width: 250px;
    --topbar-height: 64px;
}

/* Dark Mode Tokens */
@media (prefers-color-scheme: dark) {
    :root[data-theme="system"], :root[data-theme="dark"] {
        --app-background: #000000;
        --surface-primary: rgba(28, 28, 30, 0.94);
        --surface-secondary: #1C1C1E;
        --surface-muted: #2C2C2E;
        --surface-hover: rgba(255, 255, 255, 0.04);
        --surface-active: rgba(10, 132, 255, 0.15);

        --text-primary: #F5F5F7;
        --text-secondary: #AEAEB2;
        --text-tertiary: #636366;

        --separator: rgba(255, 255, 255, 0.10);
        --separator-strong: rgba(255, 255, 255, 0.16);

        --accent: #0A84FF;
        --accent-hover: #409CFF;
        --accent-subtle: rgba(10, 132, 255, 0.18);

        --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
        --shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.6);
    }
}

/* Global Reset & Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    background-color: var(--app-background);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* ==========================================================================
   App Shell Layout (macOS / iPadOS inspired)
   ========================================================================== */

.cx-app-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.cx-sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-primary);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-right: 1px solid var(--separator);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-normal);
}

.cx-sidebar-header {
    height: var(--topbar-height);
    padding: 0 var(--space-5);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--separator);
}

.cx-brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.cx-brand-badge {
    background: linear-gradient(135deg, var(--accent), var(--brand-purple));
    color: #fff;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.cx-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3) var(--space-3);
    list-style: none;
    margin: 0;
}

.cx-nav-category-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: var(--space-3) var(--space-3) var(--space-1);
}

.cx-nav-item {
    margin-bottom: 2px;
}

.cx-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px var(--space-3);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.90rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.cx-nav-link i, .cx-nav-link svg {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.cx-nav-link:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.cx-nav-link:hover i, .cx-nav-link:hover svg {
    color: var(--text-primary);
}

.cx-nav-link.active {
    background-color: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
}

.cx-nav-link.active i, .cx-nav-link.active svg {
    color: var(--accent);
}

.cx-sidebar-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--separator);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.cx-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--surface-muted);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--separator);
}

.cx-user-meta {
    flex: 1;
    min-width: 0;
}

.cx-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cx-user-role {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

/* Main Area */
.cx-main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.cx-topbar {
    height: var(--topbar-height);
    background-color: var(--surface-primary);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--separator);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
}

.cx-spotlight-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background-color: var(--surface-muted);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 6px var(--space-3);
    width: 320px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cx-spotlight-search:hover {
    background-color: var(--surface-secondary);
    border-color: var(--separator-strong);
}

.cx-spotlight-search input {
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

.cx-spotlight-search input::placeholder {
    color: var(--text-tertiary);
}

.cx-hotkey-badge {
    background-color: var(--surface-primary);
    border: 1px solid var(--separator-strong);
    color: var(--text-tertiary);
    font-size: 0.70rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.cx-topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Page Content Container */
.cx-content-area {
    padding: var(--space-6);
    flex: 1;
    max-width: 1600px;
    width: 100%;
}

/* ==========================================================================
   Page Headers
   ========================================================================== */

.cx-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
    gap: var(--space-4);
}

.cx-page-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin: 0 0 var(--space-1);
}

.cx-page-subtitle {
    font-size: 0.90rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */

.cx-card {
    background-color: var(--surface-secondary);
    border: 1px solid var(--separator);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.cx-card:hover {
    border-color: var(--separator-strong);
}

/* ==========================================================================
   Apple Card Grids (Responsive 4, 3, 2 Columns)
   ========================================================================== */

.cx-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

.cx-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.cx-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (max-width: 1280px) {
    .cx-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cx-grid-4, .cx-grid-3, .cx-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Apple Metric / Stat Card */
.cx-metric-card, .cx-stat-card {
    background-color: var(--surface-secondary);
    border: 1px solid var(--separator);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-2);
    min-height: 120px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

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

.cx-metric-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cx-metric-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cx-metric-icon-badge.blue { background: rgba(0, 122, 255, 0.12); color: #007AFF; }
.cx-metric-icon-badge.purple { background: rgba(110, 92, 255, 0.12); color: #6E5CFF; }
.cx-metric-icon-badge.green { background: rgba(52, 199, 89, 0.12); color: #34C759; }
.cx-metric-icon-badge.orange { background: rgba(255, 149, 0, 0.12); color: #FF9500; }
.cx-metric-icon-badge.red { background: rgba(255, 59, 48, 0.12); color: #FF3B30; }
.cx-metric-icon-badge.gray { background: rgba(142, 142, 147, 0.12); color: #8E8E93; }

.cx-metric-label, .cx-stat-label {
    font-size: 0.80rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.cx-metric-value, .cx-stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
}

.cx-metric-trend {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cx-metric-trend.positive { color: var(--success); }
.cx-metric-trend.warning { color: var(--warning); }
.cx-metric-trend.negative { color: var(--danger); }

/* ==========================================================================
   Buttons & Actions
   ========================================================================== */

.cx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    height: 38px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.cx-btn-primary {
    background-color: var(--accent);
    color: #FFFFFF;
    border-color: transparent;
}

.cx-btn-primary:hover {
    background-color: var(--accent-hover);
    color: #FFFFFF;
}

.cx-btn-primary:active {
    background-color: var(--accent-active);
}

.cx-btn-secondary {
    background-color: var(--surface-secondary);
    color: var(--text-primary);
    border-color: var(--separator-strong);
}

.cx-btn-secondary:hover {
    background-color: var(--surface-muted);
    color: var(--text-primary);
}

.cx-btn-destructive {
    background-color: var(--danger-subtle);
    color: var(--danger-text);
    border-color: transparent;
}

.cx-btn-destructive:hover {
    background-color: var(--danger);
    color: #FFFFFF;
}

.cx-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
}

.cx-btn-icon:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.cx-btn-sm {
    height: 30px;
    padding: 0 var(--space-3);
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.cx-btn-lg {
    height: 46px;
    padding: 0 var(--space-6);
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* ==========================================================================
   Tables & Data Grid (Apple Human Interface Clean Table)
   ========================================================================== */

.cx-table-container {
    background-color: var(--surface-secondary);
    border: 1px solid var(--separator);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
}

.cx-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.cx-table th {
    height: 42px;
    padding: 0 var(--space-4);
    background-color: var(--surface-muted);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--separator);
    white-space: nowrap;
}

.cx-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--separator);
    color: var(--text-primary);
    vertical-align: middle;
}

.cx-table tbody tr {
    transition: background-color var(--transition-fast);
}

.cx-table tbody tr:hover {
    background-color: var(--surface-hover);
}

.cx-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Segmented Control & Tabs
   ========================================================================== */

.cx-segmented-control {
    display: inline-flex;
    background-color: var(--surface-muted);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.cx-segment-btn {
    padding: 5px var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cx-segment-btn.active {
    background-color: var(--surface-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-subtle);
    font-weight: 600;
}

/* ==========================================================================
   Badges & Indicators
   ========================================================================== */

.cx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.cx-badge-blue { background-color: var(--accent-subtle); color: var(--accent); }
.cx-badge-green { background-color: var(--success-subtle); color: var(--success-text); }
.cx-badge-orange { background-color: var(--warning-subtle); color: var(--warning-text); }
.cx-badge-red { background-color: var(--danger-subtle); color: var(--danger-text); }
.cx-badge-gray { background-color: var(--surface-muted); color: var(--text-secondary); }

.cx-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.cx-status-dot.online { background-color: var(--success); }
.cx-status-dot.warning { background-color: var(--warning); }
.cx-status-dot.offline { background-color: var(--danger); }

/* ==========================================================================
   Forms & Controls
   ========================================================================== */

.cx-input, .cx-select {
    width: 100%;
    height: 38px;
    padding: 0 var(--space-3);
    background-color: var(--surface-secondary);
    border: 1px solid var(--separator-strong);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.cx-input:focus, .cx-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.cx-label {
    display: block;
    font-size: 0.80rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

/* ==========================================================================
   Modals & Sheets (Apple Style Sheet)
   ========================================================================== */

.modal-content.cx-modal-content {
    border-radius: var(--radius-modal);
    border: 1px solid var(--separator);
    box-shadow: var(--shadow-modal);
    background-color: var(--surface-secondary);
}

.modal-header.cx-modal-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--separator);
}

.modal-footer.cx-modal-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--separator);
}

/* ==========================================================================
   Command Palette (Apple Spotlight Style)
   ========================================================================== */

.cx-command-palette-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

.cx-command-palette {
    width: 600px;
    max-width: 90vw;
    background: var(--surface-secondary);
    border: 1px solid var(--separator-strong);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    animation: cxScaleUp 180ms ease-out;
}

@keyframes cxScaleUp {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.cx-command-input-wrapper {
    display: flex;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--separator);
    gap: var(--space-3);
}

.cx-command-input-wrapper input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
}

.cx-command-results {
    max-height: 360px;
    overflow-y: auto;
    padding: var(--space-2);
}

.cx-command-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.88rem;
    text-decoration: none;
}

.cx-command-item:hover, .cx-command-item.active {
    background-color: var(--accent-subtle);
    color: var(--accent);
}

/* ==========================================================================
   Mobile & Tablet Responsive System (Apple iOS / iPadOS Design)
   ========================================================================== */

/* Mobile Sidebar Backdrop Overlay */
.cx-sidebar-backdrop {
    display: none;
    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: 998;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.cx-sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Mobile Hamburger Toggle Button */
.cx-mobile-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background-color: var(--surface-muted);
    border: 1px solid var(--separator);
    color: var(--text-primary);
    cursor: pointer;
    margin-right: var(--space-2);
    flex-shrink: 0;
}

.cx-mobile-menu-toggle:hover {
    background-color: var(--surface-secondary);
}

/* Close button inside mobile sidebar */
.cx-sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.cx-sidebar-close-btn:hover {
    color: var(--text-primary);
    background-color: var(--surface-muted);
}

/* Responsive Breakpoints: Tablet & Mobile (<= 992px) */
@media (max-width: 992px) {
    /* Main Shell */
    .cx-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 280px;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: none;
    }

    .cx-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-modal);
    }

    .cx-sidebar-header {
        justify-content: space-between;
    }

    .cx-sidebar-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .cx-mobile-menu-toggle {
        display: inline-flex;
    }

    .cx-main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0;
    }

    .cx-topbar {
        padding: 0 var(--space-3);
        height: 56px;
    }

    .cx-spotlight-search {
        width: auto;
        flex: 1;
        max-width: 280px;
        padding: 5px 10px;
    }

    .cx-spotlight-search input {
        font-size: 0.80rem;
    }

    .cx-hotkey-badge {
        display: none;
    }

    .cx-content-area {
        padding: var(--space-3);
    }

    .cx-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        margin-bottom: var(--space-4);
    }

    .cx-page-header .d-flex {
        width: 100%;
        flex-wrap: wrap;
    }

    .cx-page-title {
        font-size: 1.35rem;
    }

    .cx-page-subtitle {
        font-size: 0.82rem;
    }

    /* Metric Cards Grid Responsive */
    .cx-metric-card {
        padding: var(--space-4);
    }

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

    /* Ensure tables can be smoothly swiped horizontally */
    .cx-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }

    .cx-table {
        min-width: 650px;
    }

    .cx-table th, .cx-table td {
        padding: 8px 12px;
        font-size: 0.80rem;
    }

    /* Form rows responsive */
    form .col-md-6, form .col-md-4, form .col-md-3, form .col-md-2 {
        width: 100% !important;
    }

    .cx-segment-control {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        width: 100%;
        justify-content: flex-start;
    }

    .cx-command-palette {
        width: 92vw;
        margin: 0 auto;
    }
}

/* Extra Small Phones (<= 576px) */
@media (max-width: 576px) {
    .cx-topbar-actions small {
        display: none;
    }

    .cx-topbar-actions {
        gap: var(--space-1);
    }

    .cx-btn-sm {
        height: 28px;
        font-size: 0.72rem;
        padding: 0 8px;
    }

    .cx-btn {
        height: 36px;
        font-size: 0.80rem;
    }

    .cx-brand-logo {
        font-size: 1.05rem;
    }

    .cx-content-area {
        padding: 10px;
    }
}

