@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@600;700&display=swap');

:root {
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;
    --radius-xs: 0px;
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;
    --radius-xl: 0px;
    --font-base: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Sora', 'Inter', sans-serif;
    --text-xs: 13px;
    --text-sm: 14px;
    --text-md: 15px;
    --text-lg: 18px;
    --text-xl: 24px;
    --text-2xl: 32px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.08), 0 1px 1px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 10px 26px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 56px rgba(15, 23, 42, 0.12);
    --transition-fast: 150ms ease;
    --sidebar-width: 292px;
    --sidebar-collapsed-width: 80px;
}

html,
body {
    min-height: 100%;
}

html {
    font-family: var(--font-base);
    color-scheme: dark;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis: none;
}

body.crm-body {
    margin: 0;
    display: flex;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    overflow-x: hidden;
    line-height: 1.45;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.crm-body,
body.crm-body * {
    box-sizing: border-box;
}

body.crm-theme-switching,
body.crm-theme-switching *,
body.crm-theme-switching *::before,
body.crm-theme-switching *::after {
    transition: none !important;
    animation: none !important;
}

body.theme-dark {
    --bg-primary: #151518;
    --bg-secondary: #151518;
    --bg-card: #09090B;
    --border-color: #25252c;
    --text-primary: #e7eef8;
    --text-secondary: #9caec3;
    --accent-primary: #22c08a;
    --accent-hover: #19a877;
    --danger: #ef4444;
    --success: #16a34a;
    --warning: #d97706;
    --surface-soft: #151518;
    --surface-soft-hover: #1c1c20;
    --nav-hover-bg: rgba(255, 255, 255, 0.03);
    --nav-active-bg: rgba(34, 192, 138, 0.18);
    --nav-active-border: rgba(34, 192, 138, 0.34);
    --bg-overlay: rgba(9, 9, 11, 0.72);
    --outline: var(--border-color);
    --accent: var(--accent-primary);
    --accent-strong: #47dba5;
    --accent-soft: rgba(34, 192, 138, 0.16);
    --text: var(--text-primary);
    --muted: var(--text-secondary);
    --text-strong: var(--text-primary);
    --surface-card: var(--bg-card);
    --surface-elevated: #09090B;
}

body.theme-midnight {
    --bg-primary: #0b1020;
    --bg-secondary: #0f172a;
    --bg-card: #111827;
    --border-color: #243045;
    --text-primary: #e5ecf8;
    --text-secondary: #9bb0cf;
    --accent-primary: #8b5cf6;
    --accent-hover: #7c4ef0;
    --danger: #ef4444;
    --success: #16a34a;
    --warning: #d97706;
    --surface-soft: #152238;
    --surface-soft-hover: #1d2f4b;
    --nav-hover-bg: rgba(139, 92, 246, 0.12);
    --nav-active-bg: rgba(139, 92, 246, 0.2);
    --nav-active-border: rgba(139, 92, 246, 0.36);
    --bg-overlay: rgba(11, 16, 32, 0.72);
    --outline: var(--border-color);
    --accent: var(--accent-primary);
    --accent-strong: #b79cff;
    --accent-soft: rgba(139, 92, 246, 0.18);
    --text: var(--text-primary);
    --muted: var(--text-secondary);
    --text-strong: var(--text-primary);
    --surface-card: var(--bg-card);
    --surface-elevated: #0e1629;
}

body.theme-light {
    --bg-primary: #f9fafb;
    --bg-secondary: #f3f5f7;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #0f172a;
    --text-secondary: #5f6675;
    --accent-primary: #20b783;
    --accent-hover: #169a6d;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #ca8a04;
    --surface-soft: #f8fafc;
    --surface-soft-hover: #f1f5f9;
    --nav-hover-bg: rgba(32, 183, 131, 0.06);
    --nav-active-bg: rgba(32, 183, 131, 0.14);
    --nav-active-border: rgba(32, 183, 131, 0.3);
    --bg-overlay: rgba(30, 41, 59, 0.2);
    --outline: var(--border-color);
    --accent: var(--accent-primary);
    --accent-strong: #169a6d;
    --accent-soft: rgba(32, 183, 131, 0.1);
    --text: var(--text-primary);
    --muted: var(--text-secondary);
    --text-strong: var(--text-primary);
    --surface-card: var(--bg-card);
    --surface-elevated: #f8fafe;
}

.crm-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: 14px 12px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 60;
    transition: width var(--transition-fast), padding var(--transition-fast), background-color var(--transition-fast);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--border-color) 72%, transparent) transparent;
}

