:root {
    --crm-ink: #17212b;
    --crm-muted: #66727d;
    --crm-paper: #f5f7f8;
    --crm-panel: #ffffff;
    --crm-line: #dbe1e5;
    --crm-accent: #c72c67;
    --crm-accent-dark: #8e1d49;
    --crm-sidebar: #202d39;
    --crm-sidebar-text: #d9e1e7;
    --crm-sidebar-muted: #8e9ba6;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--crm-paper); }
body.crm-body { margin: 0; color: var(--crm-ink); background: var(--crm-paper); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--crm-accent-dark); }
a:focus-visible, button:focus-visible { outline: 3px solid #f0a23a; outline-offset: 3px; }
.crm-header { min-height: 64px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #fff; background: var(--crm-ink); }
.crm-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.crm-brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: #fff; background: var(--crm-accent); font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.crm-brand strong, .crm-brand small { display: block; }
.crm-brand small { color: #b9c5cd; font-size: .76rem; }
.crm-header-role { color: #dce5ea; font-size: .85rem; }
.crm-shell { display: grid; min-height: calc(100vh - 64px); }
.crm-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px; color: var(--crm-sidebar-text); background: var(--crm-sidebar); }
.crm-nav a, .crm-nav-disabled { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 10px; border-radius: 5px; font-size: .9rem; text-decoration: none; }
.crm-nav a { color: #fff; background: #344553; }
.crm-nav-link--active { background: var(--crm-accent-dark) !important; }
.crm-nav-disabled { color: var(--crm-sidebar-muted); cursor: not-allowed; }
.crm-nav-disabled small { font-size: .68rem; }
.crm-nav-label { width: 100%; margin: 8px 10px 0; color: var(--crm-sidebar-muted); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.crm-main { width: min(1440px, 100%); padding: 24px 16px 48px; }
.crm-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.crm-eyebrow { margin: 0 0 4px; color: var(--crm-accent-dark); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.crm-page h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; }
.crm-page-intro, .crm-section-heading p { margin: 6px 0 0; color: var(--crm-muted); }
.crm-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 28px; }
.crm-stat-card, .crm-panel { border: 1px solid var(--crm-line); border-radius: 8px; background: var(--crm-panel); }
.crm-stat-card { padding: 16px; }
.crm-stat-card p { margin: 0 0 8px; color: var(--crm-muted); font-size: .82rem; }
.crm-stat-card strong { font-size: 1.8rem; line-height: 1; }
.crm-panel { padding: 18px; }
.crm-section-heading { margin-bottom: 14px; }
.crm-section-heading h2 { margin: 0; font-size: 1.2rem; }
.crm-table-wrap { overflow-x: auto; }
.crm-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.crm-table th, .crm-table td { padding: 11px 10px; border-top: 1px solid var(--crm-line); text-align: left; vertical-align: top; }
.crm-table thead th { border-top: 0; color: var(--crm-muted); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.crm-status-badge { display: inline-block; padding: 2px 8px; border-radius: 99px; color: #fff; background: var(--crm-accent-dark); font-size: .75rem; }
.crm-status-badge--muted { color: var(--crm-ink); background: #e8edf0; }
.crm-empty-state, .crm-access-denied { padding: 24px; border: 1px solid var(--crm-line); border-radius: 8px; background: var(--crm-panel); }
.crm-access-denied { max-width: 620px; margin: 36px auto; }
.crm-authenticated, .crm-signin { max-width: 620px; margin: 36px auto; padding: 28px; border: 1px solid var(--crm-line); border-radius: 8px; background: var(--crm-panel); }
.crm-action-link, .crm-submit { display: inline-block; padding: 9px 14px; border: 0; border-radius: 5px; color: #fff; background: var(--crm-accent-dark); font-weight: 700; text-decoration: none; cursor: pointer; }
.crm-signin h1, .crm-authenticated h1 { margin-top: 0; }
.crm-form { display: grid; gap: 8px; margin-top: 22px; }
.crm-form input { min-height: 42px; padding: 8px 10px; border: 1px solid #aeb9c1; border-radius: 5px; color: var(--crm-ink); background: #fff; font: inherit; }
.crm-submit { margin-top: 8px; justify-self: start; }
.crm-form-error { margin: 16px 0; padding: 12px 14px; border-left: 4px solid #b42318; color: #6f1d19; background: #fcebea; }
.crm-form-error ul { margin: 6px 0 0; padding-left: 20px; }
.crm-form-notice { margin: 18px 0 0; color: #276749; }
.crm-form-magic { margin-top: 12px; }
.crm-list-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.crm-list-actions form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crm-list-actions input, .crm-list-actions select { min-height: 38px; padding: 7px 9px; border: 1px solid #aeb9c1; border-radius: 5px; background: #fff; font: inherit; }
.crm-action-link--primary { background: var(--crm-accent); }
.crm-form-section { display: grid; gap: 14px; }
.crm-form-section label { display: grid; gap: 5px; font-weight: 700; }
.crm-form-section input, .crm-form-section textarea, .crm-form-section select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #aeb9c1; border-radius: 5px; background: #fff; font: inherit; }
.crm-form-section textarea { min-height: 110px; resize: vertical; }
.crm-form-grid { display: grid; gap: 14px; }
.crm-form-help { margin: -6px 0 0; color: var(--crm-muted); font-size: .88rem; }
.crm-form-required { color: #9b1c1c; }
.crm-checkbox-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.crm-checkbox-list label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.crm-checkbox-list input { width: auto; min-height: auto; }
.crm-form-submit-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.crm-form-success { margin-bottom: 18px; padding: 12px 14px; border-left: 4px solid #276749; color: #22543d; background: #e7f6ed; }
.crm-status-badge--unclaimed { color: #6b4614; background: #fff0cf; }
.crm-detail-list { display: grid; grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr); gap: 8px 18px; margin: 0; }
.crm-detail-list dt { color: var(--crm-muted); font-weight: 700; }
.crm-detail-list dd { margin: 0; overflow-wrap: anywhere; }
.crm-page > .crm-panel { margin-bottom: 18px; }
.crm-page fieldset { border: 1px solid var(--crm-line); padding: 14px; }
.crm-page legend { padding: 0 6px; font-weight: 700; }
.crm-media-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--crm-line); }
.crm-media-block h3 { margin: 0 0 10px; }
.crm-media-preview { display: block; width: min(100%, 220px); max-height: 180px; object-fit: contain; border: 1px solid var(--crm-line); border-radius: 6px; background: #f1f4f5; }
.crm-media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 14px 0; }
.crm-media-grid figure { margin: 0; }
.crm-media-grid .crm-media-preview { width: 100%; height: 130px; }
.crm-media-grid figcaption { padding-top: 6px; overflow-wrap: anywhere; font-size: .86rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 800px) {
    .crm-shell { grid-template-columns: 230px minmax(0, 1fr); }
    .crm-nav { display: flex; flex-direction: column; align-content: stretch; flex-wrap: nowrap; padding: 20px 12px; }
    .crm-nav a, .crm-nav-disabled { width: 100%; }
    .crm-main { padding: 36px 30px 64px; }
    .crm-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
