:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e5e9f1;
    --text: #172033;
    --muted: #748097;
    --primary: #2764e7;
    --primary-dark: #174bc3;
    --sidebar: #17233d;
    --sidebar-soft: #233252;
    --success: #19a974;
    --warning: #f0a128;
    --danger: #e35266;
    --violet: #7657dc;
    --shadow: 0 8px 24px rgba(25, 43, 81, .06);
    --radius: 14px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 30px; letter-spacing: -.03em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
small { font-size: 12px; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 250px; display: flex; flex-direction: column; color: #dbe4fa; background: var(--sidebar); }
.brand { min-height: 76px; display: flex; align-items: center; gap: 12px; padding: 18px 20px; color: var(--text); }
.sidebar .brand { color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #4a83ff, #2764e7); font-size: 13px; font-weight: 800; box-shadow: 0 6px 20px rgba(52,111,238,.3); }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small { color: #9eacd0; }
.side-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.side-nav a { min-height: 43px; margin: 2px 0; padding: 10px 12px; display: flex; align-items: center; gap: 10px; color: #b8c5e2; border-radius: 9px; font-size: 14px; font-weight: 600; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.side-nav a.active { color: #fff; background: #2b5fc1; box-shadow: inset 3px 0 0 #77a4ff; }
.nav-icon { width: 22px; text-align: center; font-size: 17px; opacity: .95; }
.nav-count { margin-left: auto; padding: 2px 7px; color: #cbd8f5; background: rgba(255,255,255,.1); border-radius: 12px; font-size: 11px; }
.nav-count.danger { color: #fff; background: var(--danger); }
.nav-caption { margin: 18px 12px 7px; color: #6f82ad; text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.sidebar-user { min-height: 76px; display: flex; align-items: center; gap: 10px; padding: 15px; border-top: 1px solid rgba(255,255,255,.08); }
.user-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.user-meta strong, .user-meta small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-meta strong { color: #fff; font-size: 13px; }
.user-meta small { color: #8fa0c5; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #9eb0d5; background: transparent; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.avatar { width: 38px; height: 38px; flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #5f7fbe, #314c80); font-size: 12px; font-weight: 800; }
.avatar.small { width: 28px; height: 28px; font-size: 9px; }
.avatar.tiny { width: 24px; height: 24px; font-size: 8px; }
.avatar.xl { width: 72px; height: 72px; font-size: 20px; }
.main-area { min-height: 100vh; margin-left: 250px; }
.topbar { position: sticky; z-index: 40; top: 0; height: 76px; padding: 0 28px; display: flex; align-items: center; gap: 20px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.global-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.global-search span { color: #94a0b6; font-size: 20px; }
.global-search input { width: 100%; height: 42px; border: 0; outline: 0; background: transparent; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.quick-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 24px; }
.page { width: 100%; max-width: 1700px; padding: 28px; margin: 0 auto; }
.page-header { min-height: 64px; margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.page-header p { margin-bottom: 0; color: var(--muted); }
.eyebrow { margin-bottom: 4px !important; color: var(--primary) !important; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.header-actions { display: flex; gap: 9px; }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.title-line { display: flex; align-items: center; gap: 12px; }
.title-line h1 { margin: 0; }
.btn { min-height: 40px; padding: 9px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 13px; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 5px 14px rgba(39,100,231,.18); }
.btn-primary:hover { color: #fff; background: var(--primary-dark); }
.btn-secondary { color: #35425a; background: #fff; border-color: var(--border); }
.btn-secondary:hover { color: var(--primary); border-color: #b7c9ef; }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-sm { min-height: 34px; padding: 7px 12px; }
.btn-lg { min-height: 48px; font-size: 15px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { min-height: 68px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.card-header h2 { margin-bottom: 2px; }
.card-header p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.messages { margin-bottom: 18px; }
.alert { padding: 12px 15px; border-radius: 9px; background: #eaf3ff; color: #2457a7; border: 1px solid #ccddfa; }
.alert.success { color: #166c4c; background: #e7f8f1; border-color: #bcebd9; }
.alert.error { color: #a83243; background: #fff0f2; border-color: #f7cbd2; }
.metric-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { min-height: 126px; padding: 20px; display: flex; align-items: center; gap: 16px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card:hover { border-color: #cbd6ea; transform: translateY(-2px); }
.metric-icon { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; font-size: 22px; font-weight: 800; }
.metric-card > div { display: flex; flex-direction: column; }
.metric-card small { color: var(--muted); font-weight: 600; }
.metric-card strong { margin: 3px 0; font-size: 25px; letter-spacing: -.03em; }
.metric-card em { color: var(--muted); font-size: 11px; font-style: normal; }
.accent-blue .metric-icon { color: #2764e7; background: #edf3ff; }
.accent-violet .metric-icon { color: #7657dc; background: #f1edff; }
.accent-green .metric-icon { color: #169e6d; background: #e8f8f2; }
.accent-red .metric-icon { color: #e35266; background: #fff0f2; }
.dashboard-grid { margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.dashboard-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 12px 16px; color: #8490a5; background: var(--surface-soft); text-align: left; text-transform: uppercase; font-size: 10px; letter-spacing: .06em; }
td { padding: 13px 16px; border-top: 1px solid var(--border); color: #4d596e; font-size: 13px; }
tbody tr:hover { background: #fbfcff; }
.entity-cell { display: flex; flex-direction: column; color: var(--text); }
.entity-cell b { font-size: 13px; }
.entity-cell span { max-width: 280px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.table-note { display: block; color: var(--muted); }
.person { display: flex; align-items: center; gap: 8px; }
.badge { max-width: 210px; padding: 5px 9px; display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; color: #536079; background: #edf1f7; font-size: 11px; font-weight: 700; white-space: normal; }
.status-advertising, .status-active, .status-showing, .status-registration, .status-in_progress { color: #1c5bc1; background: #eaf2ff; }
.status-closed, .status-completed, .status-quality { color: #11724f; background: #e6f7f0; }
.status-refused, .status-overdue { color: #b5394c; background: #ffebee; }
.status-deposit, .status-negotiation, .status-settlement { color: #97620d; background: #fff3d9; }
.status-lead, .status-contract, .status-draft, .status-new { color: #6845c2; background: #f0ebff; }
.status-archive, .status-archived, .status-paused, .status-postponed { color: #657087; background: #edf0f5; }
.task-stack { padding: 7px 20px 13px; }
.mini-task { padding: 12px 0; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.mini-task:last-child { border: 0; }
.mini-task.overdue .task-kind { color: var(--danger); background: #ffedf0; }
.task-kind { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--primary); background: #edf3ff; font-weight: 800; }
.mini-task > div { min-width: 0; display: flex; flex-direction: column; }
.mini-task a { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.mini-task small { color: var(--muted); }
.card-footer-link { padding: 14px 20px; display: block; border-top: 1px solid var(--border); font-weight: 700; font-size: 12px; }
.funnel-list { padding: 15px 20px 20px; }
.funnel-list > div { margin-bottom: 13px; display: grid; grid-template-columns: 160px 1fr 100px; align-items: center; gap: 10px; font-size: 12px; }
.funnel-list b { text-align: right; }
.bar { height: 7px; overflow: hidden; border-radius: 5px; background: #edf0f5; }
.bar i { height: 100%; display: block; border-radius: 5px; background: var(--primary); }
.funnel-list.green .bar i { background: var(--success); }
.summary-chips { margin: -8px 0 14px; display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.summary-chips a { flex: 0 0 auto; padding: 7px 11px; color: #69768d; background: #fff; border: 1px solid var(--border); border-radius: 20px; font-size: 11px; font-weight: 700; }
.summary-chips a.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.summary-chips a.danger-tab { background: var(--danger); border-color: var(--danger); }
.filters { margin-bottom: 16px; padding: 14px; display: grid; grid-template-columns: minmax(250px, 2fr) repeat(5, minmax(120px, 1fr)) auto auto; gap: 9px; align-items: center; }
.filters.compact-filters { grid-template-columns: minmax(260px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) auto auto; }
.filters input, .filters select, .form-control, .comment-form textarea, .upload-form input { width: 100%; min-height: 40px; padding: 8px 11px; color: var(--text); background: #fff; border: 1px solid #dce2ec; border-radius: 8px; outline: none; }
.filters input:focus, .filters select:focus, .form-control:focus, .comment-form textarea:focus { border-color: #7ba1ed; box-shadow: 0 0 0 3px rgba(39,100,231,.08); }
.filter-search { display: flex; align-items: center; padding-left: 10px; border: 1px solid #dce2ec; border-radius: 8px; }
.filter-search span { color: #96a2b6; }
.filter-search input { border: 0; }
.table-card { overflow: hidden; }
.table-toolbar { min-height: 50px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); border-bottom: 1px solid var(--border); font-size: 12px; }
.row-action { padding: 7px; color: #8d98ac; font-weight: 800; letter-spacing: 1px; }
.relation-count { display: inline-flex; padding: 3px 6px; border-radius: 6px; color: #5d6a81; background: #f0f3f8; font-size: 11px; }
.empty-state { padding: 44px 20px; text-align: center; white-space: normal; }
.empty-icon { width: 44px; height: 44px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; color: #8896ad; background: #edf1f7; font-size: 22px; }
.empty-state h3 { margin-bottom: 5px; }
.empty-state p, .muted { color: var(--muted); }
.form-card { max-width: 850px; padding: 24px; }
.form-card.form-wide { max-width: 1150px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.form-field { min-width: 0; }
.form-field > label { margin-bottom: 6px; display: block; color: #566278; font-size: 12px; font-weight: 700; }
.form-field .form-check-input { width: auto; min-height: auto; }
.form-field ul { margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; }
.form-field ul label { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.form-field select[multiple] { min-height: 170px; }
.form-field textarea { resize: vertical; }
.span-2 { grid-column: span 2; }
.required, .field-error, .danger-text { color: var(--danger); }
.help { color: var(--muted); }
.field-error { display: block; margin-top: 4px; }
.form-actions { margin-top: 24px; padding-top: 18px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.detail-main { min-width: 0; display: grid; gap: 18px; }
.detail-aside { position: sticky; top: 95px; display: grid; gap: 14px; }
.object-hero { overflow: hidden; display: grid; grid-template-columns: 300px 1fr; }
.object-gallery { min-height: 240px; background: #e9eef7; }
.object-gallery img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { height: 100%; min-height: 240px; display: grid; place-content: center; text-align: center; color: #7e8aa0; }
.photo-placeholder span { font-size: 38px; }
.photo-placeholder p { margin: 8px 0 0; font-weight: 700; }
.object-summary { padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.object-summary h2 { max-width: 650px; margin: 8px 0; font-size: 24px; }
.object-price { margin-bottom: 22px; color: var(--primary); font-size: 30px; letter-spacing: -.03em; }
.quick-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick-specs div { padding: 10px; background: var(--surface-soft); border-radius: 9px; }
.quick-specs small, .quick-specs b { display: block; }
.quick-specs small { color: var(--muted); }
.detail-section { padding: 22px; }
.section-title { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title h2 { margin: 0; }
.section-title > span { padding: 3px 8px; color: var(--muted); background: #eef1f6; border-radius: 12px; font-size: 11px; font-weight: 800; }
.details-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.details-grid > div { min-height: 54px; padding: 10px 0; display: grid; grid-template-columns: minmax(110px, 1fr) minmax(120px, 1.2fr); gap: 12px; align-items: center; border-bottom: 1px solid var(--border); }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 0; color: var(--text); font-weight: 700; }
.description-block { margin-top: 20px; padding: 16px; background: var(--surface-soft); border-radius: 10px; }
.description-block h3 { margin-bottom: 8px; }
.description-block p { margin: 0; color: #566278; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { padding: 5px 9px; color: #58667d; background: #eef2f7; border-radius: 7px; font-size: 11px; font-weight: 700; }
.tag.success { color: #12734f; background: #e3f7ef; }
.tag.warning { color: #9b650b; background: #fff3d5; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.related-grid h3 { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .08em; }
.related-item { min-height: 43px; padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #3b4961; border-bottom: 1px solid var(--border); font-size: 12px; }
.related-item b { color: var(--muted); font-size: 10px; }
.aside-card { padding: 18px; }
.aside-card h3 { margin-bottom: 14px; }
.agent-card { display: flex; align-items: center; gap: 10px; }
.agent-card > div { min-width: 0; display: flex; flex-direction: column; }
.agent-card small { color: var(--muted); }
.owner-card { display: flex; flex-direction: column; color: var(--text); }
.owner-card span { margin: 4px 0; color: var(--primary); }
.owner-card small { color: var(--muted); }
.metadata p { margin-bottom: 9px; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.metadata p:last-child { margin: 0; }
.metadata span { color: var(--muted); }
.document-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.document-list > a { padding: 10px; display: flex; align-items: center; gap: 10px; color: var(--text); background: var(--surface-soft); border-radius: 8px; }
.document-list > a > span { color: var(--primary); font-size: 20px; }
.document-list div { display: flex; flex-direction: column; }
.document-list small { color: var(--muted); }
.upload-form { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.photo-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.photo-strip figure { margin: 0; overflow: hidden; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; }
.photo-strip img { width: 100%; height: 120px; display: block; object-fit: cover; }
.photo-strip figcaption { padding: 7px 9px; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.upload-form.photo-upload { grid-template-columns: 1.2fr 1fr 90px auto; }
.comment-form { margin-bottom: 20px; display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; }
.timeline { display: grid; gap: 14px; }
.timeline-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.timeline-item p { margin: 4px 0 0; color: #59667b; font-size: 13px; }
.timeline-meta { display: flex; justify-content: space-between; gap: 10px; }
.timeline-meta time { color: var(--muted); font-size: 10px; }
.timeline.compact .timeline-item { grid-template-columns: 12px 1fr; }
.history-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #80a4ea; }
.contact-hero { margin-bottom: 22px; display: flex; align-items: center; gap: 15px; }
.contact-hero h2 { margin-bottom: 5px; font-size: 24px; }
.contact-hero > div { display: flex; flex-direction: column; }
.object-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.object-mini-card { padding: 14px; display: flex; gap: 12px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
.object-mini-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); background: #e8f0ff; border-radius: 10px; font-size: 20px; }
.object-mini-card h3 { margin: 2px 0; }
.object-mini-card p { margin: 0; color: var(--muted); font-size: 11px; }
.object-mini-card strong { display: block; margin-top: 5px; color: var(--primary); }
.kanban { width: 100%; padding-bottom: 15px; display: flex; gap: 14px; overflow-x: auto; }
.kanban-column { width: 290px; min-width: 290px; align-self: flex-start; overflow: hidden; background: #eef1f6; border: 1px solid #e1e5ee; border-radius: 12px; }
.kanban-column > header { min-height: 61px; padding: 12px 13px; display: flex; align-items: center; gap: 8px; background: #fff; border-bottom: 1px solid var(--border); }
.kanban-column header > div { flex: 1; }
.kanban-column h2 { flex: 1; margin: 0; font-size: 13px; }
.kanban-column header small { color: var(--muted); }
.kanban-column header > b { width: 26px; height: 26px; display: grid; place-items: center; color: var(--muted); background: #edf0f5; border-radius: 50%; font-size: 11px; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.stage-refused { background: var(--danger); }
.stage-closed, .stage-quality { background: var(--success); }
.stage-deposit, .stage-settlement, .stage-negotiation { background: var(--warning); }
.stage-postponed, .stage-archive { background: #8e98ab; }
.kanban-stack { max-height: calc(100vh - 245px); padding: 10px; overflow-y: auto; }
.kanban-card { margin-bottom: 9px; padding: 13px; display: block; color: var(--text); background: #fff; border: 1px solid #e2e6ee; border-radius: 9px; box-shadow: 0 3px 9px rgba(30,47,79,.04); }
.kanban-card:hover { border-color: #a9c1ef; }
.kanban-card > small { color: var(--primary); font-weight: 800; }
.kanban-card h3 { margin: 5px 0; }
.kanban-card p { margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.kanban-meta { padding-top: 9px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); color: #637088; font-size: 10px; }
.kanban-money { margin: 9px 0; display: flex; justify-content: space-between; font-size: 11px; }
.kanban-empty { padding: 20px 8px; color: #98a2b3; text-align: center; font-size: 11px; }
.deal-finance { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; }
.deal-finance > div { padding: 18px; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.deal-finance > div:last-child { border: 0; }
.deal-finance small { color: var(--muted); }
.deal-finance strong { margin-top: 4px; font-size: 16px; }
.deal-finance .positive strong { color: var(--success); }
.task-check { width: 23px; height: 23px; padding: 0; display: grid; place-items: center; color: #fff; background: #fff; border: 2px solid #c9d1df; border-radius: 6px; }
.task-check.done { background: var(--success); border-color: var(--success); }
.row-overdue { background: #fffafb; }
.task-type { padding: 5px 8px; border-radius: 7px; color: #4d5e78; background: #eef2f7; font-size: 10px; font-weight: 800; }
.type-call { color: #205dbb; background: #e7f0ff; }
.type-meeting { color: #6c45c3; background: #f0eaff; }
.type-showing { color: #9c6507; background: #fff2d4; }
.calendar-toolbar { margin-bottom: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.calendar-toolbar h2 { min-width: 180px; margin: 0; text-align: center; }
.icon-button.bordered { color: #657289; border: 1px solid var(--border); }
.calendar { overflow: hidden; }
.calendar-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-soft); border-bottom: 1px solid var(--border); }
.calendar-head div { padding: 10px; color: var(--muted); text-align: center; text-transform: uppercase; font-size: 10px; font-weight: 800; }
.calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.calendar-week:last-child { border-bottom: 0; }
.calendar-day { min-width: 0; min-height: 125px; padding: 8px; border-right: 1px solid var(--border); }
.calendar-day:last-child { border: 0; }
.calendar-day.outside { background: #fafbfc; }
.calendar-day.outside .day-number { color: #b7bfcc; }
.day-number { width: 26px; height: 26px; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.calendar-day.today .day-number { color: #fff; background: var(--primary); border-radius: 50%; }
.day-tasks { display: grid; gap: 4px; }
.calendar-task { min-width: 0; padding: 4px 5px; display: flex; gap: 5px; color: #315da9; background: #edf3ff; border-left: 3px solid #5686e3; border-radius: 4px; font-size: 9px; }
.calendar-task.kind-meeting { color: #6843b6; background: #f2edff; border-color: #8765d1; }
.calendar-task.kind-showing { color: #94600d; background: #fff4dd; border-color: #eab44e; }
.calendar-task.overdue { color: #a53245; background: #ffedf0; border-color: var(--danger); }
.calendar-task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stats-list { padding: 14px 20px; }
.stats-list > div { min-height: 45px; display: grid; grid-template-columns: 1fr 50px 130px; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); font-size: 12px; }
.stats-list > div:last-child { border: 0; }
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.team-card { padding: 22px; text-align: center; }
.team-card .avatar { margin: 0 auto 12px; }
.team-card h2 { margin-bottom: 5px; }
.team-card > p { margin: 10px 0 18px; color: var(--muted); }
.team-card dl { margin: 0; text-align: left; }
.team-card dl div { padding: 8px 0; display: flex; justify-content: space-between; border-top: 1px solid var(--border); }
.team-card dd { max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.team-stats { margin: 18px -22px -22px; padding: 14px; display: flex; justify-content: space-around; background: var(--surface-soft); border-radius: 0 0 var(--radius) var(--radius); color: var(--muted); font-size: 11px; }
.team-stats b { color: var(--text); }
.notice-strip { margin-bottom: 24px; padding: 13px 16px; color: #43516b; background: #eef4ff; border: 1px solid #d6e3fb; border-radius: 10px; font-size: 13px; }
.notice-strip code, .credential-row code { color: #2458ad; background: #fff; border: 1px solid #dce5f5; border-radius: 5px; padding: 2px 5px; }
.integration-section { margin-bottom: 30px; }
.section-heading { margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.section-heading h2 { margin: 0; }
.section-heading > span { padding: 3px 8px; color: var(--muted); background: #e8ecf3; border-radius: 12px; font-size: 11px; font-weight: 800; }
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.integration-card { min-height: 210px; padding: 18px; display: grid; grid-template-columns: 42px 1fr; gap: 13px; }
.integration-logo { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #315fc5, #6a83dc); border-radius: 11px; font-weight: 900; font-size: 12px; }
.integration-body { min-width: 0; }
.integration-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.integration-title h3 { margin: 3px 0 8px; font-size: 15px; }
.integration-body p { min-height: 40px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.integration-actions { grid-column: span 2; display: flex; justify-content: flex-end; gap: 7px; align-self: end; border-top: 1px solid var(--border); padding-top: 12px; }
.state-dot { flex: 0 0 auto; padding: 4px 7px; color: #79849a; background: #edf0f5; border-radius: 12px; font-size: 9px; font-weight: 800; }
.state-dot.configured { color: #91600f; background: #fff2d9; }
.state-dot.enabled { color: #11724f; background: #e4f7ef; }
.integration-setup-layout { grid-template-columns: minmax(0, 900px) 310px; }
.credential-row { padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; border-bottom: 1px solid var(--border); font-size: 11px; }
.credential-row span { color: var(--muted); }
.integration-metrics .metric-card { min-height: 110px; }
.endpoint-label { margin: 12px 0 6px; display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.endpoint-box { min-height: 44px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; background: #f5f7fb; border: 1px solid var(--border); border-radius: 8px; }
.endpoint-box code { flex: 1; overflow-wrap: anywhere; color: #34425b; font-size: 11px; }
.endpoint-help { margin: 12px 0 0; }
.compact-details { gap: 0 18px; }
.integration-table { margin-top: 18px; }
.status-success, .status-published, .status-approved { color: #11724f; background: #e6f7f0; }
.status-failed, .status-error, .status-rejected { color: #b5394c; background: #ffebee; }
.status-running, .status-pending, .status-waiting { color: #97620d; background: #fff3d9; }
.code-block { margin: 0; padding: 15px; overflow-x: auto; color: #d9e5ff; background: #18243d; border-radius: 9px; font: 12px/1.65 Consolas, "Courier New", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.disk-upload { margin-bottom: 16px; padding: 16px; display: grid; grid-template-columns: 1.2fr repeat(3, minmax(130px, 1fr)) auto; gap: 10px; align-items: end; }
.disk-upload .form-field:nth-of-type(n+5) { display: none; }
.upload-heading { align-self: center; display: flex; flex-direction: column; }
.upload-heading small { color: var(--muted); }
.file-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.file-card { min-height: 150px; padding: 17px; display: flex; gap: 13px; color: var(--text); }
.file-card:hover { border-color: #b5c8ec; }
.file-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); background: #eaf1ff; border-radius: 9px; font-size: 20px; }
.file-card h3 { margin: 2px 0 6px; }
.file-card p { min-height: 38px; margin: 0; color: var(--muted); font-size: 11px; }
.file-meta { margin-top: 13px; padding-top: 9px; display: flex; justify-content: space-between; gap: 8px; color: #8792a5; border-top: 1px solid var(--border); font-size: 9px; }
.empty-wide { grid-column: 1 / -1; }
.inline-create-form { margin-bottom: 20px; padding: 16px; display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr 1.2fr auto; gap: 10px; align-items: end; }
.total-pill { min-width: 170px; padding: 11px 16px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.total-pill small { color: var(--muted); }
.total-pill b { color: var(--primary); font-size: 18px; }
.call-incoming { color: #11724f; background: #e6f7f0; }
.call-outgoing { color: #1c5bc1; background: #eaf2ff; }
.call-missed { color: #b5394c; background: #ffebee; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.archive-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--primary); background: #edf3ff; border-radius: 10px; font-size: 19px; }
.archive-list { padding: 7px 20px 17px; }
.archive-list > a { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); border-bottom: 1px solid var(--border); }
.archive-list > a > span:first-child { min-width: 0; display: flex; flex-direction: column; }
.archive-list small { overflow: hidden; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.knowledge-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.knowledge-row > a { min-height: 64px; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--text); }
.knowledge-row > a > span:first-child { min-width: 0; display: flex; flex-direction: column; }
.knowledge-row form { margin: 0; }
.api-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.api-main { overflow: hidden; }
.api-section { padding: 22px; border-bottom: 1px solid var(--border); }
.api-section:last-child { border: 0; }
.api-section h2 { margin-bottom: 13px; }
.method-row { margin-bottom: 9px; padding: 9px 11px; display: grid; grid-template-columns: 52px minmax(190px, 1fr) 1fr; gap: 10px; align-items: center; background: #f7f9fc; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.method-row > span:last-child { color: var(--muted); }
.http-method { padding: 3px 5px; color: #fff; border-radius: 5px; text-align: center; font-size: 9px; font-weight: 900; }
.http-method.get { background: var(--success); }
.http-method.post { background: var(--primary); }
.api-sidebar { position: sticky; top: 95px; display: grid; gap: 15px; }
.check-list { display: grid; gap: 9px; color: #40506a; font-size: 12px; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 18px; }
.calculator-form { padding: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.calculator-form .btn { grid-column: span 2; }
.calculator-result { padding: 28px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, #fff, #f2f6ff); }
.calculator-result > div:first-child { display: flex; flex-direction: column; }
.calculator-result > div:first-child small { color: var(--muted); }
.calculator-result > div:first-child strong { margin: 5px 0 22px; color: var(--primary); font-size: 32px; }
.calculator-result dl { margin: 0; }
.calculator-result dl > div { padding: 10px 0; display: flex; justify-content: space-between; border-top: 1px solid var(--border); }
.calculator-result.empty-result { align-items: center; text-align: center; }
.calculator-symbol { width: 62px; height: 62px; margin-bottom: 15px; display: grid; place-items: center; color: var(--primary); background: #e8f0ff; border-radius: 18px; font-size: 28px; font-weight: 800; }
.calculator-help { margin-top: 13px; }
.learning-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.learning-card { padding: 20px; }
.learning-card > span { width: 35px; height: 35px; margin-bottom: 14px; display: grid; place-items: center; color: var(--primary); background: #eaf1ff; border-radius: 9px; font-size: 11px; font-weight: 900; }
.learning-card h2 { margin-bottom: 8px; }
.learning-card p { min-height: 64px; color: var(--muted); font-size: 12px; }
.learning-card a { font-size: 12px; font-weight: 800; }
.training-materials { margin-top: 18px; }
.chat-layout { max-width: 1050px; margin: 0 auto; overflow: hidden; }
.chat-stream { height: calc(100vh - 315px); min-height: 380px; padding: 24px; overflow-y: auto; background: #f7f9fc; }
.chat-message { margin-bottom: 14px; display: flex; gap: 10px; }
.chat-message > div { max-width: 72%; padding: 10px 13px; background: #fff; border: 1px solid var(--border); border-radius: 4px 12px 12px 12px; box-shadow: 0 3px 8px rgba(34,50,78,.04); }
.chat-message.own { flex-direction: row-reverse; }
.chat-message.own > div { background: #eaf2ff; border-color: #ccdcf8; border-radius: 12px 4px 12px 12px; }
.chat-meta { margin-bottom: 5px; display: flex; align-items: center; gap: 7px; font-size: 10px; }
.chat-meta span, .chat-meta time { color: var(--muted); }
.chat-meta time { margin-left: auto; }
.chat-message p { margin: 0; color: #3d4a61; font-size: 13px; }
.chat-compose { padding: 14px; display: grid; grid-template-columns: 190px 1fr auto; gap: 10px; align-items: end; border-top: 1px solid var(--border); }
.chat-compose textarea { min-height: 62px; resize: none; }
.notification-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.notification-card { overflow: hidden; }
.notification-list { padding: 7px 20px 17px; }
.notification-list > a { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); border-bottom: 1px solid var(--border); }
.notification-list > a > span { min-width: 0; display: flex; flex-direction: column; }
.notification-list small { overflow: hidden; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.notification-list time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.login-body { min-height: 100vh; background: #fff; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-promo { display: grid; place-items: center; padding: 60px; color: #fff; background: radial-gradient(circle at 18% 20%, #355ea9 0, transparent 34%), linear-gradient(145deg, #17223b, #20375f); }
.promo-inner { max-width: 590px; }
.brand-light { padding: 0; color: #fff; }
.brand-light small { color: #9aabd0; }
.login-promo h1 { max-width: 560px; margin: 80px 0 20px; font-size: 48px; line-height: 1.05; }
.login-promo > div > p { max-width: 520px; color: #b9c6df; font-size: 18px; }
.promo-grid { margin-top: 50px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.promo-grid > div { padding: 15px; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; }
.promo-grid b { width: 32px; height: 32px; display: grid; place-items: center; color: #98b8ff; background: rgba(95,140,235,.13); border-radius: 8px; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 390px; }
.login-card h2 { margin-bottom: 5px; font-size: 27px; }
.login-card > p { margin-bottom: 30px; color: var(--muted); }
.login-card label { margin: 15px 0 6px; display: block; color: #536078; font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; height: 46px; padding: 9px 12px; border: 1px solid #d8deea; border-radius: 9px; outline: 0; }
.login-card input:focus { border-color: #7199e8; box-shadow: 0 0 0 3px rgba(39,100,231,.08); }
.login-card .btn { width: 100%; margin-top: 22px; }
.login-hint { margin-top: 20px; display: block; color: var(--muted); text-align: center; }
.login-brand-mobile { display: none; }
@media (max-width: 1280px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)); }
    .filters .btn { min-width: 110px; }
    .deal-finance { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .deal-finance > div:nth-child(3) { border-right: 0; }
    .deal-finance > div:nth-child(n+4) { border-top: 1px solid var(--border); }
    .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .disk-upload, .inline-create-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .learning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .menu-open .sidebar { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .mobile-menu { display: block; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-aside { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-layout { grid-template-columns: 1fr; }
    .login-promo { display: none; }
    .login-brand-mobile { margin-bottom: 35px; display: flex; align-items: center; gap: 10px; }
    .dashboard-grid, .dashboard-grid.two { grid-template-columns: 1fr; }
    .api-layout, .integration-setup-layout { grid-template-columns: 1fr; }
    .api-sidebar { position: static; }
    .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calculator-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    html { font-size: 14px; }
    .page { padding: 18px 12px; }
    .topbar { height: 64px; padding: 0 12px; }
    .global-search { display: none; }
    .top-actions { margin-left: auto; }
    .quick-icon { display: none; }
    .page-header { flex-direction: column; }
    .page-header .btn, .header-actions { width: 100%; }
    .header-actions .btn { flex: 1; }
    h1 { font-size: 26px; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 105px; }
    .filters, .filters.compact-filters { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .form-field ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .object-hero { grid-template-columns: 1fr; }
    .object-gallery { min-height: 180px; }
    .quick-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .details-grid, .related-grid, .object-card-grid { grid-template-columns: 1fr; }
    .details-grid > div { grid-template-columns: 1fr 1fr; }
    .detail-aside { grid-template-columns: 1fr; }
    .document-list, .upload-form, .upload-form.photo-upload { grid-template-columns: 1fr; }
    .photo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .deal-finance { grid-template-columns: 1fr 1fr; }
    .deal-finance > div { border-bottom: 1px solid var(--border); }
    .calendar { overflow-x: auto; }
    .calendar-head, .calendar-week { min-width: 770px; }
    .team-grid { grid-template-columns: 1fr; }
    .login-panel { padding: 24px; }
    .integration-grid, .file-grid, .archive-grid { grid-template-columns: 1fr; }
    .disk-upload, .inline-create-form { grid-template-columns: 1fr; }
    .method-row { grid-template-columns: 48px 1fr; }
    .method-row > span:last-child { grid-column: 2; }
    .learning-grid, .notification-grid { grid-template-columns: 1fr; }
    .calculator-form, .chat-compose { grid-template-columns: 1fr; }
    .calculator-form .btn { grid-column: span 1; }
    .chat-message > div { max-width: 88%; }
}

/* РиэлтПро interface v2 */
:root {
    --sidebar-width: 176px;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8faff;
    --border: #e6ebf3;
    --text: #121a2b;
    --muted: #71809a;
    --primary: #1769f5;
    --primary-dark: #0757dd;
    --shadow: 0 8px 28px rgba(34, 62, 110, .07);
}
[data-theme="dark"] {
    --bg: #0e1420;
    --surface: #151d2b;
    --surface-soft: #111927;
    --border: #263247;
    --text: #ecf2ff;
    --muted: #91a0ba;
    --primary: #4c8dff;
    --primary-dark: #377af0;
    --shadow: 0 8px 30px rgba(0, 0, 0, .24);
    color-scheme: dark;
}
body { background: var(--bg); color: var(--text); }
.sidebar { width: var(--sidebar-width); color: var(--text); background: var(--surface); border-right: 1px solid var(--border); box-shadow: 8px 0 24px rgba(36, 64, 109, .035); }
.brand { min-height: 94px; padding: 14px 15px; justify-content: center; border-bottom: 1px solid var(--border) !important; overflow: hidden; }
.brand-logo { width: 145px; height: 58px; display: block; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(20, 94, 181, .16)); }
.side-nav { padding: 12px 11px; scrollbar-width: thin; scrollbar-color: #2f73ee transparent; }
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav::-webkit-scrollbar-thumb { background: #2f73ee; border-radius: 8px; }
.side-nav::-webkit-scrollbar-thumb:hover { background: #175cd3; }
.primary-nav { display: grid; gap: 3px; }
.side-nav a, .nav-more summary { min-height: 42px; margin: 0; padding: 9px 10px; color: #45536b; border-radius: 8px; font-size: 12px; font-weight: 700; }
[data-theme="dark"] .side-nav a, [data-theme="dark"] .nav-more summary { color: #aebbd2; }
.side-nav a:hover, .nav-more summary:hover { color: var(--primary); background: #f2f6ff; }
[data-theme="dark"] .side-nav a:hover, [data-theme="dark"] .nav-more summary:hover { background: #1c2940; }
.side-nav a.active { color: var(--primary); background: linear-gradient(90deg, #edf4ff, #f7faff); box-shadow: inset 2px 0 0 var(--primary); }
[data-theme="dark"] .side-nav a.active { color: #72a4ff; background: linear-gradient(90deg, #1c3152, #192438); }
.nav-icon { width: 21px; color: #3f5e8c; font-size: 16px; font-style: normal; }
.side-nav a.active .nav-icon { color: var(--primary); }
.nav-count { padding: 2px 6px; color: #4c74b6; background: #eaf1fc; font-size: 9px; }
.nav-more { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.nav-more summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary span { display: flex; align-items: center; gap: 7px; }
.nav-more summary > b { transition: transform .2s ease; }
.nav-more[open] summary > b { transform: rotate(180deg); }
.extra-nav-list { padding: 4px 0 8px 7px; display: grid; gap: 1px; border-left: 1px dashed #d7dfeb; }
.extra-nav-list a { min-height: 36px; padding: 7px 8px; font-size: 11px; }
.sidebar-cta { margin: 14px 7px !important; min-height: 43px !important; color: #fff !important; background: var(--primary) !important; box-shadow: 0 8px 18px rgba(23, 105, 245, .22); }
.sidebar-bottom { border-top: 1px solid var(--border); }
.sidebar-settings { margin: 8px 10px 0 !important; min-height: 35px !important; color: var(--muted) !important; font-size: 11px !important; }
.sidebar-user { min-height: 68px; padding: 10px 12px; border-top: 0; }
.user-meta strong { color: var(--text); }
.user-meta small { color: var(--muted); }
.icon-button { color: var(--muted); }
.icon-button:hover { color: var(--primary); background: var(--surface-soft); }
.main-area { margin-left: var(--sidebar-width); }
.topbar { height: 78px; padding: 0 22px; background: color-mix(in srgb, var(--surface) 96%, transparent); border-bottom-color: var(--border); }
.global-search { max-width: 500px; margin-left: auto; background: var(--surface); border-color: var(--border); box-shadow: 0 6px 20px rgba(38, 59, 94, .055); }
.global-search input { color: var(--text); }
.global-search kbd { padding: 3px 6px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 5px; font-size: 9px; }
.top-actions { margin-left: 12px; }
.assistant-top-button { min-height: 38px; padding: 8px 12px; display: inline-flex; align-items: center; gap: 7px; color: #fff; background: linear-gradient(135deg, #256ff0, #6245d9); border-radius: 9px; font-size: 11px; box-shadow: 0 6px 15px rgba(45, 83, 195, .2); }
.assistant-top-button:hover { color: #fff; transform: translateY(-1px); }
.assistant-top-button span { font-size: 16px; }
.quick-icon { background: var(--surface); border-color: var(--border); }
.theme-dark-icon { display: none; }
[data-theme="dark"] .theme-light-icon { display: none; }
[data-theme="dark"] .theme-dark-icon { display: inline; }
.top-notification { position: relative; }
.top-notification i { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; color: #fff; background: #f04452; border: 2px solid var(--surface); border-radius: 12px; font-size: 8px; font-style: normal; }
.top-user { padding-left: 8px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.top-user > span:nth-child(2) { min-width: 105px; display: flex; flex-direction: column; }
.top-user small { color: var(--muted); font-size: 9px; }
.top-user > i { color: var(--muted); font-style: normal; }
.page { max-width: 1760px; padding: 22px; }
.card, .metric-card { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.desktop-dashboard-head { min-height: 67px; margin-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.desktop-dashboard-head h1 { margin-bottom: 4px; font-size: 25px; }
.desktop-dashboard-head p { margin-bottom: 0; color: var(--muted); }
.dashboard-kpis { margin-bottom: 16px; gap: 12px; }
.dashboard-kpis .metric-card { min-height: 112px; padding: 16px; position: relative; }
.dashboard-kpis .metric-icon { width: 43px; height: 43px; }
.dashboard-kpis .metric-card strong { font-size: 23px; }
.dashboard-kpis .metric-card em b { color: var(--success); }
.metric-spark { position: absolute; right: 12px; bottom: 14px; color: var(--primary); font-size: 19px; font-style: normal; transform: rotate(-10deg); }
.dashboard-workspace { margin-bottom: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 13px; align-items: start; }
.deal-workboard { min-width: 0; overflow: hidden; }
.board-actions { display: flex; align-items: center; gap: 9px; font-size: 11px; }
.compact-deal-board { padding: 12px; display: grid; grid-template-columns: repeat(5, minmax(165px, 1fr)); gap: 10px; overflow-x: auto; }
.compact-deal-column { min-width: 165px; padding: 8px; background: #f3f7ff; border-radius: 10px; }
[data-theme="dark"] .compact-deal-column { background: #111a29; }
.compact-deal-column > header { margin-bottom: 7px; padding: 2px 3px; display: flex; justify-content: space-between; color: #1769f5; font-size: 10px; font-weight: 800; }
.compact-deal-column > header b { color: var(--muted); }
.stage-card-deposit { background: #fff8ea; }
.stage-card-registration { background: #f3f0ff; }
.stage-card-settlement { background: #ecfaf3; }
.stage-card-closed { background: #effaf5; }
[data-theme="dark"] .stage-card-deposit, [data-theme="dark"] .stage-card-registration, [data-theme="dark"] .stage-card-settlement, [data-theme="dark"] .stage-card-closed { background: #141e2d; }
.compact-deal-stack { display: grid; gap: 7px; }
.compact-deal-card { padding: 7px; display: grid; grid-template-columns: 1fr; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 3px 8px rgba(28, 47, 78, .04); }
.compact-deal-card:hover { border-color: #abc4f3; }
.compact-deal-photo { height: 60px; margin-bottom: 7px; overflow: hidden; display: grid; place-items: center; color: #7b91b5; background: #edf2f8; border-radius: 6px; font-size: 22px; }
.compact-deal-photo img { width: 100%; height: 100%; object-fit: cover; }
.compact-deal-card h3 { margin: 0 0 2px; font-size: 11px; }
.compact-deal-card p { min-height: 25px; margin: 0; color: var(--muted); font-size: 8px; }
.compact-deal-card strong { color: var(--text); font-size: 10px; }
.compact-deal-card footer { margin-top: 7px; padding-top: 6px; display: flex; align-items: center; gap: 5px; border-top: 1px solid var(--border); }
.compact-deal-card footer small { flex: 1; overflow: hidden; color: var(--muted); font-size: 7px; white-space: nowrap; text-overflow: ellipsis; }
.compact-deal-card footer i { color: var(--primary); font-style: normal; }
.compact-empty { padding: 20px 5px; color: var(--muted); text-align: center; font-size: 9px; }
.dashboard-rail { display: grid; gap: 12px; }
.dashboard-rail .card-header { min-height: 56px; padding: 13px 14px; }
.today-timeline { padding: 5px 14px 13px; }
.today-timeline > a { min-height: 47px; display: grid; grid-template-columns: 34px 7px 1fr; gap: 6px; align-items: start; color: var(--text); }
.today-timeline time { padding-top: 4px; font-size: 9px; font-weight: 800; }
.today-timeline i { width: 6px; height: 6px; margin-top: 6px; background: var(--primary); border-radius: 50%; }
.today-timeline i.type-call { background: #f0a128; }
.today-timeline i.type-meeting { background: #7b55db; }
.today-timeline span { min-width: 0; display: flex; flex-direction: column; }
.today-timeline b { font-size: 10px; }
.today-timeline small { overflow: hidden; color: var(--muted); font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.task-brief .task-stack { padding: 4px 14px 10px; }
.task-brief .mini-task { padding: 8px 0; }
.dashboard-lower { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .7fr); gap: 13px; }
.ai-promo-card { padding: 24px; display: flex; align-items: center; gap: 18px; overflow: hidden; position: relative; background: linear-gradient(135deg, var(--surface), #edf4ff); }
[data-theme="dark"] .ai-promo-card { background: linear-gradient(135deg, #151d2b, #182b4a); }
.ai-orb { width: 65px; height: 65px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2572f1, #7546df); border-radius: 22px; box-shadow: 0 12px 24px rgba(73, 82, 210, .25); font-size: 27px; }
.ai-promo-card h2 { margin-bottom: 5px; }
.ai-promo-card p:not(.eyebrow) { margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.mobile-bottom-nav { display: none; }

/* AI assistant */
.assistant-page { max-width: 1180px; min-height: calc(100vh - 122px); margin: 0 auto; display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 14px; }
.assistant-context { padding: 17px; display: flex; flex-direction: column; }
.assistant-brand { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: center; }
.assistant-brand img { width: 54px; height: 42px; object-fit: contain; }
.assistant-brand h1 { margin: 0; font-size: 17px; }
.assistant-brand p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.assistant-status { width: max-content; margin-top: 8px; padding: 3px 7px; color: #8b5d14; background: #fff2d9; border-radius: 10px; font-size: 9px; font-weight: 800; }
.assistant-status.online { color: #0d7a52; background: #e2f8ee; }
.assistant-summary-card { margin: 17px 0 12px; padding: 14px; background: linear-gradient(135deg, #edf4ff, #f7f9ff); border: 1px solid #dfe8fa; border-radius: 11px; }
[data-theme="dark"] .assistant-summary-card { background: #1a2942; border-color: #2a3e60; }
.assistant-summary-card > p { margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 800; }
.assistant-summary-card > div { display: grid; grid-template-columns: repeat(3, 1fr); }
.assistant-summary-card span { display: flex; flex-direction: column; text-align: center; border-right: 1px solid var(--border); }
.assistant-summary-card span:last-child { border: 0; }
.assistant-summary-card b { font-size: 19px; }
.assistant-summary-card small { color: var(--muted); font-size: 8px; }
.assistant-quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.assistant-quick-grid button, .assistant-quick-grid a, .assistant-mobile-actions button, .assistant-mobile-actions a { min-height: 52px; padding: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 4px 10px rgba(34, 55, 91, .05); font-size: 10px; font-weight: 700; }
.assistant-quick-grid span { color: var(--primary); font-size: 16px; }
.assistant-tips { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--border); }
.assistant-tips h3 { margin-bottom: 9px; }
.assistant-tips p { margin: 6px 0; color: var(--muted); font-size: 9px; }
.assistant-settings-link { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 10px; }
.assistant-chat { min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.assistant-mobile-head { min-height: 72px; padding: 10px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.assistant-mobile-head > a { display: none; }
.assistant-mobile-head img { width: 58px; height: 42px; object-fit: contain; }
.assistant-mobile-head > div { flex: 1; display: flex; flex-direction: column; }
.assistant-mobile-head small { color: var(--muted); font-size: 9px; }
.assistant-mobile-head button { color: var(--muted); background: none; border: 0; font-size: 20px; }
.assistant-mobile-actions { display: none; }
.assistant-messages { min-height: 420px; height: calc(100vh - 315px); padding: 20px; overflow-y: auto; background: var(--surface-soft); }
.assistant-message { margin-bottom: 14px; display: flex; align-items: flex-end; gap: 8px; }
.assistant-message > div { max-width: 78%; padding: 11px 13px 7px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 13px 13px 13px 4px; box-shadow: 0 4px 12px rgba(30, 49, 82, .05); }
.assistant-message.user { justify-content: flex-end; }
.assistant-message.user > div { color: #10305f; background: #dceaff; border-color: #c5dbfc; border-radius: 13px 13px 4px 13px; }
[data-theme="dark"] .assistant-message.user > div { color: #e8f1ff; background: #234371; border-color: #315887; }
.assistant-message.system > div { color: #9b3b4a; background: #fff0f2; border-color: #f7cbd2; }
.assistant-message p { margin: 0 0 4px; font-size: 12px; }
.assistant-message time { display: block; color: #92a0b4; text-align: right; font-size: 8px; }
.bot-avatar { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2976f4, #6a49dd); border-radius: 10px; font-size: 13px; }
.assistant-action-chips { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px; }
.assistant-action-chips span { padding: 3px 6px; color: #0e7750; background: #e5f8ef; border-radius: 6px; font-size: 8px; font-weight: 800; }
.assistant-typing { display: flex; gap: 8px; }
.assistant-typing > div { padding: 12px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.assistant-typing i { width: 5px; height: 5px; margin: 0 2px; display: inline-block; background: #8ba0c1; border-radius: 50%; animation: typingPulse 1s infinite alternate; }
.assistant-typing i:nth-child(2) { animation-delay: .2s; }.assistant-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typingPulse { to { opacity: .25; transform: translateY(-3px); } }
.assistant-disabled { padding: 8px 14px; display: flex; justify-content: center; gap: 8px; color: #9a6410; background: #fff4dc; font-size: 10px; }
.assistant-compose { padding: 11px 12px 5px; display: grid; grid-template-columns: 32px 1fr 78px 38px 38px; gap: 7px; align-items: end; border-top: 1px solid var(--border); background: var(--surface); }
.assistant-compose textarea { min-height: 40px; max-height: 110px; padding: 10px 12px; resize: none; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 20px; outline: 0; }
.assistant-compose select { height: 38px; padding: 0 5px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; font-size: 9px; }
.assistant-menu-dot, .assistant-mic, .assistant-send { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; }
.assistant-menu-dot { width: 32px; color: var(--primary); background: #edf4ff; }
.assistant-mic { color: #fff; background: #1769f5; }
.assistant-mic.recording { background: #ef4052; animation: micPulse .8s infinite alternate; }
@keyframes micPulse { to { box-shadow: 0 0 0 8px rgba(239, 64, 82, .15); } }
.assistant-send { color: #fff; background: #1769f5; font-size: 17px; }
.assistant-compose-options { padding: 0 15px 8px; display: flex; align-items: center; gap: 10px; color: var(--muted); background: var(--surface); font-size: 8px; }
.assistant-compose-options label { display: flex; gap: 4px; align-items: center; }
.assistant-compose-options span { flex: 1; }
.assistant-compose-options button { color: var(--muted); background: none; border: 0; font-size: 8px; }
.ai-settings-layout { display: grid; grid-template-columns: minmax(0, 900px) 300px; gap: 18px; align-items: start; }
.ai-settings-form { max-width: none; }
.settings-status { margin-bottom: 20px; padding: 12px 14px; display: flex; align-items: center; gap: 15px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; font-size: 11px; }
.settings-status .assistant-status { margin: 0; }
.success-text { color: var(--success); }
.ai-settings-aside { display: grid; gap: 13px; }
.login-logo-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.login-logo-wrap small { color: rgba(255, 255, 255, .78); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.login-logo { width: 220px; height: 82px; object-fit: contain; object-position: left center; }
.login-logo-mobile { width: 176px; height: 62px; object-position: center; }
.voice-welcome { position: fixed; z-index: 80; right: 22px; bottom: 22px; width: min(510px, calc(100vw - 32px)); padding: 14px; display: grid; grid-template-columns: 46px minmax(0, 1fr) 34px auto 26px; gap: 10px; align-items: center; color: var(--text); background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 50px rgba(27, 54, 99, .2); backdrop-filter: blur(18px); }
.voice-welcome[hidden] { display: none; }
.voice-welcome-orb { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #1769f5, #7046de); border-radius: 14px; box-shadow: 0 8px 20px rgba(36, 103, 235, .28); font-size: 18px; }
.voice-welcome b { font-size: 12px; }
.voice-welcome p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.voice-welcome button { color: var(--primary); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; }
.voice-welcome button:not(:last-child) { width: 34px; height: 34px; }
.voice-welcome a { padding: 9px 11px; color: #fff; background: var(--primary); border-radius: 9px; white-space: nowrap; font-size: 9px; font-weight: 800; }
.voice-welcome button:last-child { align-self: start; color: var(--muted); background: transparent; border: 0; font-size: 18px; }

/* dark surfaces */
[data-theme="dark"] th, [data-theme="dark"] .calendar-head, [data-theme="dark"] .funnel-list, [data-theme="dark"] .form-field ul { background: var(--surface-soft); }
[data-theme="dark"] td, [data-theme="dark"] .card-header, [data-theme="dark"] .table-toolbar, [data-theme="dark"] .mini-task, [data-theme="dark"] .details-grid > div, [data-theme="dark"] .related-item { border-color: var(--border); }
[data-theme="dark"] .filters input, [data-theme="dark"] .filters select, [data-theme="dark"] .form-control, [data-theme="dark"] .comment-form textarea, [data-theme="dark"] .upload-form input, [data-theme="dark"] select, [data-theme="dark"] input, [data-theme="dark"] textarea { color: var(--text); background: var(--surface-soft); border-color: var(--border); }
[data-theme="dark"] tbody tr:hover { background: #182335; }
[data-theme="dark"] .badge, [data-theme="dark"] .tag { color: #b9c7dc; background: #263349; }
[data-theme="dark"] .status-active, [data-theme="dark"] .status-in_progress, [data-theme="dark"] .status-advertising { color: #8db4ff; background: #1e3963; }
[data-theme="dark"] .status-closed, [data-theme="dark"] .status-completed, [data-theme="dark"] .status-success { color: #78d4ae; background: #173e35; }

@media (max-width: 1250px) {
    .top-user > span:nth-child(2), .assistant-top-button b { display: none; }
    .dashboard-workspace { grid-template-columns: 1fr; }
    .dashboard-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .compact-deal-board { grid-template-columns: repeat(5, 190px); }
}
@media (max-width: 980px) {
    .main-area { margin-left: 0; }
    .sidebar { width: 250px; transform: translateX(-100%); }
    .menu-open .sidebar { transform: translateX(0); }
    .brand-logo { width: 170px; }
    .topbar { height: 64px; padding: 0 12px; }
    .global-search { margin-left: 0; }
    .mobile-bottom-nav { position: fixed; z-index: 45; inset: auto 0 0; min-height: 66px; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--border); backdrop-filter: blur(16px); }
    .mobile-bottom-nav a, .mobile-bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); background: none; border: 0; font-size: 16px; }
    .mobile-bottom-nav b { font-size: 8px; }
    .mobile-bottom-nav .active { color: var(--primary); }
    .mobile-bottom-nav .mobile-ai span { width: 38px; height: 38px; margin-top: -23px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #1769f5, #7046de); border: 4px solid var(--surface); border-radius: 50%; box-shadow: 0 5px 14px rgba(40, 82, 196, .28); }
    .page { padding-bottom: 88px; }
    .assistant-page, .ai-settings-layout { grid-template-columns: 1fr; }
    .assistant-context { display: none; }
}
@media (max-width: 700px) {
    .topbar .assistant-top-button, .topbar .top-user, .topbar .theme-toggle { display: none; }
    .topbar .top-notification { display: grid; }
    .desktop-dashboard-head { min-height: auto; margin-bottom: 14px; }
    .desktop-dashboard-head h1 { font-size: 22px; }
    .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-kpis .metric-card { min-height: 104px; padding: 12px; gap: 9px; }
    .dashboard-kpis .metric-icon { width: 38px; height: 38px; }
    .dashboard-kpis .metric-card strong { font-size: 19px; }
    .metric-spark { display: none; }
    .dashboard-rail, .dashboard-lower { grid-template-columns: 1fr; }
    .compact-deal-board { grid-template-columns: repeat(5, 170px); }
    .ai-promo-card { padding: 18px; }
    .ai-orb { width: 50px; height: 50px; border-radius: 16px; }
    .page-assistant_home .topbar, .page-assistant_home .mobile-bottom-nav { display: none; }
    .page-assistant_home .page { padding: 0; }
    .page-assistant_home .main-area { min-height: 100dvh; }
    .assistant-page { min-height: 100dvh; display: block; }
    .assistant-chat { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
    .assistant-mobile-head { min-height: 70px; padding-top: max(10px, env(safe-area-inset-top)); }
    .assistant-mobile-head > a { display: block; color: var(--muted); font-size: 18px; }
    .assistant-mobile-head img { width: 52px; }
    .assistant-mobile-actions { padding: 9px 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--border); }
    .assistant-mobile-actions button, .assistant-mobile-actions a { min-height: 39px; padding: 5px; white-space: nowrap; font-size: 8px; }
    .assistant-messages { min-height: 0; height: calc(100dvh - 212px - env(safe-area-inset-bottom)); padding: 14px 12px; }
    .assistant-message > div { max-width: 88%; }
    .assistant-compose { padding: 8px 8px 4px; grid-template-columns: 30px minmax(0, 1fr) 62px 36px 36px; }
    .assistant-compose select { position: static; width: 62px; padding: 0 3px; opacity: 1; pointer-events: auto; }
    .assistant-menu-dot { width: 30px; }
    .assistant-compose-options { padding: 0 10px calc(6px + env(safe-area-inset-bottom)); }
    .assistant-compose-options form { display: none; }
    .assistant-disabled { flex-wrap: wrap; }
    .ai-settings-layout { grid-template-columns: 1fr; }
    .voice-welcome { right: 10px; bottom: calc(78px + env(safe-area-inset-bottom)); width: calc(100vw - 20px); grid-template-columns: 40px minmax(0, 1fr) 32px 24px; }
    .voice-welcome-orb { width: 40px; height: 40px; }
    .voice-welcome a { grid-column: 2 / 4; text-align: center; }
}

/* Login hero and glass dialog */
.login-hero-body { min-height: 100dvh; overflow: hidden; color: #fff; background: #020a16; }
.login-hero { min-height: 100dvh; position: relative; overflow: hidden; isolation: isolate; background: #020a16; }
.login-hero::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 8, 20, .04), transparent 40%, rgba(0, 8, 20, .03)); }
.login-hero-image { width: 100%; height: 100dvh; display: block; object-fit: cover; object-position: center; user-select: none; }
.login-accessible-title { width: 1px; height: 1px; padding: 0; overflow: hidden; position: absolute; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.login-hero-trigger { width: clamp(320px, 23%, 440px); min-height: clamp(62px, 8.3vh, 82px); padding: 9px clamp(14px, 1.4vw, 24px); overflow: hidden; position: absolute; z-index: 2; left: 11.1%; top: 78.7%; display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 8px; color: #f2f7ff; background: linear-gradient(110deg, rgba(8, 31, 65, .94), rgba(9, 28, 57, .88)); border: 2px solid #5dcfff; border-radius: clamp(12px, .85vw, 16px); box-shadow: 0 0 12px rgba(52, 191, 255, .5), inset 0 0 22px rgba(42, 167, 255, .12); cursor: pointer; font-family: inherit; font-size: clamp(23px, 1.65vw, 31px); font-weight: 700; letter-spacing: .01em; line-height: 1.1; text-align: center; white-space: nowrap; transition: border-color .22s ease, box-shadow .22s ease, background .22s ease; }
.login-hero-trigger:hover { transform: none; background: linear-gradient(110deg, rgba(9, 48, 95, .97), rgba(10, 33, 69, .91)); border-color: transparent; box-shadow: inset 0 0 0 2px rgba(93, 207, 255, .78), inset 0 0 24px rgba(63, 185, 255, .2); }
.login-hero-trigger:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.login-trigger-arrow { color: #dff4ff; font-size: 1.35em; font-weight: 300; }
.login-trigger-lock { width: 26px; height: 29px; margin: 8px auto 0; position: relative; display: block; border: 3px solid #dceeff; border-radius: 5px; box-shadow: 0 0 10px rgba(83, 191, 255, .35); }
.login-trigger-lock::before { content: ""; width: 16px; height: 16px; position: absolute; left: 50%; bottom: 23px; border: 3px solid #dceeff; border-bottom: 0; border-radius: 11px 11px 0 0; transform: translateX(-50%); }
.login-trigger-lock::after { content: ""; width: 3px; height: 7px; position: absolute; left: 50%; top: 9px; background: #dceeff; border-radius: 4px; transform: translateX(-50%); }
@media (min-width: 821px) {
    .login-hero-trigger { color: #f2f7ff; background: linear-gradient(110deg, rgba(8, 31, 65, .94), rgba(9, 28, 57, .88)); border-color: #5dcfff; box-shadow: 0 0 12px rgba(52, 191, 255, .5), inset 0 0 22px rgba(42, 167, 255, .12); }
    .login-hero-trigger > * { opacity: 1; }
    .login-hero-trigger:hover { transform: none; background: linear-gradient(110deg, rgba(9, 45, 87, .97), rgba(8, 31, 65, .94)); border-color: #91e5ff; box-shadow: 0 0 12px rgba(52, 191, 255, .5), inset 0 0 0 1px rgba(145, 229, 255, .74), inset 0 0 28px rgba(63, 185, 255, .24); }
}

.login-modal[hidden] { display: none; }
.login-modal { padding: 24px; position: fixed; z-index: 500; inset: 0; overflow-y: auto; display: grid; place-items: center; opacity: 0; background: rgba(0, 7, 20, .38); -webkit-backdrop-filter: blur(14px) brightness(.58) saturate(.85); backdrop-filter: blur(14px) brightness(.58) saturate(.85); transition: opacity .2s ease; }
.login-modal.is-open { opacity: 1; }
.login-modal-open { overflow: hidden; }
.login-dialog { width: 100%; max-width: 440px; padding-top: 112px; position: relative; opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .24s ease, transform .24s ease; }
.login-modal.is-open .login-dialog { opacity: 1; transform: translateY(0) scale(1); }
.login-dialog-logo { width: min(330px, 82vw); height: 145px; position: absolute; z-index: 2; left: 50%; top: -18px; display: block; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 0 12px rgba(40, 176, 255, .7)) drop-shadow(0 13px 20px rgba(0, 0, 0, .48)); }
.login-dialog-close { width: 38px; height: 38px; position: absolute; z-index: 4; top: 117px; right: 13px; display: grid; place-items: center; color: rgba(231, 246, 255, .78); background: rgba(9, 31, 62, .38); border: 1px solid rgba(178, 226, 255, .23); border-radius: 50%; cursor: pointer; font-size: 25px; font-weight: 200; line-height: 1; transition: color .2s ease, background .2s ease, transform .2s ease; }
.login-dialog-close:hover { color: #fff; background: rgba(25, 111, 180, .42); transform: rotate(6deg); }
.login-glass-card { width: 100%; max-width: none; padding: 35px 38px 31px; overflow: hidden; position: relative; color: #eef8ff; background: linear-gradient(145deg, rgba(15, 45, 80, .65), rgba(2, 16, 37, .82)); border: 1px solid rgba(170, 225, 255, .48); border-top-color: rgba(230, 249, 255, .72); border-left-color: rgba(212, 243, 255, .64); border-radius: 24px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 30px rgba(63, 171, 255, .07), 0 28px 80px rgba(0, 3, 12, .64), 0 0 34px rgba(21, 150, 255, .22); -webkit-backdrop-filter: blur(28px) saturate(1.25); backdrop-filter: blur(28px) saturate(1.25); }
.login-glass-card::before { content: ""; height: 1px; position: absolute; inset: 0 20% auto; background: linear-gradient(90deg, transparent, rgba(255,255,255,.94), transparent); box-shadow: 0 0 13px rgba(108, 205, 255, .72); }
.login-glass-card::after { content: ""; width: 170px; height: 170px; position: absolute; top: -105px; right: -75px; pointer-events: none; background: radial-gradient(circle, rgba(121, 217, 255, .17), transparent 68%); }
.login-dialog-heading { margin-bottom: 25px; padding-right: 30px; }
.login-dialog-heading p { margin: 0 0 5px; color: #4fc8ff; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.login-dialog-heading h2 { margin: 0 0 6px; color: #fff; font-size: 29px; letter-spacing: -.02em; }
.login-dialog-heading span { color: rgba(221, 238, 250, .68); font-size: 12px; line-height: 1.5; }
.login-glass-card > label { margin: 14px 0 7px; display: block; color: rgba(231, 245, 255, .84); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.login-field { min-height: 51px; padding: 0 13px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 9px; background: rgba(1, 12, 30, .44); border: 1px solid rgba(155, 211, 246, .28); border-radius: 12px; box-shadow: inset 0 1px 9px rgba(0, 0, 0, .22), 0 1px 0 rgba(255, 255, 255, .06); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.login-field:focus-within { background: rgba(3, 20, 43, .64); border-color: rgba(79, 198, 255, .85); box-shadow: inset 0 1px 9px rgba(0,0,0,.2), 0 0 0 3px rgba(42, 173, 255, .12), 0 0 18px rgba(39, 169, 255, .12); }
.login-field > span { color: #55c9ff; font-size: 18px; }
.login-glass-card .login-field input { width: 100%; height: 49px; min-width: 0; padding: 0 12px; color: #061426 !important; -webkit-text-fill-color: #061426 !important; caret-color: #061426; background: #e8f3ff; border: 0; border-radius: 8px; outline: 0; box-shadow: inset 0 0 0 1000px #e8f3ff; font: inherit; font-size: 14px; font-weight: 600; }
.login-glass-card .login-field input:focus { color: #061426 !important; -webkit-text-fill-color: #061426 !important; background: #f4f9ff; border: 0; box-shadow: inset 0 0 0 1000px #f4f9ff; }
.login-glass-card .login-field input:-webkit-autofill,
.login-glass-card .login-field input:-webkit-autofill:hover,
.login-glass-card .login-field input:-webkit-autofill:focus { color: #061426 !important; -webkit-text-fill-color: #061426 !important; caret-color: #061426; box-shadow: inset 0 0 0 1000px #e8f3ff; transition: background-color 9999s ease-out 0s; }
.password-toggle { width: 28px; height: 30px; display: grid; place-items: center; color: rgba(210, 237, 255, .58); background: transparent; border: 0; cursor: pointer; font-size: 15px; }
.password-toggle:hover { color: #fff; }
.login-submit { width: min(72%, 290px); min-height: 43px; margin: 22px auto 0; padding: 0 17px; display: flex; align-items: center; justify-content: center; gap: 11px; color: #fff; background: linear-gradient(100deg, #087de0, #16b5f0); border: 1px solid #61d5ff; border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255,255,255,.33), 0 8px 21px rgba(0, 119, 225, .3), 0 0 16px rgba(20, 173, 245, .16); cursor: pointer; font-size: 14px; font-weight: 800; letter-spacing: .03em; transition: transform .2s ease, filter .2s ease, box-shadow .2s ease; }
.login-submit:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 12px 28px rgba(0, 119, 225, .42), 0 0 24px rgba(20, 173, 245, .25); }
.login-submit:focus-visible, .login-dialog-close:focus-visible, .password-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.login-submit b { font-size: 22px; font-weight: 300; }
.login-glass-card .login-hint { margin-top: 17px; color: rgba(198, 222, 239, .52); font-size: 10px; }
.login-error { margin: -7px 0 17px; padding: 10px 12px; color: #ffe4e7; background: rgba(144, 28, 48, .38); border: 1px solid rgba(255, 130, 147, .42); border-radius: 10px; font-size: 11px; line-height: 1.45; }

@media (max-width: 820px) {
    .login-hero-image { object-position: 59% center; }
    .login-hero::after { background: linear-gradient(180deg, rgba(0, 8, 20, .06), rgba(0, 8, 20, .34)); }
    .login-hero-trigger { width: calc(100% - 64px); min-width: 0; min-height: 58px; padding: 9px 16px; left: 32px; top: auto; bottom: max(24px, env(safe-area-inset-bottom)); grid-template-columns: 34px 1fr 34px; gap: 8px; border-radius: 13px; font-size: clamp(20px, 6vw, 27px); }
    .login-trigger-lock { width: 24px; height: 27px; border-width: 3px; }
    .login-trigger-lock::before { width: 15px; height: 15px; bottom: 21px; border-width: 3px; border-bottom: 0; }
    .login-trigger-lock::after { top: 9px; }
    .login-modal { padding: 14px; align-items: center; }
    .login-dialog { width: 100%; max-width: 420px; padding-top: 86px; }
    .login-dialog-logo { width: min(270px, 76vw); height: 112px; top: -15px; }
    .login-dialog-close { top: 91px; right: 10px; }
    .login-glass-card { padding: 32px 22px 25px; border-radius: 20px; }
    .login-dialog-heading h2 { font-size: 25px; }
}

@media (max-height: 720px) and (min-width: 821px) {
    .login-dialog { padding-top: 79px; }
    .login-dialog-logo { width: 250px; height: 104px; top: -13px; }
    .login-dialog-close { top: 84px; }
    .login-glass-card { padding-top: 28px; padding-bottom: 24px; }
    .login-dialog-heading { margin-bottom: 18px; }
    .login-field { min-height: 46px; }
    .login-glass-card .login-field input { height: 44px; }
    .login-submit { width: min(78%, 270px); min-height: 42px; margin: 19px auto 0; }
}

@media (prefers-reduced-motion: reduce) {
    .login-hero-trigger, .login-modal, .login-dialog, .login-dialog-close, .login-submit { transition: none; }
}