.crm-sidebar::-webkit-scrollbar {
    width: 7px;
}

.crm-sidebar::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--border-color) 75%, transparent);
    border-radius: 999px;
}

.crm-sidebar-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.crm-sidebar-toggle span {
    width: 14px;
    height: 1.6px;
    background: currentColor;
    border-radius: 4px;
}

.crm-sidebar-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    background: var(--surface-soft-hover);
}

.crm-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-height: 48px;
    padding: 6px 6px 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-2);
}

.crm-brand-main {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.crm-brand-logo-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.crm-brand-logo-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 30%, transparent);
    border-radius: 8px;
}

.crm-brand img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    transition: filter var(--transition-fast);
}

body.theme-dark .crm-brand img {
    filter: none;
}

body.theme-midnight .crm-brand img {
    filter: none;
}

body.theme-light .crm-brand img {
    filter: brightness(0) saturate(100%);
}

.crm-brand h1 {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    font-size: 14px;
    color: var(--text-primary);
}

.crm-brand span {
    font-size: var(--text-xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.crm-theme-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 4px 4px 2px;
}

.crm-theme-switch button {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 8px 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.crm-theme-switch button:hover,
.crm-theme-switch button.is-active {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.crm-nav-label {
    margin: 10px 8px 6px;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.crm-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.crm-nav-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-nav-link-main {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.crm-nav-link--toggle {
    width: 100%;
    justify-content: space-between;
    text-align: left;
    background: transparent;
}

.crm-nav-chevron {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.crm-nav-item.is-open > .crm-nav-link--toggle .crm-nav-chevron {
    transform: rotate(180deg);
}

.crm-nav-item.is-active > .crm-nav-link--toggle .crm-nav-chevron {
    color: var(--accent-primary);
}

.crm-subnav {
    display: none;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
    flex-direction: column;
    gap: 2px;
}

.crm-nav-item.is-open > .crm-subnav {
    display: flex;
}

.crm-subnav-link {
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.crm-subnav-link:hover {
    background: transparent;
    border-color: transparent;
    color: var(--text-primary);
}

.crm-subnav-link.is-active {
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    border-color: transparent;
    font-weight: 600;
}

.crm-nav-link {
    position: relative;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    font-size: 15px;
    font-weight: 500;
    transition: all var(--transition-fast);
    line-height: 1;
}

.crm-nav-link svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.crm-nav-link:hover {
    background: transparent;
    color: var(--text-primary);
    border-color: transparent;
}

.crm-nav-link:focus-visible {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 25%, transparent);
}

.crm-nav-link.is-active {
    background: var(--nav-active-bg);
    border-color: transparent;
    color: var(--accent-primary);
    font-weight: 600;
}

.crm-nav-link.is-active svg {
    color: var(--accent-primary);
}

.crm-nav-link.is-active::before {
    content: '';
    position: absolute;
    left: -2px;
    width: 4px;
    top: 8px;
    bottom: 8px;
    border-radius: 999px;
    background: var(--accent-primary);
}

.crm-sidebar-footer {
    margin-top: auto;
    padding: 10px 6px 4px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.crm-sidebar-footer-left {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.crm-sidebar-footer span {
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.crm-sidebar-footer a {
    text-decoration: none;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 7px 12px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.crm-sidebar-footer a:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.crm-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 60px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
    transition: left var(--transition-fast), background-color var(--transition-fast);
}

.crm-topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.crm-topbar-breadcrumb strong {
    color: var(--text-primary);
}

.crm-topbar-breadcrumb svg {
    width: 14px;
    height: 14px;
}

.crm-topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.crm-topbar-btn,
.crm-topbar-profile {
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 12px;
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.crm-topbar-btn {
    cursor: pointer;
}

.crm-topbar-btn:hover,
.crm-topbar-profile:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.crm-theme-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent-primary);
}

.crm-topbar-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.crm-main {
    margin-left: var(--sidebar-width);
    padding: calc(60px + var(--space-4)) var(--space-5) var(--space-6);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--transition-fast), width var(--transition-fast);
    min-width: 0;
}

.crm-page-header {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: flex-end;
    margin-bottom: var(--space-5);
}

.crm-eyebrow {
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin: 0 0 var(--space-2);
}

.crm-page-header h1,
.crm-page-header h2 {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    font-size: clamp(26px, 3vw, 36px);
    color: var(--text-primary);
}

.crm-page-header p {
    margin: var(--space-2) 0 0;
    color: var(--text-secondary);
    max-width: 68ch;
}

.crm-header-actions,
.crm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.crm-btn,
button,
input[type="submit"],
input[type="button"] {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    height: 38px;
    padding: 0 14px;
    font-family: inherit;
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.crm-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}

.crm-btn--primary {
    background: var(--accent-primary);
    color: #ffffff;
}

.crm-btn--primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.crm-btn--ghost,
button,
input[type="submit"],
input[type="button"] {
    border-color: var(--border-color);
    color: var(--text-secondary);
    background: var(--bg-card);
}

.crm-btn--ghost:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.crm-btn--danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border-color));
}

.crm-btn--danger:hover {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    border-color: var(--danger);
}

.crm-grid {
    display: grid;
    gap: var(--space-4);
}

.crm-grid--kpi {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: var(--space-5);
}

.crm-card,
.crm-shell-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.crm-card--glow {
    box-shadow: var(--shadow-md);
}

.crm-card:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 34%, var(--border-color));
}

.crm-kpi {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    padding: var(--space-4);
    transition: all var(--transition-fast);
}

.crm-kpi:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-color));
    box-shadow: var(--shadow-sm);
}

