:root {
  --crm-navy: #0b1728;
  --crm-blue: #218bd5;
  --crm-cyan: #64d7ee;
  --crm-bg: #f3f6fa;
  --crm-line: #e1e8ef;
  --crm-ink: #192d42;
  --crm-muted: #758599;
}
.crm-body { min-height: 100vh; margin: 0; background: var(--crm-bg); color: var(--crm-ink); font-family: "Vazirmatn", Tahoma, sans-serif; }
.crm-body * { box-sizing: border-box; }
.crm-body a { color: inherit; text-decoration: none; }
.crm-topbar { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:15px max(24px, calc((100% - 1320px)/2)); background: #0b1728; color:#fff; box-shadow:0 6px 24px rgba(10,24,40,.10); }
.crm-brand { display:flex; align-items:center; gap:12px; }
.crm-brand strong, .crm-brand small { display:block; }
.crm-brand strong { direction:ltr; text-align:right; font-size:17px; }
.crm-brand small { color:#93a9bf; font-size:10px; margin-top:3px; }
.crm-logo-small { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; background:rgba(100,215,238,.12); border:1px solid rgba(100,215,238,.3); color:var(--crm-cyan); font-size:14px; font-weight:900; direction:ltr; }
.crm-top-actions { display:flex; align-items:center; gap:17px; font-size:12px; color:#c7d5e0; }
.crm-top-actions > a:hover { color:var(--crm-cyan); }
.crm-top-actions form { margin:0; }
.crm-main { width:min(1320px, calc(100% - 40px)); margin:32px auto 60px; }
.crm-page-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:25px; }
.crm-page-heading h1 { margin:4px 0 3px; font-size:clamp(24px,3vw,32px); line-height:1.5; font-weight:900; }
.crm-eyebrow { margin:0; color:var(--crm-blue); font-size:10px; font-weight:800; letter-spacing:1.4px; direction:ltr; text-align:right; }
.crm-muted { color:var(--crm-muted); font-size:12px; margin:0; line-height:1.9; }
.crm-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px; margin-bottom:23px; }
.crm-stat { padding:20px 22px; background:#fff; border:1px solid var(--crm-line); border-radius:15px; box-shadow:0 7px 25px rgba(20,43,66,.035); }
.crm-stat span,.crm-stat small { display:block; color:var(--crm-muted); font-size:11px; }
.crm-stat strong { display:block; margin:5px 0; font-size:30px; line-height:1.4; color:var(--crm-ink); }
.crm-panel { background:#fff; border:1px solid var(--crm-line); border-radius:16px; box-shadow:0 7px 25px rgba(20,43,66,.035); overflow:hidden; }
.crm-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:20px 22px; border-bottom:1px solid var(--crm-line); }
.crm-panel-heading h2 { font-size:16px; margin:0 0 4px; }
.crm-panel-heading p { margin:0; }
.crm-filter-form { display:flex; gap:10px; align-items:center; padding:16px 22px; border-bottom:1px solid var(--crm-line); }
.crm-filter-form input[type="search"] { flex:1 1 260px; min-width:160px; }
.crm-filter-form select { flex:0 0 180px; }
.crm-body input:not([type="hidden"]), .crm-body select, .crm-body textarea { border:1px solid #dbe4ec; border-radius:9px; background:#fbfcfe; padding:11px 12px; font:inherit; font-size:12px; line-height:1.6; color:var(--crm-ink); max-width:100%; }
.crm-body input:focus, .crm-body select:focus, .crm-body textarea:focus { outline:0; border-color:#66b6e9; box-shadow:0 0 0 3px rgba(33,139,213,.10); }
.crm-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:10px 14px; border:1px solid transparent; border-radius:9px; font-family:inherit; font-size:11px; font-weight:700; cursor:pointer; white-space:nowrap; transition:.18s ease; }
.crm-btn-primary { color:#fff !important; background:var(--crm-blue); }
.crm-btn-primary:hover { background:#147abd; }
.crm-btn-muted { color:#40556b !important; background:#f3f6f9; border-color:#e0e7ee; }
.crm-btn-muted:hover { background:#e8eef4; }
.crm-btn-small { color:#1c6ea8 !important; background:#eef7fd; border-color:#d4eafa; padding:7px 10px; }
.crm-btn-link { width:100%; margin-top:15px; }
.crm-table-wrap { overflow:auto; width:100%; }
.crm-table { width:100%; min-width:1000px; border-collapse:collapse; font-size:11px; }
.crm-table th { background:#f8fafc; color:#718196; font-weight:700; white-space:nowrap; text-align:right; }
.crm-table th,.crm-table td { padding:14px 13px; border-bottom:1px solid #edf1f5; vertical-align:middle; }
.crm-table tbody tr:last-child td { border-bottom:0; }
.crm-table tbody tr:hover { background:#fbfdff; }
.crm-table td strong { font-weight:800; }
.crm-phone { font-feature-settings: "tnum"; direction:ltr; unicode-bidi:embed; white-space:nowrap; color:#216fa8 !important; }
.crm-address-cell { max-width:230px; min-width:165px; }
.crm-address-cell strong,.crm-address-cell span { display:block; }
.crm-address-cell span { color:#76879a; white-space:normal; max-width:230px; margin-top:3px; line-height:1.8; }
.crm-status { display:inline-flex; justify-content:center; white-space:nowrap; padding:5px 9px; border-radius:999px; font-size:10px; font-weight:800; }
.status-new { background:#e9f4ff; color:#176cae; }
.status-contacted { background:#fff4dd; color:#94630b; }
.status-in_progress { background:#eee9ff; color:#6240a4; }
.status-done { background:#e5f7ec; color:#197446; }
.status-cancelled { background:#ffeded; color:#ab3f3f; }
.crm-status-large { padding:9px 14px; }
.crm-empty { padding:35px !important; text-align:center; color:var(--crm-muted); }
.crm-admin-note { margin:16px 4px 0; color:#8694a4; font-size:10px; }
.crm-detail-main { max-width:1180px; }
.crm-detail-grid { display:grid; grid-template-columns:1.2fr .8fr; gap:20px; align-items:start; }
.crm-detail-list { margin:0; padding:5px 22px 18px; }
.crm-detail-list > div { display:grid; grid-template-columns:150px 1fr; gap:15px; padding:14px 0; border-bottom:1px solid #edf1f5; }
.crm-detail-list > div:last-child { border-bottom:0; }
.crm-detail-list dt { color:var(--crm-muted); font-size:11px; }
.crm-detail-list dd { margin:0; font-size:12px; line-height:2; overflow-wrap:anywhere; }
.crm-long-text { white-space:normal; }
.crm-inline-link { color:#218bd5 !important; font-size:10px; margin-right:12px; }
.crm-form { padding:22px; display:flex; flex-direction:column; gap:9px; }
.crm-form label { font-size:11px; font-weight:800; margin-top:5px; }
.crm-form textarea { resize:vertical; width:100%; }
.crm-form > .crm-btn { margin-top:8px; width:100%; }
.crm-contact-callout { margin:0 22px 22px; padding:15px; background:#f4f9fd; border:1px solid #dcecf8; border-radius:12px; display:flex; justify-content:space-between; gap:12px; font-size:12px; }
.crm-contact-callout a { color:#167fbe !important; font-weight:900; }
.crm-login-wrap { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:25px; background:radial-gradient(ellipse at 70% 12%, #1c4260 0, #101f32 40%, #0b1728 78%); }
.crm-login-card { width:min(100%,430px); padding:34px; background:#fff; border:1px solid rgba(255,255,255,.2); border-radius:19px; box-shadow:0 25px 90px rgba(0,0,0,.22); }
.crm-login-card h1 { font-size:25px; margin:5px 0 4px; }
.crm-logo { display:grid; place-items:center; width:55px; height:55px; border-radius:15px; background:#e9f6fd; border:1px solid #d1ebfa; color:#167dbd; font-size:18px; font-weight:900; direction:ltr; margin-bottom:16px; }
.crm-login-card .crm-form { padding:20px 0 5px; }
.crm-login-card .crm-form > .crm-btn { margin-top:12px; }
.crm-back-link { color:#b9cede !important; position:absolute; top:24px; right:28px; font-size:12px; }
.crm-footnote { font-size:10px; line-height:1.9; color:#8795a5; margin:13px 0 0; }
.crm-alert { border-radius:10px; padding:12px 14px; font-size:11px; line-height:1.9; margin-top:18px; }
.crm-alert-error { color:#9c3030; background:#fff0f0; border:1px solid #f2d0d0; }
.crm-alert-success { color:#176b45; background:#e9f8ef; border:1px solid #c9ecd8; }
.crm-alert code { direction:ltr; display:inline-block; }
@media (max-width:1000px) {
  .crm-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm-detail-grid { grid-template-columns:1fr; }
}
@media (max-width:700px) {
  .crm-topbar { padding:13px 16px; align-items:flex-start; }
  .crm-top-actions { gap:9px; flex-wrap:wrap; justify-content:flex-end; }
  .crm-main { width:calc(100% - 26px); margin-top:22px; }
  .crm-page-heading { align-items:flex-start; flex-direction:column; }
  .crm-page-heading > .crm-btn { width:100%; }
  .crm-filter-form { align-items:stretch; flex-direction:column; padding:14px; }
  .crm-filter-form input[type="search"],.crm-filter-form select { flex:1 1 auto; width:100%; }
  .crm-filter-form .crm-btn { width:100%; }
  .crm-panel-heading { padding:17px 15px; }
  .crm-stat { padding:15px; }
  .crm-stat strong { font-size:25px; }
  .crm-detail-list { padding-inline:15px; }
  .crm-detail-list > div { grid-template-columns:1fr; gap:3px; }
  .crm-contact-callout { margin-inline:15px; flex-direction:column; }
  .crm-login-card { padding:26px 21px; }
  .crm-back-link { top:13px; right:16px; }
}
