:root {
  color-scheme: dark;
  --bg: #0e1113;
  --surface: #171b1f;
  --surface-2: #20262b;
  --line: #313940;
  --text: #f3f5f6;
  --muted: #9da7ae;
  --accent: #f4b942;
  --green: #44c27a;
  --red: #ef6262;
  --blue: #66a6ff;
  --radius: 8px;
  font-family: Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden,
.view {
  display: none;
}

.view.active,
.app-screen:not(.hidden) {
  display: block;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.login-screen {
  min-height: calc(100vh - 36px);
  display: grid;
  align-content: center;
  gap: 18px;
}

.brand-block {
  max-width: 720px;
}

.brand-block h1,
.topbar h1,
.section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: clamp(34px, 8vw, 68px);
  line-height: 1;
}

.brand-block p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.role-card,
.section-block,
.metric,
.install-help,
.connection-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.role-card {
  min-height: 118px;
  padding: 15px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.role-card span,
.role-card strong {
  display: block;
}

.role-card span {
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 10px;
}

.role-card strong {
  line-height: 1.35;
}

.role-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.login-form {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101417;
  color: var(--text);
  padding: 11px;
}

textarea {
  resize: vertical;
}

.security-note,
.muted-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.topbar h1 {
  font-size: clamp(24px, 5vw, 42px);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-button,
.text-button,
.primary-button,
.module-tab,
.upload-control {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 42px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
}

.icon-button {
  width: 44px;
  font-size: 24px;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #17110a;
  font-weight: 900;
}

.text-button {
  padding: 0 12px;
}

.install-help {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
}

.install-help span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.connection-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
  border-left: 4px solid var(--accent);
}

.connection-panel.online {
  border-left-color: var(--green);
}

.connection-panel.offline {
  border-left-color: var(--red);
}

.connection-panel span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.role-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #121619;
  margin-bottom: 14px;
}

.module-tab {
  background: transparent;
}

.module-tab.active {
  background: var(--accent);
  color: #17110a;
  border-color: var(--accent);
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 96px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 9px;
}

.metric strong {
  display: block;
  font-size: 23px;
}

.section-block {
  padding: 14px;
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.entity-list {
  display: grid;
  gap: 8px;
}

.entity-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111518;
}

.compact .entity-row {
  grid-template-columns: 1fr auto auto;
}

.entity-row small,
.detail-grid small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
  font-size: 13px;
}

.status.ok {
  color: var(--green);
}

.status.warn {
  color: var(--accent);
}

.status.bad {
  color: var(--red);
}

.detail-grid,
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111518;
}

.map-box {
  min-height: 190px;
  display: grid;
  align-content: end;
  padding: 14px;
  border: 1px solid #46505a;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    #151a1f;
  background-size: 32px 32px;
}

.map-point {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(244, 185, 66, .16);
  margin: 0 0 46px 58%;
}

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.calendar-day {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101417;
}

.calendar-day.active {
  border-color: var(--accent);
}

.calendar-day strong,
.calendar-day span {
  display: block;
}

.calendar-day span {
  color: var(--muted);
  font-size: 12px;
}

.form-panel {
  margin-bottom: 0;
}

.form-panel label {
  margin-bottom: 11px;
}

.access-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.upload-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  margin-bottom: 10px;
}

.upload-control input {
  display: none;
}