.crm-kpi small {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--text-secondary);
}

.crm-kpi strong {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-2xl);
    line-height: 1.2;
    color: var(--text-primary);
}
.crm-scroll-note,
.crm-tag {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.crm-badge.success,
.crm-badge.warning,
.crm-badge.danger {
    animation: crmBadgePulse 1.8s ease-in-out infinite;
}

.crm-tag {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-alert {
    border: 1px solid color-mix(in srgb, var(--success) 34%, var(--border-color));
    background: color-mix(in srgb, var(--success) 12%, var(--bg-card));
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    animation: crmFadeIn var(--transition-fast) ease;
}

.crm-alert.is-error {
    border-color: color-mix(in srgb, var(--danger) 45%, var(--border-color));
    background: color-mix(in srgb, var(--danger) 12%, var(--bg-card));
}

.crm-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.crm-section-head h2,
.crm-section-head h3,
.crm-card h2,
.crm-card h3 {
    margin: 0;
    color: var(--text-primary);
}

.crm-section-head p {
    margin: var(--space-2) 0 0;
    color: var(--text-secondary);
}

.crm-filter,
.crm-input,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="file"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: var(--text-sm);
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

input[type="file"] {
    min-height: 44px;
    padding: 8px 10px;
    color: var(--text-secondary);
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
    color: var(--text-primary);
    padding: 6px 11px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

input[type="file"]::file-selector-button:hover {
    border-color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-soft));
}

input[type="file"][accept*="image"] {
    display: block;
    min-height: 96px;
    border-style: dashed;
    border-width: 1.5px;
    background: var(--surface-soft);
    padding: 14px;
    line-height: 1.4;
    width: 100%;
}

.form-inline input[type="file"][accept*="image"] {
    flex: 1 1 100%;
}

input[type="file"][accept*="image"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 12px;
}

.crm-upload-control {
    border: 1.5px dashed color-mix(in srgb, var(--border-color) 82%, var(--text-secondary) 18%);
    background: var(--surface-soft);
    min-height: 104px;
    padding: 12px;
    display: grid;
    align-content: start;
    gap: 10px;
    width: 100%;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.crm-upload-control.is-dragover {
    border-color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-soft));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.crm-upload-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.crm-upload-meta {
    display: grid;
    gap: 4px;
}

.crm-upload-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.crm-upload-hint,
.crm-upload-file {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    word-break: break-word;
}

.crm-upload-hint {
    display: block;
}

.crm-upload-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crm-upload-actions .crm-btn {
    height: 34px;
    padding: 0 12px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .crm-upload-control {
        flex-direction: column;
        align-items: stretch;
    }
    .crm-upload-actions {
        justify-content: flex-start;
    }
}

textarea {
    min-height: 96px;
    resize: none;
}

.crm-filter:focus,
.crm-input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

.crm-form {
    display: grid;
    gap: var(--space-4);
}

.crm-field label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.crm-chip-grid,
.crm-vitrine-grid,
.crm-product-grid {
    display: grid;
    gap: var(--space-3);
}

.crm-chip-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.crm-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.crm-vitrine-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.crm-chip,
.crm-product-card,
.crm-vitrine-card,
.crm-list > li {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: all var(--transition-fast);
}

.crm-chip {
    padding: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.crm-chip:hover,
.crm-product-card:hover,
.crm-vitrine-card:hover,
.crm-list > li:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-color));
    transform: translateY(-1px);
}

.crm-product-card,
.crm-vitrine-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crm-product-card figure,
.crm-vitrine-card figure {
    margin: 0;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border-color);
}

