@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap');

/* Shared visual language for the workspace, its forms and all dialogs. */
:root {
  --ink: #172e32; --text: #172e32; --muted: #627575; --green: #b1e46b;
  --green-dark: #235749; --lime: #b1e46b; --lime-dark: #235749;
  --line: #dfe7e2; --tint: #f0f6e9; --paper: #fff; --surface: #fff;
  --surface-soft: #f7f9f6; --bg: #f3f6f2; --teal: #235749;
  --shadow: 0 5px 20px #173e2c05; --radius-xl: 18px; --radius-lg: 14px;
  --radius-md: 10px; --body-font: 'Source Sans 3', sans-serif;
  --title-font: 'Manrope', 'Source Sans 3', sans-serif; --rail: 232px;
}
.crm-theme { margin: 0; color: var(--ink); font: 16px/1.5 var(--body-font); background: radial-gradient(ellipse at 70% 0%, #e9efde 0, transparent 42%), var(--bg); }
.crm-theme:not(.crm-login) { padding-left: var(--rail); }
.crm-theme *, .crm-theme *::before, .crm-theme *::after { box-sizing: border-box; }
.crm-theme h1,.crm-theme h2,.crm-theme h3,.crm-theme legend { font-family: var(--title-font); letter-spacing: -.035em; color: var(--ink); }
.crm-theme h1 { font-size: clamp(27px, 2.5vw, 36px); font-weight: 800; line-height: 1.2; max-width: none; }
.crm-theme h2 { font-size: 23px; line-height: 1.35; }
.crm-theme h3 { font-size: 17px; }
.crm-theme p { line-height: 1.6; }
.crm-theme a { text-underline-offset: 4px; }
.crm-theme button,.crm-theme input,.crm-theme select,.crm-theme textarea { font-family: var(--body-font); }
.crm-theme :is(button,.button,.primary-btn,.outline-btn,.ghost-btn,.admin-btn,.small-btn,.mailbox-button) { border-radius: 9px; font-weight: 600; box-shadow: none; transition: background .18s, border-color .18s, box-shadow .18s; }
.crm-theme :is(button,.button):focus-visible,.crm-theme a:focus-visible { outline: 3px solid #347563; outline-offset: 3px; }
.crm-theme :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { border: 1px solid #cbd9d1; border-radius: 9px; background: #fff; color: var(--ink); padding: 11px 13px; font-size: 16px; font-weight: 400; min-width: 0; }
.crm-theme :is(input,select,textarea):focus { outline: 2px solid #347563; outline-offset: 2px; }
.crm-theme input:read-only { background: #f1f4f0; color: #536863; }
.crm-theme input[type=checkbox],.crm-theme input[type=radio] { accent-color: #28604d; }
.crm-theme :is(.primary,.primary-btn,.admin-btn) { background: #b1e46b; border: 1px solid #a1d559; color: #203d1d; }
.crm-theme :is(.primary,.primary-btn,.admin-btn):hover:not(:disabled) { background: #a1d559; border-color: #91c64a; }
.crm-theme :is(.outline-btn,.ghost-btn,.button:not(.primary),button:not(.primary):not(.primary-btn):not(.admin-btn):not(.cancel-action)):hover:not(:disabled) { border-color: #94b09e; }
.crm-theme :is(button,.button):disabled { opacity: .48; cursor: not-allowed; }
.crm-theme [hidden] { display: none !important; }
.crm-theme .error { color: #a62e32; }
.crm-theme .eyebrow { background: none; padding: 0; border-radius: 0; color: #5d735e; font: 700 10px/1.4 var(--body-font); letter-spacing: .16em; text-transform: uppercase; }
.ui-icon { width: 19px; height: 19px; flex: 0 0 19px; }
.skip-link { position: fixed; z-index: 2000; top: -80px; left: 250px; padding: 14px; background: #fff; color: var(--ink); border: 2px solid #235749; }
.skip-link:focus { top: 12px; }

/* Navigation stays in one place throughout the entire CRM. */
.crm-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--rail); display: flex; flex-direction: column; padding: 30px 16px 18px; background: #fbfcf9; border-right: 1px solid var(--line); overflow-y: auto; }
.crm-logo { display: flex; align-items: center; gap: 11px; padding: 0 12px; text-decoration: none !important; color: #163a2d; }
.crm-logo img { object-fit: contain; }
.crm-logo>span { font: 800 26px/1.15 var(--title-font); letter-spacing: -.06em; }
.crm-logo small { display: block; margin-top: 7px; color: #748275; font: 600 9px var(--body-font); letter-spacing: .15em; }
.crm-navigation { display: flex; flex-direction: column; gap: 4px; padding: 0; margin: 30px 0 22px; background: none; border: 0; border-radius: 0; box-shadow: none; }
.crm-navigation .nav-caption { display: block; margin: 23px 12px 8px; color: #7a8b81; font-size: 9px; letter-spacing: .13em; font-weight: 700; }
.crm-navigation .nav-link { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; min-height: 43px; font: 600 14px var(--body-font); color: #526960; white-space: nowrap; text-decoration: none; }
.crm-navigation .nav-link.active,.crm-navigation .nav-link[aria-current] { background: #eaf1df; border-color: #e1ead3; color: #244c32; }
.crm-navigation .nav-link.active .ui-icon,.crm-navigation .nav-link[aria-current] .ui-icon { stroke-width: 2; }
.crm-navigation .nav-link:hover { background: #f0f4ec; color: #1c4334; }
.crm-navigation .external-link { font-weight: 400; font-size: 13px; min-height: 35px; }
.crm-navigation .external-link .ui-icon { width: 16px; height: 16px; }
.crm-navigation .crm-create { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 8px; margin: 0 4px 2px; background: #214f40; color: white; border-radius: 10px; font: 600 14px var(--body-font); text-decoration: none; }
.crm-create:hover { background: #163d30; }
.sidebar-note { margin: auto 10px 0; padding-top: 28px; border-top: 1px solid var(--line); }
.sidebar-mark { font: 800 26px var(--title-font); letter-spacing: -.08em; color: #84a366; }
.sidebar-note p { color: #7e8e83; font-size: 12px; line-height: 1.65; margin: 6px 0 0; }
.sidebar-note strong { color: #49624f; font-weight: 600; }
.crm-theme .shell { width: 100%; max-width: 1496px; padding: 0 40px 48px; margin: auto; }
.crm-dashboard .page { width: min(calc(100% - 80px), 1456px); padding: 0 0 48px; }
.crm-theme .top-line { display: none; }
.crm-theme .brand-row,.crm-theme .topbar { min-height: 98px; padding: 20px 0; margin: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.workspace-heading>span { display: block; font-size: 9px; font-weight: 700; color: #7d9081; letter-spacing: .15em; margin-bottom: 5px; }
.workspace-heading strong { font: 700 15px var(--title-font); letter-spacing: -.025em; }
.crm-theme .account,.crm-theme .top-actions { gap: 12px; font-size: 14px; color: #38574a; }
.crm-theme .account button,.crm-theme .pill,.crm-theme .user-chip { font-size: 13px; border-radius: 8px; min-height: 36px; padding: 8px 12px; background: #ffffffa6; }
.crm-theme .account>span { font-weight: 600; }
.crm-theme .user-chip { color: #244938; font-weight: 600; border: 0; background: none; }
.crm-theme #online-bar { position: static; padding: 12px 0 20px; gap: 10px; background: transparent; font: 12px var(--body-font); color: #647c6d; min-height: 62px; }
.crm-theme #online-bar button,.crm-theme #online-bar a { padding: 6px 10px; font-size: 12px; border-color: var(--line); border-radius: 7px; background: #ffffff9c; }
.crm-theme #online-status { line-height: 1.5; }
.crm-theme #status { font-size: 13px; color: #6c8073; margin: 18px 0; min-height: 20px; }
.crm-theme #status.error { color: #a62e32; }
.crm-theme .shell>main { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.crm-theme .shell>main:has(#new-inquiry:not([hidden])) { max-width: 1080px; margin-inline: auto; }
.crm-theme .heading { gap: 22px; margin-bottom: 28px; }
.crm-theme .heading p { max-width: 70ch; font-size: 15px; margin: 14px 0 0; }
.crm-theme .heading>.button { flex-shrink: 0; font-size: 14px; }
.crm-theme .back { font-size: 13px; color: #627b68; margin-bottom: 25px; }

/* The dashboard is a compact daily briefing rather than a wall of banners. */
.crm-theme .hero { grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 20px; margin-bottom: 34px; }
.crm-theme .hero-card { padding: 32px; color: #fff; position: relative; background: radial-gradient(ellipse at 100% 0,#376d4a,transparent 65%), #193e33; border-color: #264e3c; min-width: 0; }
.crm-theme .hero-card::after { content: ''; position: absolute; width: 215px; height: 215px; border: 1px solid #b0d78c24; border-radius: 50%; right: -80px; top: -75px; box-shadow: 0 0 0 24px #b0d78c08,0 0 0 48px #b0d78c06; pointer-events: none; }
.crm-theme .hero-card>.eyebrow { color: #bdd295; }
.crm-theme .hero-card h1 { color: #f6faee; font-size: clamp(27px,2.6vw,39px); line-height: 1.23; margin: 13px 0 22px; position: relative; z-index: 1; }
.crm-theme .hero-rotator { margin: 0; }
.crm-theme .hero-rotator-card { min-height: 142px; padding: 18px 0; border: 0; border-top: 1px solid #ffffff26; border-radius: 0; background: none; box-shadow: none; }
.crm-theme .hero-rotator-label { padding: 0; margin-bottom: 8px; background: none; color: #c8d8bc; font-size: 12px; font-weight: 500; }
.crm-theme .hero-rotator-value { font: 700 clamp(27px,2.8vw,40px)/1.2 var(--title-font); color: #c4ef8b; margin-bottom: 8px; }
.crm-theme .hero-card .hero-rotator-note { color: #b6cbbd; font-size: 13px; line-height: 1.5; }
.crm-theme .hero-grid { gap: 0; margin-top: 18px; padding-top: 20px; border-top: 1px solid #ffffff26; }
.crm-theme .mini-stat { padding: 0 16px; border: 0; border-left: 1px solid #ffffff26; border-radius: 0; background: none; }
.crm-theme .mini-stat:first-child { padding-left: 0; border: 0; }
.crm-theme .mini-stat:last-child { padding-right: 0; }
.crm-theme .mini-stat strong { color: #f7ffe9; font: 700 23px var(--title-font); margin-bottom: 5px; }
.crm-theme .mini-stat span { display: block; color: #bdd0bd; font-size: 11px; line-height: 1.6; }
.crm-theme .spotlight-card { background: #fff; color: var(--ink); min-height: 0; padding: 24px; gap: 13px; }
.crm-theme .chat-topline { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.crm-theme .chat-topline small { display: block; font-size: 9px; letter-spacing: .13em; color: #788b7d; margin-bottom: 6px; }
.crm-theme .chat-topline strong { font: 700 18px var(--title-font); }
.crm-theme .chat-topline>span { font-size: 10px; color: #476e48; white-space: nowrap; background: #f0f6e9; padding: 4px 7px; border-radius: 5px; }
.crm-theme .chat-list { min-height: 90px; max-height: 155px; }
.crm-theme .chat-message { padding: 10px 12px; background: #f2f4f2; border: 1px solid #e8ede7; border-radius: 10px; }
.crm-theme .chat-message.mine { background: #edf7df; border-color: #daebc4; }
.crm-theme .chat-message-header { font-size: 11px; color: #557459; }
.crm-theme .chat-message p { font-size: 13px; }
.crm-theme .chat-hint { font-size: 11px; line-height: 1.5; color: #728577; }
.crm-theme .chat-form textarea { min-height: 62px; font-size: 14px; background: #fafbf8; }
.crm-theme .chat-form .form-actions { justify-content: flex-end; gap: 8px; }
.crm-theme .chat-form button { font-size: 12px; min-height: 34px; padding: 7px 11px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 0 20px; gap: 14px; }
.dashboard-heading h2 { margin: 5px 0 0; }
.dashboard-heading>span { color: #7d8c7f; font-size: 12px; }
.crm-theme .dashboard { gap: 20px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.crm-theme .tile { min-width: 0; border-radius: 14px; box-shadow: var(--shadow); }
.crm-theme .tile .tile-header { background: #fff; color: var(--ink); padding: 18px 20px; border-bottom: 1px solid #eaf0e8; min-height: 61px; font: 700 15px var(--title-font); gap: 10px; }
.crm-theme .tile-header>span:first-child { min-width: 0; }
.crm-theme .tile-header>span:last-child { color: #7b8c7e; font: 400 11px var(--body-font); opacity: 1; }
.crm-theme .tile-header.tile-link:hover { background: #f8fbf4; filter: none; }
.crm-theme .tile-header.tile-link>span:last-child::after { content: ' ↗'; color: #477651; font-size: 14px; }
.crm-theme .header-count { background: #eaf3db; color: #385828; font-size: 10px; padding: 3px 6px; font-style: normal; }
.crm-theme .tile-body { min-height: 0; padding: 18px 20px 22px; }
.crm-theme .banner-toolbar { margin-bottom: 16px; gap: 8px; }
.crm-theme .banner-toolbar:has(>.soft-badge:empty):not(:has(button:not([style*="display: none"]))) { display: none; }
.crm-theme .soft-badge:empty,.crm-theme .section-chip:empty,.crm-theme .footer-note:empty { display: none; }
.crm-theme .soft-badge { background: #f2f5ed; color: #6b7c59; border-radius: 5px; padding: 4px 7px; font-size: 10px; font-weight: 500; }
.crm-theme .badge-row { gap: 4px; }
.crm-theme .banner-toolbar .admin-btn { font-size: 11px; min-height: 29px; padding: 5px 9px; }
.crm-theme :is(.app-card,.notary-card,.qa-item,.item-card) { background: #fafbf7; border-color: #e2e9da; border-radius: 10px; padding: 15px; box-shadow: none; }
.crm-theme :is(.app-card,.notary-card,.qa-item,.item-card):hover { border-color: #bacead; }
.crm-theme .app-card p,.crm-theme .notary-card span { font-size: 12px; line-height: 1.6; }
.crm-theme .app-card strong,.crm-theme .notary-card strong { font-size: 14px; }
.crm-theme .notary-card { gap: 12px; }
.crm-theme .notary-card .outline-btn { font-size: 11px; padding: 5px 9px; min-height: 29px; }
.crm-theme :is(.news-list,.simple-list,.app-grid,.notary-grid,.metric-stack) { gap: 12px; }
.crm-theme .switcher { border: 0; background: #f2f5ec; border-radius: 7px; gap: 2px; }
.crm-theme .switcher-btn { font-size: 11px; padding: 6px 9px; min-height: 30px; border-radius: 5px; }
.crm-theme .switcher-btn.active { background: #fff; color: #2f5a3e; box-shadow: 0 1px 4px #1834230d; }
.crm-theme .metric-card { padding: 15px; border-radius: 10px; background: #f7f9f4; border-color: #e5ebdf; }
.crm-theme .metric-card strong { font: 800 24px var(--title-font); letter-spacing: -.045em; }
.crm-theme .metric-card span,.crm-theme .metric-card em { font-size: 11px; }
.crm-theme #aplikace { grid-column: span 2; }
.crm-theme #apps-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
.crm-theme #apps-list .app-card { display: flex; flex-direction: column; gap: 6px; }
.crm-theme #apps-list .app-card p { margin: 5px 0 12px; }
.crm-theme #apps-list .app-links { margin-top: auto; }
.crm-theme #apps-list .outline-btn { font-size: 11px; padding: 7px 9px; min-height: 30px; }
.crm-theme .mailbox-panel .tile-body { padding: 22px; }
.crm-theme .mailbox-message { border-radius: 10px; padding: 17px; }
.crm-theme .mailbox-button { font-size: 13px; }
.crm-theme .mailbox-toolbar p,.crm-theme .mailbox-note { font-size: 13px; }

/* Cases, forms, data tables and secondary workspace views. */
.crm-theme .section-tabs { gap: 10px; padding: 0 0 24px; }
.crm-theme .section-tabs button { background: #f7f9f3; padding: 18px 15px; font-size: 15px; border-color: #e4eadb; border-radius: 10px; }
.crm-theme .section-tabs button[aria-selected=true] { background: #254f40; color: #fff; border-color: #254f40; box-shadow: none; }
.crm-theme .section-tabs button[aria-selected=true] .section-step { color: #b6ccad; }
.crm-theme .section-tabs button[aria-selected=true] .section-count { background: #b1e46b; color: #213f27; }
.crm-theme .section-step { font-size: 10px; }
.crm-theme .section-count { font-size: 12px; }
.crm-theme .section-description { font-size: 13px; margin: 18px 0; }
.crm-theme .inquiry-card { background: #fff; border-color: #e0e8dc; border-radius: 11px; padding: 22px; gap: 7px 20px; }
.crm-theme .inquiry-card:hover { background: #fafcf6; box-shadow: 0 3px 12px #214c3010; }
.crm-theme .inquiry-card strong { font: 700 17px var(--title-font); }
.crm-theme .inquiry-card .meta { font-size: 12px; }
.crm-theme .inquiry-card .preview { font-size: 14px; line-height: 1.6; }
.crm-theme .badge { font-size: 11px; background: #edf5df; color: #4c692e; border: 1px solid #e2edcf; padding: 4px 9px; border-radius: 6px; }
.crm-theme .badge.pending { background: #fff4da; border-color: #f0dfb4; color: #8b621d; }
.crm-theme .pagination { font-size: 13px; padding-top: 20px; border-top: 1px solid #edf1e9; }
.crm-theme .pagination button { font-size: 13px; padding: 9px 13px; }
.crm-theme .empty { background: #f8faf5; border: 1px dashed #d8e3cc; border-radius: 10px; padding: 40px 20px; font-size: 14px; color: #71856c; }
.crm-theme .process-track { gap: 0; margin: 24px 0 28px; }
.crm-theme .process-track li { position: relative; border: 0; border-bottom: 2px solid #e5ebdf; border-radius: 0; padding: 10px 18px; font-size: 12px; background: none; }
.crm-theme .process-track li[aria-current] { border-color: #346b4c; color: #2d6142; background: #f6f9ef; }
.crm-theme .steps { gap: 30px; padding: 18px 0; margin: 0 0 25px; font-size: 13px; }
.crm-theme legend { font-size: 21px; margin-bottom: 24px; }
.crm-theme label { font-size: 14px; font-weight: 600; gap: 7px; }
.crm-theme label small { font-size: 11px; font-weight: 400; }
.crm-theme .fields { gap: 22px 26px; }
.crm-theme .notice { padding: 15px 18px; border-radius: 0 8px 8px 0; border-left: 3px solid #9ac64f; background: #f4f8eb; color: #537043; font-size: 14px; line-height: 1.65; margin: 18px 0; }
.crm-theme .upload { background: #f9fbf6; border-color: #bfcea9; padding: 23px; border-radius: 10px; }
.crm-theme input[type=file] { font-size: 13px; background: none; border: 0; padding: 5px 0; }
.crm-theme input[type=file]::file-selector-button { padding: 8px 13px; margin-right: 12px; border: 1px solid #c5d4b8; background: #fff; color: #3d5c34; border-radius: 7px; font: 600 13px var(--body-font); cursor: pointer; }
.crm-theme .review { font-size: 14px; gap: 14px 22px; }
.crm-theme .review dt { color: #718675; }
.crm-theme .message { font-size: 14px; border-radius: 10px; background: #f3f7ed; border-color: #dfe9d2; line-height: 1.8; }
.crm-theme .section-shell { padding: 28px; border-radius: 15px; }
.crm-theme .section-title h2 { font-size: 29px; }
.crm-theme .section-title p { font-size: 14px; }
.crm-theme :is(.form-card,.client-detail,.detail-card,.history-sidebar) { background: #f8faf5; border-color: #e0e8d8; border-radius: 12px; }
.crm-theme .table-wrap { border-radius: 11px; border-color: #e0e8dc; }
.crm-theme table { border-collapse: collapse; }
.crm-theme table thead th { background: #f0f4e9; color: #557144; font: 600 11px var(--body-font); padding: 14px; border-bottom: 1px solid #dce6cf; }
.crm-theme table tbody td { padding: 15px 13px; font-size: 13px; border-color: #ebeee7; }
.crm-theme table tbody tr:nth-child(odd) td { background: #fcfdf9; }
.crm-theme table tbody tr:hover td { background: #f3f7ed; }
.crm-theme #contracts-view .split-layout { grid-template-columns: 1fr; gap: 20px; }
.crm-theme #contracts-view .mini-panel { padding: 20px; border: 1px solid #e3eadc; border-radius: 12px; background: #f8faf4; }
.crm-theme #contracts-view .mini-panel:first-child { display: grid; grid-template-columns: 1fr auto; gap: 5px 20px; background: #fff; }
.crm-theme #contracts-view .mini-panel:first-child h3 { margin: 0; font-size: 16px; }
.crm-theme #contracts-view .mini-panel:first-child p { margin: 0; font-size: 13px; grid-column: 1; }
.crm-theme #contracts-view .mini-panel:first-child .form-actions { grid-column: 2; grid-row: 1/3; margin: 0 !important; align-items: center; }
.crm-theme #contracts-view .mini-panel:first-child button { min-height: 41px; font-size: 13px; }
.crm-theme #contracts-view .stats-inline { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 18px; }
.crm-theme #contracts-view .metric-card { padding: 0 20px; border: 0; border-left: 1px solid #dce6cc; background: none; border-radius: 0; }
.crm-theme #contracts-view .metric-card:first-child { border-left: 0; padding-left: 0; }
.crm-theme #contracts-view .metric-card em { font-size: 16px; margin-top: 7px; color: #467544; }
.crm-theme #contracts-view .metric-card:last-child strong { color: #407338; }
.crm-theme #contracts-view .contracts-summary-title h3 { font-size: 17px; }
.crm-theme .contracts-month-tabs { padding-top: 20px; gap: 5px; }
.crm-theme .contracts-month-tab { font-size: 12px; border-radius: 7px; min-height: 36px; padding: 7px 12px; }
.crm-theme .contracts-table th.subhead { background: #e7eedb; }
.crm-theme .contracts-overview-caption { font-size: 13px; }
.crm-theme .collab-layout { gap: 30px; margin-top: 28px; }
.crm-theme .collab-form h2,.crm-theme .collab-rules h2 { font-size: 21px; }
.crm-theme .collab-rules { background: #f5f8ef; border: 1px solid #e1e9d5; border-radius: 12px; padding: 25px; }
.crm-theme .collab-rules p { font-size: 14px; }
.crm-theme .collab-tag { background: #edf3e3; color: #657d4e; font-size: 12px; border-radius: 6px; }
.crm-theme .collab-item { border-color: var(--line); border-radius: 10px; background: white; }
.crm-theme .collab-cron { color: #6b8059; }
.crm-theme .cancel-impact { background: #fffbf4; border-color: #eadfc8; border-left-color: #b98644; }
.crm-theme .cancel-action { background: #943d30; border-color: #943d30; color: #fff; }
.crm-theme .cancel-action:hover:not(:disabled) { background: #7e3025; }
.crm-theme .precontract-cta { background: #f2f7e9; border-color: #d7e5c1; border-radius: 10px; }
.crm-theme .precontract-cta strong { font-size: 16px; }
.crm-theme .precontract-cta p { font-size: 13px; }
.crm-theme dialog { color: var(--ink); border: 1px solid #dfe7d8; border-radius: 16px; box-shadow: 0 28px 120px #10261940; }
.crm-theme dialog::backdrop { background: #142d255e; backdrop-filter: blur(5px); }
.crm-theme dialog header { padding-bottom: 20px; }
.crm-theme dialog h2 { font-size: 23px; }
.crm-theme .modal-card { border-radius: 16px; border-color: var(--line); }
.crm-theme .modal-header,.crm-theme .modal-footer { background: #fafcf7; }
.crm-theme .modal { background: #142d255e; backdrop-filter: blur(5px); }
.crm-theme .chat-page-shell { border-radius: 16px; overflow: hidden; }
.crm-theme .chat-page-top { background: #254f40; color: white; }
.crm-theme .chat-page-top h2,.crm-theme .chat-page-top p { color: white; }
.crm-theme .chat-page-list { background: radial-gradient(circle at 15% 20%,#e9f0de,transparent 60%),#f5f7f1; }
.crm-theme .chat-bubble { background: #fff; border: 1px solid #e1e8da; box-shadow: none; border-radius: 12px; }
.crm-theme .chat-bubble.mine { background: #e7f3d6; border-color: #d9e9c5; }
.crm-theme .chat-page-form { background: #fff; border-top: 1px solid var(--line); }
.crm-accounts .shell>main { max-width: none; margin: 25px 0 0; }
.crm-accounts #table-wrap { overflow-x: auto; }
.crm-accounts main>header { margin-top: 16px; }
.crm-accounts main>p { font-size: 14px; }
.crm-accounts dialog footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; }

/* A quiet branded entry, using only CSS geometry rather than decorative stock art. */
.crm-login { min-height: 100dvh; display: grid; place-items: center; padding: 40px 20px; }
.crm-login .login-shell { display: grid; grid-template-columns: 1fr 1fr; width: min(960px,100%); border: 1px solid #dfe7d4; border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 24px 70px #1733200c; }
.login-story { position: relative; overflow: hidden; padding: 48px; color: #f6faee; background: radial-gradient(ellipse at 100% 100%,#417346,transparent 80%),#1b4034; display: flex; flex-direction: column; min-height: 560px; }
.login-story .crm-logo { padding: 0; color: white; position: relative; z-index: 1; }
.login-story .crm-logo small { color: #b7ccac; }
.login-story h2 { margin: auto 0 20px; font: 700 39px/1.18 var(--title-font); color: #f5faed; letter-spacing: -.05em; position: relative; z-index: 1; }
.login-story h2 span { color: #bde481; }
.login-story p { color: #b3ccb7; font-size: 14px; max-width: 26ch; position: relative; z-index: 1; }
.login-orbit { position: absolute; top: 95px; right: -145px; width: 320px; height: 320px; border: 1px solid #b9d68e40; border-radius: 50%; box-shadow: 0 0 0 40px #bddb9008,0 0 0 80px #bddb9006; }
.crm-login main { width: 100%; padding: 54px 46px; border: 0; border-radius: 0; box-shadow: none; background: white; margin: 0; align-self: center; }
.crm-login h1 { font-size: 27px; margin: 12px 0; }
.crm-login main>p { font-size: 14px; margin: 0 0 28px; }
.crm-login label { margin: 20px 0 8px; }
.crm-login #submit { background: #b1e46b; color: #203d1d; border-radius: 9px; font: 700 15px var(--body-font); padding: 13px; margin-top: 25px; }
.crm-login #submit:hover { background: #a3d658; }
.crm-login main>small { display: block; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.65; }
.crm-login #error { font-size: 13px; margin: 12px 0; }

@media(min-width:1700px) { .crm-theme { --rail: 250px; } .crm-theme .hero-card { padding: 38px; } }
@media(max-width:1250px) and (min-width:1001px) {
  .crm-theme { --rail: 210px; } .crm-theme .shell { padding: 0 24px 36px; } .crm-dashboard .page { width: calc(100% - 48px); }
  .crm-theme .hero { grid-template-columns: 1fr 1fr; } .crm-theme .hero-card { padding: 25px; } .crm-theme .spotlight-card { padding: 20px; }
  .crm-theme .dashboard { grid-template-columns: repeat(2,minmax(0,1fr)); } .crm-theme #aplikace { grid-column: auto; } .crm-theme #apps-list { grid-template-columns: 1fr; }
  .crm-theme .clients-layout { grid-template-columns: 1fr; } .crm-theme .section-tabs button { gap: 7px; padding: 16px 10px; font-size: 13px; }
}
@media(max-width:1000px) {
  .crm-theme:not(.crm-login) { padding-left: 0; } .crm-sidebar { position: static; width: 100%; padding: 18px 24px 0; border: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .crm-logo { padding: 0; } .crm-logo>span { font-size: 23px; } .crm-logo img { width: 33px; height: 38px; } .crm-logo small { font-size: 8px; margin-top: 4px; }
  .crm-navigation { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 5px; padding: 12px 0 14px; margin: 8px 0 0; scrollbar-width: thin; }
  .crm-navigation .nav-link { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; min-height: 39px; } .crm-navigation .crm-create { flex: 0 0 auto; padding: 10px 14px; font-size: 13px; margin: 0; }
  .crm-navigation .nav-caption,.sidebar-note { display: none; } .crm-navigation .external-link { font-size: 12px; }
  .crm-theme .shell { padding: 0 24px 35px; } .crm-dashboard .page { width: calc(100% - 48px); }
  .crm-theme .brand-row,.crm-theme .topbar { min-height: 76px; padding: 14px 0; }
  .crm-theme .hero { gap: 16px; grid-template-columns: 1fr 1fr; } .crm-theme .hero-card { padding: 25px; } .crm-theme .spotlight-card { padding: 20px; }
  .crm-theme .dashboard { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; } .crm-theme #aplikace { grid-column: auto; } .crm-theme #apps-list { grid-template-columns: 1fr; }
  .skip-link { left: 12px; } .crm-theme .clients-layout { grid-template-columns: 1fr; }
}
@media(max-width:700px) {
  .crm-sidebar { padding: 14px 16px 0; } .crm-navigation { margin-top: 6px; padding-bottom: 12px; } .crm-navigation .nav-link .ui-icon { display: none; }
  .crm-theme .shell { padding: 0 14px 30px; } .crm-dashboard .page { width: calc(100% - 28px); }
  .crm-theme .workspace-heading { display: none; } .crm-theme .brand-row,.crm-theme .topbar { min-height: 60px; justify-content: flex-end; }
  .crm-theme .account { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; } .crm-theme .top-actions { justify-content: flex-end; width: 100%; gap: 4px; }
  .crm-theme .top-actions .pill { font-size: 11px; } .crm-theme .user-chip { font-size: 12px; }
  .crm-theme #online-bar { padding: 12px 0; row-gap: 8px; font-size: 10px; } .crm-theme #online-status { flex: 1 1 150px; } .crm-theme #online-bar button,.crm-theme #online-bar a { font-size: 10px; padding: 5px 7px; }
  .crm-theme #status { font-size: 12px; margin: 13px 0; }
  .crm-theme .shell>main { padding: 24px 18px; border-radius: 13px; } .crm-theme .heading { margin-bottom: 22px; } .crm-theme h1 { font-size: 27px; }
  .crm-theme .hero { grid-template-columns: 1fr; margin-bottom: 28px; } .crm-theme .hero-card { padding: 26px; }
  .crm-theme .hero-card h1 { font-size: 30px; } .crm-theme .hero-rotator-card { min-height: 132px; }
  .crm-theme .mini-stat { padding: 0 12px; } .crm-theme .hero-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; }
  .crm-theme .mini-stat span { font-size: 10px; } .crm-theme .dashboard { grid-template-columns: 1fr; }
  .dashboard-heading>span { display: none; } .dashboard-heading h2 { font-size: 21px; }
  .crm-theme .tile .tile-header { min-height: 58px; } .crm-theme .tile-body { padding: 18px 20px; }
  .crm-theme .chat-list { max-height: 210px; } .crm-theme .chat-hint { max-width: none; }
  .crm-theme .section-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding-bottom: 20px; }
  .crm-theme .section-tabs button { display: grid; grid-template-columns: minmax(0,1fr) auto; padding: 10px; gap: 5px; font-size: 12px; line-height: 1.4; }
  .crm-theme .section-step { grid-column: 1; } .crm-theme .section-tabs button>span:nth-child(2) { grid-row: 2; grid-column: 1/-1; }
  .crm-theme .section-count { grid-column: 2; grid-row: 1; padding: 1px 5px; font-size: 10px; }
  .crm-theme .inquiry-card { padding: 18px; } .crm-theme .inquiry-card strong { font-size: 16px; }
  .crm-theme .fields { gap: 19px; } .crm-theme .steps { gap: 14px; font-size: 11px; } .crm-theme .process-track li { padding: 9px 12px; font-size: 11px; }
  .crm-theme .review { grid-template-columns: 1fr; gap: 4px; } .crm-theme .review dd { margin-bottom: 10px; }
  .crm-theme .section-shell { padding: 20px 16px; } .crm-theme .section-title { flex-wrap: wrap; gap: 10px; }
  .crm-theme .section-title h2 { font-size: 26px; } .crm-theme .collab-layout { grid-template-columns: 1fr; } .crm-theme .collab-rules { padding: 20px; }
  .crm-theme .collab-tag { white-space: normal; } .crm-theme dialog { border-radius: 13px; } .crm-theme .modal-header h3 { font-size: 20px; }
  .crm-theme .pagination { gap: 12px; font-size: 12px; }
  .crm-theme #contracts-view .mini-panel:first-child { display: block; } .crm-theme #contracts-view .mini-panel:first-child p { margin: 10px 0 18px; }
  .crm-theme #contracts-view .mini-panel { padding: 16px; } .crm-theme #contracts-view .stats-inline { grid-template-columns: 1fr; gap: 16px; }
  .crm-theme #contracts-view .metric-card { padding: 0 0 15px; border: 0; border-bottom: 1px solid #dce6cc; }
  .crm-theme #contracts-view .metric-card:last-child { border: 0; padding-bottom: 0; }
  .crm-accounts main>header { flex-direction: column; align-items: flex-start; }
  .crm-login { padding: 20px 14px; } .crm-login .login-shell { grid-template-columns: 1fr; max-width: 440px; }
  .login-story { min-height: 0; padding: 28px; } .login-story h2 { font-size: 26px; margin: 28px 0 0; } .login-story p { display: none; } .login-orbit { top: -150px; }
  .crm-login main { padding: 30px 28px; } .crm-login h1 { font-size: 25px; }
}
@media(prefers-reduced-motion:no-preference) {
  .crm-theme .shell>main,.crm-theme .portal-view.active { animation: workspace-in .35s ease-out both; }
  @keyframes workspace-in { from { opacity: .4; transform: translateY(7px); } to { opacity: 1; transform: none; } }
}
@media(prefers-reduced-motion:reduce) {
  .crm-theme *, .crm-theme *::before, .crm-theme *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
/* Contract entry follows the shared spreadsheet without duplicating client entry. */
#contract-form-modal .modal-form { width: min(860px, 100%); }
#contract-form-modal .field-wide { grid-column: 1 / -1; }
#contract-form-modal .contract-group-title { margin: 4px 0 0; font-size: 16px; }
#contract-form-modal .contract-section { min-width: 0; margin: 12px 0 0; padding: 18px; border: 1px solid #dce5d6; border-radius: 12px; background: #f8faf5; }
#contract-form-modal .contract-section legend { padding: 0 8px; color: #164638; font-weight: 700; }
#contract-form-modal .contract-section .field-help { margin: 0 0 14px; }
#contract-form-modal .contract-section[hidden] { display: none; }
#contract-form-modal .contract-checkbox { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
#contract-form-modal input[type="checkbox"] { width: 20px; height: 20px; accent-color: #43822f; }
.contract-form-error { color: #9e2c24; padding: 0 24px; overflow-wrap: anywhere; }
.contract-form-error:empty { display: none; }
.crm-theme .calc-inline-button { align-self: start; width: fit-content; padding: 6px 9px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--green-dark); font-size: 13px; }
.crm-theme .calc-warning { margin: 4px 0; padding: 10px; border-left: 3px solid #ba8520; background: #fff6dc; color: #674b1a; font-size: 14px; }
.crm-theme .calc-error { color: #a62e32; border-left: 3px solid #a62e32; padding: 10px 14px; background: #fff4f1; }
.crm-theme .calc-error:empty { display: none; }
.crm-theme #calculator-view [aria-invalid="true"] { border-color: #a62e32; }
.crm-theme #calc-advisor-hint { color: var(--muted); }
.crm-theme .calc-source-link { font-size: 13px; color: var(--green-dark); }
.crm-theme #calc-schedule-summary { color: var(--green-dark); font-weight: 600; }
.crm-theme .calc-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.crm-theme .calculator-shell { grid-template-columns: minmax(0, 1fr); }
.crm-theme .calc-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
.crm-theme #calculator-view :is(.calc-panel, .calc-summary, .calc-table-wrap, .field, input, select) { min-width: 0; }
.crm-theme #calculator-view :is(input, select) { width: 100%; }
.crm-theme #calculator-view .field { align-content: start; }
.crm-theme .calc-result strong { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .crm-theme .calc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .crm-theme #calculator-view :is(.calc-panel, .calc-summary, .calc-table-wrap) { padding: 16px; }
  .crm-theme #calculator-view .form-grid { grid-template-columns: minmax(0, 1fr); }
}
.contract-extra-cell { white-space: pre-line; min-width: 130px; max-width: 280px; overflow-wrap: anywhere; }
@media (max-width: 600px) { #contract-form-modal .contract-section { padding: 12px; } }