.site-sync-panel {
  padding: clamp(16px, 3vw, 24px);
  margin: 14px 0;
  background:
    radial-gradient(circle at 92% 8%, rgba(214, 170, 63, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 122, 77, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(14, 46, 34, 0.06);
}

.site-sync-meta {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.site-sync-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.site-sync-card {
  display: grid;
  gap: 8px;
  min-height: 172px;
  padding: 16px;
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(90deg, rgba(31, 122, 77, 0.06) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(31, 122, 77, 0.05) 0 1px, transparent 1px 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 246, 0.9));
  background-size: 34px 34px, 34px 34px, auto;
  border: 1px solid rgba(31, 122, 77, 0.12);
  border-radius: var(--radius);
}

.site-sync-card span {
  color: #0f5132;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.site-sync-card strong {
  font-size: 18px;
  line-height: 1.15;
}

.site-sync-card small {
  color: #68737d;
  line-height: 1.45;
}

.lead-form {
  grid-template-columns: 1fr 1fr 0.9fr 1.2fr auto;
  margin-bottom: 12px;
}

.lead-row {
  border-color: rgba(31, 122, 77, 0.14);
}

.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.lead-actions .text-button {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.notification-row.is-read {
  opacity: 0.68;
}

.planner-form {
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr 0.8fr 1fr 1fr 1.2fr auto;
}

.planner-row {
  border-color: rgba(31, 122, 77, 0.14);
}

.planner-calendar .calendar-day em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-top: 6px;
  color: #0f5132;
  background: #e7f4ec;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px;
  }

  .login-grid,
  .summary-grid,
  .site-sync-grid,
  .detail-grid,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .role-switch {
    grid-template-columns: 1fr;
  }

  .entity-row {
    grid-template-columns: 1fr;
  }

  .install-help,
  .connection-panel,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .access-form {
    grid-template-columns: 1fr;
  }

  .lead-form {
    grid-template-columns: 1fr;
  }

  .planner-form {
    grid-template-columns: 1fr;
  }

  .lead-actions {
    justify-content: stretch;
  }

  .lead-actions .text-button {
    flex: 1;
  }
}

/* DOS GROUP website skin */
:root {
  color-scheme: light;
  --bg: #f8faf5;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-2: #f3f7f1;
  --line: rgba(11, 67, 49, 0.14);
  --text: #101723;
  --muted: #66727c;
  --accent: #d6aa3f;
  --green: #1f7a4d;
  --green-dark: #0f5132;
  --green-soft: #e7f4ec;
  --red: #b64040;
  --blue: #365f8a;
  --radius: 8px;
}

body {
  background:
    radial-gradient(circle at 14% 8%, rgba(214, 170, 63, 0.18), transparent 290px),
    radial-gradient(circle at 86% 14%, rgba(31, 122, 77, 0.14), transparent 360px),
    linear-gradient(rgba(11, 67, 49, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 67, 49, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #fbfaf4 0%, #f6f9f4 48%, #e8f3ee 100%);
  background-size: auto, auto, 44px 44px, 44px 44px, auto;
  color: var(--text);
}

.app-shell {
  width: min(1180px, 100%);
  padding: 0 18px 26px;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  align-content: start;
  padding-top: 150px;
}

.login-screen::before,
.app-screen::before {
  content: "D  DOS GROUP\AАвтомобильная группа";
  white-space: pre;
  position: fixed;
  z-index: 10;
  top: 0;
  left: 50%;
  width: min(1180px, 100%);
  min-height: 130px;
  transform: translateX(-50%);
  padding: 24px 28px 76px 90px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.16em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(135deg, #101818 0%, #1f2928 48%, #0f1516 100%);
  border-bottom: 1px solid rgba(159, 224, 184, 0.14);
  box-shadow: 0 16px 40px rgba(12, 22, 20, 0.16);
}

.login-screen::after,
.app-screen::after {
  content: "D";
  position: fixed;
  z-index: 11;
  top: 20px;
  left: max(18px, calc(50% - 590px + 24px));
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(159, 224, 184, 0.82);
  border-radius: 18px;
  box-shadow: inset 0 0 20px rgba(159, 224, 184, 0.12);
}

.brand-block {
  max-width: 780px;
  padding: clamp(24px, 5vw, 48px);
  background:
    radial-gradient(circle at 92% 8%, rgba(159, 224, 184, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 246, 0.92));
  border: 1px solid rgba(31, 122, 77, 0.12);
  border-radius: 0;
  box-shadow: 0 22px 48px rgba(14, 46, 34, 0.08);
}

.brand-block h1 {
  max-width: 660px;
  color: var(--text);
  font-size: clamp(38px, 7vw, 64px);
  line-height: 0.96;
}

.brand-block p:not(.eyebrow) {
  color: #68737d;
  font-size: clamp(17px, 2.6vw, 22px);
  line-height: 1.55;
}

.eyebrow {
  color: #56606c;
  font-size: 13px;
  letter-spacing: 0.28em;
}

.login-grid {
  max-width: 780px;
  margin-top: -8px;
}

.role-card {
  min-height: 124px;
  color: var(--text);
  background: rgba(255, 247, 207, 0.84);
  border: 1px solid rgba(214, 170, 63, 0.34);
  border-radius: 28px;
  box-shadow: 0 12px 22px rgba(118, 91, 26, 0.06);
}

.role-card span {
  color: #0f5132;
  letter-spacing: 0.1em;
}

.role-card.active {
  border-color: rgba(31, 122, 77, 0.5);
  background: linear-gradient(135deg, #e7f4ec, #fff8d8);
  box-shadow: 0 16px 34px rgba(31, 122, 77, 0.14);
}

.login-form {
  max-width: 780px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(31, 122, 77, 0.12);
}

label {
  color: #5f6973;
  font-weight: 700;
}

input,
select,
textarea {
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 81, 50, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(31, 122, 77, 0.2);
  border-color: rgba(31, 122, 77, 0.54);
}

.primary-button {
  min-height: 58px;
  color: #fff;
  background: linear-gradient(135deg, #2a9b63, var(--green-dark));
  border-color: rgba(31, 122, 77, 0.24);
  border-radius: 999px;
  box-shadow: 0 16px 34px rgba(31, 122, 77, 0.26);
}

.text-button,
.upload-control {
  color: #101723;
  background: rgba(255, 247, 196, 0.9);
  border-color: rgba(214, 170, 63, 0.32);
  border-radius: 999px;
  font-weight: 900;
}

.icon-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 132px;
  margin: 0 -18px 0;
  padding: 24px 24px 76px 90px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(135deg, #101818 0%, #1f2928 48%, #0f1516 100%);
  border-bottom: 1px solid rgba(159, 224, 184, 0.14);
  box-shadow: 0 16px 40px rgba(12, 22, 20, 0.16);
}

.topbar::before {
  content: "D";
  position: absolute;
  top: 20px;
  left: 24px;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(159, 224, 184, 0.82);
  border-radius: 18px;
}

.topbar h1 {
  color: #fff;
  font-size: clamp(24px, 5vw, 36px);
}

.topbar .eyebrow {
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.1em;
}

.app-screen::before,
.app-screen::after {
  display: none;
}

.role-switch {
  position: sticky;
  top: 88px;
  z-index: 21;
  display: flex;
  margin: -58px 4px 24px;
  overflow-x: auto;
  padding: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(24, 31, 31, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.module-tab {
  flex: 1 0 auto;
  min-width: 132px;
  color: rgba(255, 255, 255, 0.84);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.module-tab.active {
  color: #071815;
  background: linear-gradient(135deg, #9fe0b8, #d6aa3f);
  border-color: transparent;
}

.install-help,
.connection-panel,
.section-block,
.metric {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(31, 122, 77, 0.12);
  box-shadow: 0 14px 28px rgba(14, 46, 34, 0.06);
}

.install-help,
.connection-panel {
  margin-top: 14px;
}

.connection-panel {
  border-left: 0;
  border-top: 4px solid var(--accent);
}

.connection-panel.online {
  border-top-color: var(--green);
}

.connection-panel.offline {
  border-top-color: var(--red);
}

.summary-grid {
  margin-top: 6px;
}

.metric {
  min-height: 106px;
  background:
    linear-gradient(90deg, rgba(31, 122, 77, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(31, 122, 77, 0.06) 0 1px, transparent 1px 100%),
    rgba(255, 255, 255, 0.94);
  background-size: 32px 32px;
}

.metric span {
  color: #65717a;
  font-weight: 800;
}

.metric strong {
  color: #101723;
  font-size: clamp(21px, 3vw, 28px);
}

.section-block {
  padding: clamp(16px, 3vw, 24px);
}

.section-head h2 {
  color: #101723;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.03;
}

.entity-row,
.detail-box,
.calendar-day {
  color: #101723;
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(31, 122, 77, 0.12);
}

.entity-row small,
.detail-grid small,
.calendar-day span,
.install-help span,
.connection-panel span,
.security-note,
.muted-text {
  color: #68737d;
}

.status {
  color: #0f5132;
  background: #e7f4ec;
  border-color: rgba(31, 122, 77, 0.18);
  font-weight: 900;
}

.status.warn {
  color: #6b520f;
  background: rgba(255, 244, 188, 0.9);
  border-color: rgba(214, 170, 63, 0.28);
}

.status.bad {
  color: #9e2f2f;
  background: rgba(255, 232, 232, 0.9);
  border-color: rgba(182, 64, 64, 0.24);
}

.map-box {
  background:
    linear-gradient(90deg, rgba(31, 122, 77, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(31, 122, 77, 0.08) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 78% 18%, rgba(159, 224, 184, 0.32), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 248, 242, 0.72));
  background-size: 34px 34px, 34px 34px, auto, auto;
  border-color: rgba(31, 122, 77, 0.14);
}

.map-point {
  background: #1f7a4d;
  box-shadow: 0 0 0 8px rgba(31, 122, 77, 0.14);
}

@media (max-width: 820px) {
  .app-shell {
    padding: 0 12px 20px;
  }

  .login-screen {
    padding-top: 138px;
  }

  .login-screen::before,
  .app-screen::before {
    min-height: 120px;
    padding: 22px 18px 72px 86px;
    font-size: 14px;
  }

  .login-screen::after,
  .app-screen::after {
    left: 22px;
    width: 52px;
    height: 52px;
  }

  .brand-block {
    padding: 30px 28px;
  }

  .login-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    margin: 0 -12px;
    min-height: 124px;
    padding: 22px 18px 72px 86px;
  }

  .role-switch {
    top: 82px;
    margin: -56px 0 18px;
  }

  .module-tab {
    min-width: 128px;
    min-height: 46px;
  }
}