.crm-product-body {
    padding: var(--space-4);
    display: grid;
    gap: var(--space-2);
}

.crm-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.crm-pill,
.crm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.crm-badge.success {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 35%, var(--border-color));
    background: color-mix(in srgb, var(--success) 10%, transparent);
}

.crm-badge.warning {
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 35%, var(--border-color));
    background: color-mix(in srgb, var(--warning) 12%, transparent);
}

.crm-badge.danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border-color));
    background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.crm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.crm-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-soft);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
}

.crm-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.crm-table tbody tr {
    transition: background-color var(--transition-fast);
}

.crm-table tbody tr:hover {
    background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-card));
}

.crm-empty {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text-secondary);
    padding: var(--space-6) var(--space-4);
    text-align: center;
}

.crm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3);
}

.crm-list > li {
    padding: var(--space-3);
}

.crm-main--wide {
    max-width: 100%;
}

.crm-main code,
.crm-main pre,
.vitrine-domain-ip {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

.crm-main pre {
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    overflow: auto;
}

.form-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-4);
}

.form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.form-grid {
    display: grid;
    gap: var(--space-3);
}

@media (min-width: 900px) {
    .form-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .form-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.form-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.list-stack {
    display: grid;
    gap: var(--space-2);
}

.list-stack > div {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    padding: var(--space-2);
}

.vitrine-domain-steps,
.vitrine-product-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.vitrine-domain-steps li,
.vitrine-product-item {
    border-color: var(--border-color) !important;
    background: var(--surface-soft) !important;
}

.vitrine-product-item:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-color)) !important;
    background: var(--surface-soft-hover) !important;
}

.vitrine-preview-card iframe {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.rt-dashboard-host .crm-card,
.rt-dashboard-host .rt-dashboard__vitrine-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

.rt-dashboard-host .rt-status {
    border: 1px solid var(--border-color);
}

.rt-dashboard-host .rt-dashboard__list-item,
.rt-dashboard-host .rt-dashboard__vitrine-card {
    transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.rt-dashboard-host .rt-dashboard__list-item:hover,
.rt-dashboard-host .rt-dashboard__vitrine-card:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-color));
}

.login-frame,
.login-shell,
.login-hero,
.login-panel__card,
.login-insights,
.login-stat-card,
.login-feature {
    transition: all var(--transition-fast);
}

button.is-loading,
input[type="submit"].is-loading,
.crm-btn.is-loading {
    opacity: 0.72;
    pointer-events: none;
    position: relative;
}

.crm-loading {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid color-mix(in srgb, var(--accent-primary) 20%, var(--border-color));
    border-top-color: var(--accent-primary);
    animation: crmSpin 800ms linear infinite;
}

.crm-skeleton {
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--surface-soft) 25%, var(--surface-soft-hover) 50%, var(--surface-soft) 75%);
    background-size: 200% 100%;
    animation: crmSkeleton 1.4s linear infinite;
}

.crm-metric-highlight {
    border-color: color-mix(in srgb, var(--accent-primary) 44%, var(--border-color));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

.crm-sticky-save {
    position: sticky;
    bottom: var(--space-4);
    margin-top: var(--space-4);
    z-index: 30;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

.crm-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.crm-product-form {
    gap: var(--space-5);
}

.crm-product-form .crm-rating .star,
.comment-rating .star {
    color: color-mix(in srgb, var(--text-secondary) 35%, transparent);
}

.crm-product-form .crm-rating .star.is-active,
.comment-rating .star.is-active {
    color: #f59e0b;
}

.crm-product-form .order-bump-panel,
.crm-product-form .ob-dropdown,
.crm-product-form .list-stack > div {
    background: var(--surface-soft);
    border-color: var(--border-color);
}

.crm-product-form .ob-dropdown li {
    border-bottom-color: var(--border-color);
}

.crm-product-form .ob-dropdown li:hover {
    background: var(--surface-soft-hover);
}

.create-vitrine-hero,
.create-vitrine-guide {
    background: linear-gradient(140deg, color-mix(in srgb, var(--accent-primary) 18%, var(--bg-card)), var(--bg-card)) !important;
    border-color: var(--border-color) !important;
}

.create-vitrine-pills li,
.create-vitrine-steps li,
.create-vitrine-kpis .crm-kpi {
    background: var(--surface-soft) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

.create-vitrine-hint,
.create-vitrine-slug,
.create-vitrine-steps mark {
    color: var(--text-secondary);
}

.create-vitrine-steps mark {
    background: color-mix(in srgb, var(--accent-primary) 16%, transparent);
}

.vitrine-domain-steps li,
.vitrine-product-item,
.comment-photo-card,
.comment-avatar,
.comment-preview__photos img {
    border-color: var(--border-color) !important;
    background: var(--surface-soft) !important;
}

.vitrine-product-item:hover,
.comment-photo-card:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-color)) !important;
    background: var(--surface-soft-hover) !important;
}

