:root {
    color-scheme: dark;
    --bg: #0c0c0d;
    --sidebar: #111111;
    --panel: #181818;
    --inset: #101010;
    --border: #323232;
    --muted: #afadad;
    --text: #fffefe;
    --gold: #ffc50a;
    --ink: #161204;
    --green: #9bdbb2;
    --red: #f4a7a5;
    font-family: "DM Sans", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 3.1vw, 43px); line-height: 1.12; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: -.025em; }
small, .muted { color: var(--muted); }
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 26px 17px 18px; background: var(--sidebar); border-right: 1px solid var(--border); z-index: 5; overflow: auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 760; line-height: 1.2; padding: 0 4px; }
.brand small, .account small { display: block; margin-top: 4px; font-size: 11px; font-weight: 500; }
.brand-mark { width: 46px; height: 46px; flex: 0 0 46px; object-fit: contain; background: #000; border: 1px solid var(--border); border-radius: 10px; }
.sidebar nav { margin-top: 35px; }
.nav-caption { color: var(--muted); font-weight: 650; font-size: 10px; text-transform: uppercase; letter-spacing: .13em; padding: 0 12px; margin-bottom: 8px; }
.nav-caption.second { margin-top: 24px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 4px; border-radius: 8px; color: var(--muted); border: 1px solid transparent; }
.nav-link svg { width: 17px; height: 17px; }
.nav-link:hover, .nav-link.selected { background: #282311; color: var(--gold); border-color: #51421a; }
.nav-link.selected { box-shadow: inset 3px 0 var(--gold); }
.account { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 16px 0 0; border-top: 1px solid var(--border); }
.account-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.account-link { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; border-radius: 8px; }
.account-link:hover .account-name { color: var(--gold); }
.avatar, .metric-icon, .action-icon { display: grid; place-items: center; flex: 0 0 auto; color: var(--gold); background: #30260d; border: 1px solid #554416; border-radius: 10px; }
.avatar { width: 34px; height: 34px; overflow: hidden; font-weight: 750; border-radius: 50%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.client-logo { border-radius: 9px; }
.avatar.client-logo img { object-fit: contain; padding: 3px; background: #f7f7f7; }
.avatar.avatar-large { width: 60px; height: 60px; font-size: 24px; }
.account-identity { display: flex; align-items: center; gap: 13px; min-width: 0; overflow-wrap: anywhere; }
.account-identity h2 { margin: 0; }
.account-edit { margin: 12px 0; }
.account-identity + form { margin-top: 16px; }
.narrow-panel { max-width: 640px; }
.topbar { height: 65px; padding: 0 clamp(18px, 3.3vw, 47px); border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: center; justify-content: space-between; background: var(--sidebar); }
.breadcrumb { color: var(--muted); }
.breadcrumb b { margin: 0 8px; color: var(--gold); font-weight: 500; }
.top-date { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.locale-switch .button { min-height: 34px; padding: 5px 10px; font-size: 12px; }
.guest-language { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; }
.top-date svg, .button svg, .text-link svg, .icon-button svg { width: 16px; height: 16px; }
.content { width: min(100%, 1540px); margin: auto; padding: 31px clamp(18px, 3.3vw, 47px) 45px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 25px; }
.page-head p, .panel-head p { color: var(--muted); margin-top: 6px; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); color: var(--text); background: #232326; border-radius: 8px; font-weight: 700; min-height: 38px; padding: 8px 14px; }
.button { white-space: nowrap; }
.button:hover, .icon-button:hover { border-color: #806b49; }
.button.primary { color: var(--ink); border-color: var(--gold); background: var(--gold); }
.button.primary:hover { background: #ffdb52; }
.button.danger { color: #ffb4aa; border-color: #633a36; background: #2f1c1a; }
.button.danger:hover { border-color: #ffb4aa; }
.record-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.icon-button { min-height: 32px; width: 32px; padding: 0; color: var(--muted); }
.menu-button { display: none; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.metric { padding: 16px 17px; background: linear-gradient(145deg, #211d13 0, var(--panel) 62%); }
.metric-icon { width: 34px; height: 34px; margin-bottom: 13px; }
.metric-icon svg { width: 17px; height: 17px; }
.metric-label { font-weight: 650; color: var(--muted); }
.metric strong { display: block; margin: 3px 0; font-size: clamp(19px, 2.3vw, 30px); line-height: 1.25; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 17px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 19px 14px; }
.panel-head p { font-size: 12px; }
.text-link, .back-link { color: var(--gold); font-weight: 650; }
.text-link { display: inline-flex; gap: 5px; align-items: center; }
.text-link:hover, .back-link:hover { text-decoration: underline; }
.panel-head .text-link { white-space: nowrap; font-size: 12px; }
.chart { display: grid; gap: 17px; padding: 7px 19px 24px; }
.bar-row { display: grid; grid-template-columns: 100px 1fr 24px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.bar-row b { color: var(--text); text-align: right; }
.bar-track { height: 9px; background: #2a2a30; border-radius: 20px; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.bar-fill.new { background: #beabd8; }
.bar-fill.contacted { background: #95b9ee; }
.bar-fill.proposal { background: #e0b571; }
.bar-fill.negotiation { background: #a3cb99; }
.action-list { padding: 0 18px 12px; }
.action-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid var(--border); }
.action-row:hover strong { color: var(--gold); }
.action-row strong { display: block; overflow-wrap: anywhere; }
.action-row small, .action-row time { font-size: 11px; color: var(--muted); }
.action-icon { width: 29px; height: 29px; border-radius: 7px; }
.action-icon svg { width: 15px; height: 15px; }
.late { color: var(--red) !important; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; }
th { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--muted); background: var(--inset); }
td, th { border-top: 1px solid var(--border); padding: 11px 15px; }
td { font-size: 13px; min-width: 95px; }
td:last-child { min-width: 0; }
td small, .person small { display: block; }
.person { display: flex; align-items: center; gap: 9px; min-width: 134px; }
.person:hover strong { color: var(--gold); }
.pill { display: inline-flex; border-radius: 20px; padding: 3px 8px; font-size: 11px; font-weight: 700; color: #ccc9d2; background: #2c2931; }
.pill.new { background: #312740; color: #dcc2f8; }
.pill.contacted { background: #23314a; color: #b8d5ff; }
.pill.proposal { background: #382d1e; color: var(--gold); }
.pill.negotiation, .pill.won { background: #24362b; color: var(--green); }
.pill.lost { background: #3b2527; color: var(--red); }
.empty { color: var(--muted); padding: 20px 14px; text-align: center; font-size: 13px; }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.form-panel { padding: 19px; }
.form-panel h2 { margin-bottom: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
label { display: grid; gap: 5px; min-width: 0; font-weight: 650; }
input, textarea, select { min-width: 0; width: 100%; background: var(--inset); color: var(--text); border: 1px solid #3b3b42; border-radius: 7px; padding: 9px 10px; min-height: 39px; }
input::placeholder, textarea::placeholder { color: #898993; }
input[type="file"]::file-selector-button { color: var(--text); background: #282828; border: 1px solid var(--border); border-radius: 5px; padding: 5px 8px; margin-inline-end: 8px; cursor: pointer; }
.check-field { display: flex; align-items: center; gap: 8px; }
.check-field input { min-height: 0; width: auto; accent-color: var(--gold); }
textarea { resize: vertical; }
.required { display: inline; color: var(--gold); }
.form-grid label:has(.required) { display: block; }
label .required + :is(input, select) { display: block; margin-top: 5px; }
.form-actions { display: flex; justify-content: flex-end; }
.filters { padding: 15px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px; }
.filters input { flex: 1 1 240px; width: auto; }
.filters select, .filters label { width: auto; max-width: 100%; }
.filters > a { align-self: center; }
.back-link { display: inline-block; margin-bottom: 11px; }
.back-arrow { display: inline-block; }
.profile-grid { display: grid; grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); align-items: start; gap: 16px; }
.details { margin: 0; }
.details div { display: grid; grid-template-columns: minmax(72px, .35fr) 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.socials { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.socials a:hover { color: var(--gold); }
.notes { display: grid; gap: 11px; margin-top: 16px; }
.notes article { padding-top: 11px; border-top: 1px solid var(--border); }
.notes article div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; }
.notes time { color: var(--muted); font-size: 11px; }
.notes article p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 5px; }
.section-title, .deal-card summary, .lane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deal-card summary { list-style: none; padding: 15px 17px; }
.deal-card summary::-webkit-details-marker { display: none; }
.deal-card summary::before { content: '+'; color: var(--gold); }
.deal-card[open] summary::before { content: '−'; }
.deal-card summary > span:first-child, .deal-card summary > strong:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.deal-card summary small { display: block; }
.deal-card:target { border-color: var(--gold); }
.deal-form { border-top: 1px solid var(--border); padding: 15px; }
fieldset { margin: 0; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
legend { color: var(--muted); padding: 0 5px; font-weight: 700; }
.loss-box { display: grid; gap: 10px; border-color: #654144; }
.loss-box legend { color: var(--red); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.lane { background: #151518; padding: 11px; border-radius: 12px; border: 1px solid var(--border); }
.lane-head { margin-bottom: 10px; }
.lane-head h2 { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.stage-dot.new { background: #beabd8; }
.stage-dot.contacted { background: #95b9ee; }
.stage-dot.negotiation { background: #a3cb99; }
.board-card { display: grid; gap: 5px; padding: 11px; margin-top: 8px; overflow-wrap: anywhere; }
.board-card:hover { border-color: var(--gold); }
.board-card > span, .board-card b { font-size: 12px; }
.board-card div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; margin-top: 3px; }
.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.tabs a { padding: 7px 12px; border-radius: 7px; color: var(--muted); border: 1px solid var(--border); }
.tabs .active, .tabs a:hover { color: var(--gold); border-color: #745c3a; background: #282119; }
.reason-note { max-width: 340px; overflow-wrap: anywhere; white-space: pre-wrap; }
.pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 12px; }
.flash { border: 1px solid #42634c; color: var(--green); border-radius: 8px; padding: 11px; margin-bottom: 14px; background: #1b2b22; }
.flash.error { border-color: #674044; color: var(--red); background: #311f22; }
.guest { min-height: 100dvh; display: grid; place-items: center; padding: 58px 18px 18px; }
.login-wrap { width: min(780px, 100%); display: grid; grid-template-columns: 1fr 1.12fr; border: 1px solid var(--border); background: var(--panel); border-radius: 16px; overflow: hidden; }
.login-art { display: flex; flex-direction: column; justify-content: space-between; min-height: 325px; padding: 24px; background: radial-gradient(ellipse at 5% 105%, #493700, #121007 56%, #070707 78%); }
.login-art-logo { display: block; width: min(180px, 75%); height: auto; margin: auto; border-radius: 18px; }
.login-form { padding: clamp(23px, 5vw, 50px); align-self: center; }
.login-form p { margin: 6px 0 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[dir="rtl"] { font-family: Tahoma, Arial, sans-serif; }
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--border); }
[dir="rtl"] .nav-link.selected { box-shadow: inset -3px 0 var(--gold); }
[dir="rtl"] .text-link svg, [dir="rtl"] .back-link .back-arrow { transform: scaleX(-1); }
[dir="rtl"] .breadcrumb { margin-inline-end: auto; }
[dir="rtl"] input:is([type="email"],[type="password"],[type="url"],[type="tel"],[type="number"],[type="datetime-local"]) { direction: ltr; text-align: end; }
@media (max-width: 1100px) {
    .shell { grid-template-columns: 185px minmax(0, 1fr); }
    .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 840px) {
    .shell { display: block; }
    .sidebar { display: none; position: fixed; inset-block: 65px 0; inset-inline-start: 0; width: min(260px, 85vw); height: auto; box-shadow: 0 0 45px #0008; }
    .sidebar.is-open { display: flex; }
    .menu-button { display: inline-flex; }
    .breadcrumb { margin-inline-end: auto; }
    .topbar { position: sticky; top: 0; z-index: 6; }
}
@media (max-width: 640px) {
    .overview-grid, .profile-grid { grid-template-columns: minmax(0, 1fr); }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .metric { padding: 12px; }
    .content { padding: 20px 12px 30px; }
    .page-head { align-items: flex-start; flex-wrap: wrap; }
    .top-date { font-size: 11px; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-art { min-height: 0; padding: 16px; }
    .login-art-logo { display: none; }
}
@media (max-width: 380px) {
    .form-grid, .board { grid-template-columns: 1fr; }
    .top-date { display: none; }
}