.comment-photo-card input:not(:checked) + .comment-photo-card__label {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    border-color: color-mix(in srgb, var(--danger) 45%, var(--border-color));
    color: var(--danger);
}

.comment-photo-card input:checked + .comment-photo-card__label {
    background: color-mix(in srgb, var(--success) 10%, transparent);
    border-color: color-mix(in srgb, var(--success) 45%, var(--border-color));
    color: var(--success);
}

.rt-dashboard__kpi,
.rt-dashboard__vitrine-card,
.rt-dashboard__list-item,
.rt-gateway__card,
.rt-dashboard__chart,
.rt-dashboard__list {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

.rt-dashboard__kpi strong,
.rt-dashboard__kpi span,
.rt-dashboard__chart-grid strong,
.rt-dashboard__value,
.rt-dashboard__list-item strong,
.rt-dashboard__vitrine-card h4 {
    color: var(--text-primary) !important;
}

.rt-dashboard__kpi small,
.rt-dashboard__list-item small,
.rt-dashboard__footer,
.rt-dashboard__header p,
.rt-dashboard__vitrine-card p,
.rt-dashboard__vitrine-card span {
    color: var(--text-secondary) !important;
}

.rt-dashboard__list-item,
.rt-dashboard__vitrine-card,
.rt-gateway__legend-item {
    transition: all var(--transition-fast);
}

.rt-dashboard__list-item:hover,
.rt-dashboard__vitrine-card:hover,
.rt-gateway__legend-item:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-color)) !important;
    transform: translateY(-1px);
}

.rt-status {
    border: 1px solid var(--border-color);
}

.rt-status--paid {
    background: color-mix(in srgb, var(--success) 22%, transparent) !important;
    color: var(--success) !important;
}

.rt-status--pending {
    background: color-mix(in srgb, var(--warning) 22%, transparent) !important;
    color: var(--warning) !important;
}

.rt-status--failed {
    background: color-mix(in srgb, var(--danger) 20%, transparent) !important;
    color: var(--danger) !important;
}

.pagination,
.crm-pagination {
    margin-top: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.pagination a,
.pagination span,
.crm-pagination a,
.crm-pagination span {
    min-width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0 10px;
}

.pagination .active,
.crm-pagination .active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-soft);
}

body.sidebar-collapsed .crm-sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
    padding: 10px 8px;
}

body.sidebar-collapsed .crm-nav-link {
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
}

body.sidebar-collapsed .crm-subnav,
body.sidebar-collapsed .crm-nav-chevron {
    display: none !important;
}

body.sidebar-collapsed .crm-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .crm-brand .crm-brand-main > div,
body.sidebar-collapsed .crm-nav-label,
body.sidebar-collapsed .crm-sidebar-footer span,
body.sidebar-collapsed .crm-theme-switch {
    display: none;
}

body.sidebar-collapsed .crm-brand .crm-sidebar-toggle {
    display: none;
}

body.sidebar-collapsed .crm-brand .crm-brand-main {
    width: 100%;
    justify-content: center;
}

body.sidebar-collapsed .crm-nav-link:not(.crm-nav-link--toggle) > span {
    display: none;
}

body.sidebar-collapsed .crm-nav-link--toggle .crm-nav-link-main > span {
    display: none;
}

body.sidebar-collapsed .crm-nav-link--toggle .crm-nav-link-main {
    width: 100%;
    justify-content: center;
}

body.sidebar-collapsed .crm-topbar {
    left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .crm-main {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

body.sidebar-collapsed .crm-nav-link.is-active::before {
    left: 0;
}

@keyframes crmSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes crmSpin {
    to { transform: rotate(360deg); }
}

@keyframes crmFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes crmBadgePulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

@media (max-width: 1200px) {
    .crm-grid--kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .crm-page-header,
    .crm-section-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .crm-topbar {
        padding: 0 var(--space-3);
        height: 56px;
    }

    .crm-main {
        padding: calc(56px + var(--space-4)) var(--space-3) var(--space-5);
    }

    .crm-grid--kpi {
        grid-template-columns: 1fr;
    }

    .crm-topbar-profile span:last-child {
        display: none;
    }
}