:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #233831;
  background: #f4f6f4;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid #dce3de;
  background: white;
  color: #30483b;
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 550;
}
button:hover {
  background: #edf3ef;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #b4c24b;
}
.primary {
  background: #234f3e;
  color: white;
  border-color: #234f3e;
}
.primary:hover {
  background: #34684f;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 235px;
  background: #173d30;
  color: #d4e1da;
  padding: 33px 21px;
  display: flex;
  flex-direction: column;
}
.logo {
  color: #e0ed9e;
  display: flex;
  gap: 11px;
  text-decoration: none;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -1px;
}
.logo small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #9cb7a9;
  margin-top: 8px;
}
.navlabel {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #8eab9c;
  margin: 55px 10px 18px;
}
nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  color: #bcd0c4;
  border: 0;
  margin: 5px 0;
  padding: 13px;
}
nav button.active {
  background: #335747;
  color: #e8f2c4;
}
nav button:hover {
  background: #294d3d;
}
.asidebottom {
  margin-top: auto;
  font-size: 12px;
}
.asidebottom small {
  display: block;
  color: #91af9e;
  line-height: 1.8;
  margin: 12px 0;
}
.asidebottom button {
  background: none;
  color: #c6d8ce;
  border-color: #496555;
  width: 100%;
  font-size: 12px;
  margin-top: 8px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #c7df88;
  border-radius: 100%;
  margin-right: 6px;
}
main {
  margin-left: 235px;
  padding: 0 42px;
}
header {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #829087;
  font-size: 12px;
  border-bottom: 1px solid #dfe6df;
}
.pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 36px 0 28px;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 0 0 8px;
}
h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
}
p {
  color: #7b8c80;
  line-height: 1.6;
  margin: 5px 0;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #6e8b79;
  margin-bottom: 10px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  padding: 22px;
  background: white;
  border: 1px solid #e1e7e1;
  border-radius: 12px;
}
.stat b {
  font-size: 32px;
  font-weight: 550;
  display: block;
  margin: 17px 0 7px;
  letter-spacing: -1px;
}
.stat small {
  color: #839387;
}
.stat.emphasis {
  background: #e8edcc;
  border-color: #dce4ba;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}
.panel {
  background: white;
  border: 1px solid #e1e7e1;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}
.panelhead {
  padding: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #edf0ec;
}
.panelhead button {
  font-size: 12px;
  border: 0;
  padding: 5px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid #edf0ec;
}
.row:last-child {
  border: 0;
}
.row small {
  display: block;
  color: #87958c;
  margin-top: 6px;
}
.caricon {
  background: #edf2ec;
  color: #5c7561;
  padding: 13px;
  border-radius: 10px;
  font-size: 22px;
}
.carname {
  display: flex;
  gap: 15px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  background: #edf3ed;
  color: #4b7756;
}
.badge.warn {
  background: #fff0d9;
  color: #9b722d;
}
.badge.danger {
  background: #fae8e1;
  color: #ab5c45;
}
.muted {
  color: #8c9b90;
}
.plate {
  font-size: 11px;
  border: 1px solid #cfd9d0;
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  color: #536357;
  letter-spacing: 0.5px;
  margin-top: 6px;
}
.callout {
  padding: 24px;
  background: #e9efdf;
  border-radius: 12px;
  line-height: 1.6;
}
.callout h2 {
  margin-bottom: 10px;
}
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filters input {
  flex: 1;
  min-width: 200px;
}
.filters select {
  max-width: 230px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #d6dfd7;
  border-radius: 7px;
  padding: 11px 12px;
  color: #2c4635;
  background: white;
  outline-color: #6a8f70;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: #fafbf9;
  color: #829183;
  font-weight: 500;
  padding: 16px 20px;
}
td {
  padding: 19px 20px;
  border-top: 1px solid #edf1eb;
  font-size: 13px;
}
td small {
  display: block;
  margin-top: 6px;
  color: #8a978c;
}
td button {
  font-size: 12px;
  padding: 7px 10px;
}
.tablewrap {
  overflow: auto;
}
.empty {
  text-align: center;
  padding: 50px;
  color: #809181;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.vehicle {
  padding: 24px;
  background: white;
  border: 1px solid #dde6de;
  border-radius: 12px;
}
.vehicle h2 {
  margin: 18px 0 5px;
}
.vehicle .details {
  display: flex;
  justify-content: space-between;
  padding: 19px 0;
  margin-top: 18px;
  border-top: 1px solid #e5eae4;
}
.vehicle button {
  width: 100%;
}
footer {
  font-size: 10px;
  color: #93a095;
  display: flex;
  justify-content: space-between;
  padding: 30px 0;
}
dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(760px, 95vw);
  max-height: 90vh;
  box-shadow: 0 25px 100px #15332540;
}
dialog::backdrop {
  background: #122b2266;
  backdrop-filter: blur(3px);
}
form {
  padding: 28px;
}
.dialoghead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.dialoghead button {
  border: 0;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.field label {
  display: block;
  font-size: 12px;
  color: #6d8172;
  margin-bottom: 7px;
}
.full {
  grid-column: 1/-1;
}
.dialogfoot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.sectiontitle {
  grid-column: 1/-1;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid #e0e7df;
}
.partsrow {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.6fr 0.8fr 35px;
  gap: 6px;
  margin: 8px 0;
}
.partsrow input {
  padding: 9px 6px;
  font-size: 12px;
}
.partsrow button {
  padding: 5px;
}
.partlabels {
  font-size: 9px;
  color: #7f9282;
}
#error {
  color: #b44a34;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #214c38;
  color: white;
  padding: 14px 24px;
  border-radius: 9px;
  display: none;
  z-index: 9;
}
.historytitle {
  margin: 28px 0 18px;
}
.costbar {
  height: 6px;
  border-radius: 4px;
  background: #e9eddf;
  margin-top: 12px;
}
.costbar i {
  display: block;
  height: 100%;
  background: #648c64;
  border-radius: 4px;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  main {
    padding: 0 25px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  aside {
    position: static;
    width: auto;
    padding: 20px;
  }
  .logo small,
  .navlabel,
  .asidebottom {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    margin-top: 20px;
  }
  nav button {
    white-space: nowrap;
    width: auto;
    font-size: 12px;
  }
  main {
    margin: 0;
    padding: 0 16px;
  }
  header {
    height: 55px;
  }
  .pagehead {
    align-items: flex-start;
    margin: 25px 0;
  }
  h1 {
    font-size: 25px;
  }
  .pagehead .toolbar {
    justify-content: flex-end;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    padding: 16px;
  }
  .stat b {
    font-size: 26px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .partsrow {
    grid-template-columns: repeat(3, 1fr);
  }
  .partlabels {
    display: none;
  }
  form {
    padding: 20px;
  }
  .row {
    padding: 17px;
  }
  .panelhead {
    padding: 18px;
  }
}
@media (max-width: 700px) {
  .asidebottom {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    font-size: 0;
  }
  .asidebottom small,
  .asidebottom .dot {
    display: none;
  }
  .asidebottom button {
    width: auto;
    font-size: 11px;
    margin: 0;
  }
}
.grid > section {
  min-width: 0;
}
/* Animal Trips additions */
aside {
  overflow-y: auto;
}
.logo {
  font-size: 23px;
}
.navlabel {
  margin-top: 28px;
}
nav button {
  padding: 10px;
}
.notice {
  padding: 16px 20px;
  border: 1px solid #e2d4ac;
  background: #fff8e6;
  border-radius: 10px;
  margin: 16px 0;
  color: #745b27;
  line-height: 1.6;
}
.padded {
  padding: 22px;
}
.padded p {
  margin: 14px 0;
}
.padded .field {
  max-width: 360px;
  margin-bottom: 16px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}
.check input {
  width: auto;
}
.danger-button {
  color: #9f493a;
  margin-top: 16px;
}
.receipt-item {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1fr 1fr 35px;
  gap: 8px;
  margin: 10px 0;
}
.receipt-item input {
  min-width: 0;
}
.partsrow {
  grid-template-columns: 1.4fr 1fr 1fr 0.6fr 0.8fr 0.8fr 35px;
}
.partsrow select {
  padding: 5px;
  font-size: 11px;
}
.filters .field {
  flex: 1;
  min-width: 150px;
}
.stat b {
  overflow-wrap: anywhere;
  font-size: 27px;
}
.toolbar .field {
  min-width: 180px;
}
dialog {
  width: min(920px, 96vw);
}
.row {
  flex-wrap: wrap;
}
.panel p {
  color: #526c5b;
}
.formgrid p {
  color: #526c5b;
}
#ocr-status {
  max-width: 400px;
}
textarea {
  resize: vertical;
}
a {
  color: #34684f;
}
@media (max-width: 700px) {
  .partsrow {
    grid-template-columns: repeat(3, 1fr);
  }
  .receipt-item {
    grid-template-columns: repeat(2, 1fr);
  }
  .pagehead {
    flex-wrap: wrap;
  }
  .notice {
    font-size: 13px;
  }
  aside {
    overflow: visible;
  }
  .filters .field {
    min-width: 130px;
  }
  .logo {
    font-size: 25px;
  }
}

/* Saved places map */
#places-map {
  height: 480px;
  min-height: 300px;
  width: 100%;
  border: 1px solid #dfe5e7;
  border-radius: 14px;
  z-index: 0;
  background: #edf1ed;
}
.place-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 12px;
}
.place-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.place-toolbar input,
.place-toolbar select {
  min-width: 180px;
}
.place-hint,
#place-help,
#map-status {
  font-size: 13px;
  margin: 12px 0;
  color: #526271;
}
.place-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.place-card {
  padding: 20px;
  min-width: 0;
  margin: 0;
}
.place-card h3 {
  margin: 8px 0;
}
.place-kind {
  font-size: 12px;
  font-weight: 700;
}
.place-card p {
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.place-coords {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.place-note {
  white-space: pre-wrap;
}
.place-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.place-pin span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  box-shadow: 0 2px 8px #0005;
}
.picking-place {
  cursor: crosshair !important;
}
.leaflet-popup-content button {
  margin-top: 8px;
}
.leaflet-container a {
  color: #12678a;
}
.leaflet-control-attribution {
  font-size: 11px !important;
}
#place-list h2 {
  margin-top: 24px;
}
@media (max-width: 700px) {
  #places-map {
    height: 380px;
  }
  .place-toolbar label {
    width: 100%;
  }
}

/* Analytics charts */
.chartbox {
  position: relative;
  height: 280px;
  margin-top: 14px;
}

/* Dark theme */
[data-theme="dark"] {
  color: #d7e2da;
  background: #101814;
}
[data-theme="dark"] body {
  background: #101814;
}
[data-theme="dark"] aside {
  background: #0d1f18;
  color: #c5d6cb;
}
[data-theme="dark"] nav button {
  color: #a8bfb1;
}
[data-theme="dark"] nav button.active {
  background: #234436;
  color: #e8f2c4;
}
[data-theme="dark"] nav button:hover {
  background: #1a3529;
}
[data-theme="dark"] .asidebottom button {
  color: #b8ccc0;
  border-color: #33523f;
}
[data-theme="dark"] header {
  color: #7d9184;
  border-color: #223128;
}
[data-theme="dark"] main {
  background: #101814;
}
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] .stat b {
  color: #e6efe8;
}
[data-theme="dark"] p,
[data-theme="dark"] .panel p,
[data-theme="dark"] .formgrid p {
  color: #93a89a;
}
[data-theme="dark"] .stat,
[data-theme="dark"] .panel,
[data-theme="dark"] .vehicle {
  background: #16241c;
  border-color: #24382c;
}
[data-theme="dark"] .stat.emphasis {
  background: #2c3818;
  border-color: #4a5a2a;
}
[data-theme="dark"] .stat small,
[data-theme="dark"] td small,
[data-theme="dark"] .row small {
  color: #82978a;
}
[data-theme="dark"] .panelhead,
[data-theme="dark"] .row {
  border-color: #22352a;
}
[data-theme="dark"] th {
  background: #132019;
  color: #7d9184;
}
[data-theme="dark"] td {
  border-color: #22352a;
  color: #cfe0d4;
}
[data-theme="dark"] button {
  background: #1d3126;
  color: #cfe0d4;
  border-color: #33523f;
}
[data-theme="dark"] button:hover {
  background: #264434;
}
[data-theme="dark"] .primary {
  background: #2f6b4f;
  color: #fff;
  border-color: #2f6b4f;
}
[data-theme="dark"] .primary:hover {
  background: #3a8062;
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0f1b14;
  color: #d7e5da;
  border-color: #2c4636;
}
[data-theme="dark"] .badge {
  background: #22382c;
  color: #8fc7a2;
}
[data-theme="dark"] .badge.warn {
  background: #3d3117;
  color: #d8b25e;
}
[data-theme="dark"] .badge.danger {
  background: #3d2019;
  color: #e08b6f;
}
[data-theme="dark"] .notice {
  background: #332b12;
  border-color: #5a4c22;
  color: #d8c98a;
}
[data-theme="dark"] .callout {
  background: #1c2b20;
}
[data-theme="dark"] .empty {
  color: #6f8577;
}
[data-theme="dark"] dialog {
  background: #16241c;
  color: #d7e2da;
}
[data-theme="dark"] .sectiontitle {
  border-color: #24382c;
}
[data-theme="dark"] .plate {
  border-color: #33523f;
  color: #9db8a6;
}
[data-theme="dark"] .caricon {
  background: #1d3126;
  color: #8fc7a2;
}
[data-theme="dark"] .costbar {
  background: #24382c;
}
[data-theme="dark"] .costbar i {
  background: #4d7a5f;
}
[data-theme="dark"] footer {
  color: #5d7264;
}
[data-theme="dark"] .vehicle .details {
  border-color: #24382c;
}
[data-theme="dark"] #places-map {
  background: #132019;
  border-color: #24382c;
}
[data-theme="dark"] .place-card {
  background: #16241c;
}
[data-theme="dark"] a {
  color: #6fbf8f;
}
[data-theme="dark"] .eyebrow {
  color: #7ba088;
}
[data-theme="dark"] #toast {
  background: #2f6b4f;
}
[data-theme="dark"] .danger-button {
  color: #d88a72;
}
[data-theme="dark"] .muted {
  color: #6f8577;
}

/* === Фирменный стиль animaltrips.by === */
:root {
  font-family:
    "Open Sans",
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #333;
  background: #f5f5f5;
}
h1 {
  color: #111;
}
aside {
  background: #0b2c8f;
  color: #dbe4ff;
}
.logo {
  color: #ffcc51;
}
.logo small {
  color: #aebfff;
}
.navlabel {
  color: #8ea6f0;
}
nav button {
  color: #c3d2ff;
}
nav button.active {
  background: #fa9d0c;
  color: #1a1a1a;
  font-weight: 700;
}
nav button:hover {
  background: #1a3fb0;
}
.asidebottom small {
  color: #9db2ee;
}
.asidebottom button {
  color: #dbe4ff;
  border-color: #3a58c4;
}
.dot {
  background: #fa9d0c;
}
header {
  color: #8a8a8a;
  border-color: #e8e8e8;
}
button {
  background: #fff;
  color: #333;
  border-color: #e0e0e0;
}
button:hover {
  background: #fff3df;
}
.primary {
  background: #fa9d0c;
  color: #fff;
  border-color: #fa9d0c;
}
.primary:hover {
  background: #e08a00;
}
button:focus-visible,
a:focus-visible {
  outline-color: #0d44f9;
}
.stat {
  background: #fff;
  border-color: #ececec;
}
.stat b {
  color: #1a1a1a;
}
.stat.emphasis {
  background: #ffcc51;
  border-color: #f0b93c;
}
.stat.emphasis small {
  color: #5c4a12;
}
.panel,
.vehicle {
  border-color: #ececec;
}
.callout {
  background: #e4eaff;
}
.badge {
  background: #e4eaff;
  color: #0d44f9;
}
.badge.warn {
  background: #fff3d1;
  color: #8a6d1a;
}
.badge.danger {
  background: #ffe4dd;
  color: #b3402a;
}
.caricon {
  background: #fff3df;
  color: #fa9d0c;
}
.costbar {
  background: #eee;
}
.costbar i {
  background: #fa9d0c;
}
a {
  color: #0d44f9;
}
input,
select,
textarea {
  border-color: #dcdcdc;
  color: #333;
  outline-color: #0d44f9;
}
th {
  background: #fafafa;
  color: #888;
}
.plate {
  border-color: #e0cfa8;
  color: #8a6d1a;
  background: #fff8ea;
}
.notice {
  background: #fff3d1;
  border-color: #ecd28a;
  color: #7a5c14;
}
#toast {
  background: #0b2c8f;
}
.sectiontitle {
  border-color: #eee;
}
.eyebrow {
  color: #0d44f9;
}
.vehicle .details {
  border-color: #f0f0f0;
}
.danger-button {
  color: #c0392b;
}
#places-map {
  background: #eef1fb;
  border-color: #e0e0e0;
}

/* Тёмная тема в фирменных цветах */
[data-theme="dark"] aside {
  background: #071c5c;
}
[data-theme="dark"] nav button {
  color: #a9bdf0;
}
[data-theme="dark"] nav button.active {
  background: #fa9d0c;
  color: #1a1a1a;
}
[data-theme="dark"] nav button:hover {
  background: #12297a;
}
[data-theme="dark"] .logo {
  color: #ffcc51;
}
[data-theme="dark"] .logo small {
  color: #7d94d8;
}
[data-theme="dark"] .asidebottom button {
  color: #c3d2ff;
  border-color: #2a3f8f;
}
[data-theme="dark"] .dot {
  background: #fa9d0c;
}
[data-theme="dark"] .primary {
  background: #fa9d0c;
  border-color: #fa9d0c;
  color: #1a1a1a;
}
[data-theme="dark"] .primary:hover {
  background: #ffb13d;
}
[data-theme="dark"] button:hover {
  background: #2a2417;
}
[data-theme="dark"] .stat.emphasis {
  background: #4a3a10;
  border-color: #6b571a;
}
[data-theme="dark"] .stat.emphasis small {
  color: #e8d28a;
}
[data-theme="dark"] .callout {
  background: #131f4a;
}
[data-theme="dark"] .badge {
  background: #16265e;
  color: #9db8ff;
}
[data-theme="dark"] .badge.warn {
  background: #3d3117;
  color: #e8c86a;
}
[data-theme="dark"] .badge.danger {
  background: #3d2019;
  color: #e08b6f;
}
[data-theme="dark"] .caricon {
  background: #2a2417;
  color: #fa9d0c;
}
[data-theme="dark"] .costbar i {
  background: #fa9d0c;
}
[data-theme="dark"] a {
  color: #7aa0ff;
}
[data-theme="dark"] #toast {
  background: #0b2c8f;
}
[data-theme="dark"] .eyebrow {
  color: #7aa0ff;
}
[data-theme="dark"] .notice {
  background: #332b12;
  border-color: #5a4c22;
  color: #e8d28a;
}
[data-theme="dark"] .plate {
  border-color: #5a4c22;
  color: #e8c86a;
  background: #2a2410;
}
[data-theme="dark"] #places-map {
  background: #101a3a;
  border-color: #22315e;
}

/* Личный кабинет: вход, профиль, роли */
.loginwrap {
  min-height: 62vh;
  display: grid;
  place-items: center;
}
.logincard {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 16px;
  padding: 42px 38px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 50px #0b2c8f14;
}
.loginlogo {
  font-size: 46px;
}
.logincard h1 {
  margin: 12px 0 8px;
}
.logincard p {
  margin-bottom: 8px;
}
.logincard .field {
  text-align: left;
  margin: 14px 0;
}
.logincard .primary {
  width: 100%;
  margin-top: 12px;
}
#login-error {
  color: #b3402a;
  min-height: 22px;
  margin-top: 10px;
}
#userchip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #3a58c4;
  flex-wrap: wrap;
}
#userchip:empty {
  display: none;
}
#userchip .chipname {
  color: #fff;
  font-size: 13px;
  flex: 1;
  min-width: 80px;
}
#userchip .chipname small {
  display: block;
  color: #9db2ee;
}
#userchip button {
  width: auto;
  font-size: 11px;
  margin-top: 0;
  padding: 6px 10px;
}
[data-theme="dark"] .logincard {
  background: #16241c;
  border-color: #24382c;
}
[data-role="guest"] nav button,
[data-role="guest"] .asidebottom button {
  display: none;
}
[data-role="viewer"] nav button[onclick="go('settings')"],
[data-role="viewer"] nav button[onclick="go('trash')"],
[data-role="viewer"] nav button[onclick="go('users')"],
[data-role="driver"] nav button[onclick="go('settings')"],
[data-role="driver"] nav button[onclick="go('trash')"],
[data-role="driver"] nav button[onclick="go('users')"],
[data-role="manager"] nav button[onclick="go('settings')"],
[data-role="manager"] nav button[onclick="go('users')"] {
  display: none;
}
[data-role="viewer"] button[onclick*="edit("],
[data-role="viewer"] button[onclick*="removeRecord"],
[data-role="viewer"] button[onclick*="restoreRecord"],
[data-role="viewer"] button[onclick*="emptyTrash"],
[data-role="viewer"] button[onclick*="backup("],
[data-role="viewer"] button[onclick*="import).click"],
[data-role="viewer"] button[onclick*="gcFiles"],
[data-role="viewer"] button[onclick*="rateDialog"],
[data-role="viewer"] button[onclick*="fromReceipt"],
[data-role="viewer"] button[onclick*="demo("],
[data-role="viewer"] button[onclick*="exportCSV"],
[data-role="viewer"] button[onclick*="removeUser"],
[data-role="viewer"] button[onclick*="addStockPart"] {
  display: none;
}
[data-role="manager"] button[onclick*="removeUser"],
[data-role="manager"] button[onclick*="edit('users'"] {
  display: none;
}
/* Водитель: только просмотр, но может вносить заправки и пробег */
[data-role="driver"]
  button[onclick*="edit("]:not([onclick*="edit('fuel'"]):not(
    [onclick*='edit("fuel"']
  ):not([onclick*="edit('mileage'"]):not([onclick*='edit("mileage"']),
[data-role="driver"] button[onclick*="removeRecord"],
[data-role="driver"] button[onclick*="restoreRecord"],
[data-role="driver"] button[onclick*="emptyTrash"],
[data-role="driver"] button[onclick*="backup("],
[data-role="driver"] button[onclick*="import).click"],
[data-role="driver"] button[onclick*="gcFiles"],
[data-role="driver"] button[onclick*="rateDialog"],
[data-role="driver"] button[onclick*="fromReceipt"],
[data-role="driver"] button[onclick*="demo("],
[data-role="driver"] button[onclick*="exportCSV"],
[data-role="driver"] button[onclick*="removeUser"],
[data-role="driver"] button[onclick*="addStockPart"] {
  display: none;
}

/* === Адаптивность: телефон и планшет === */
#menubtn,
#scrim {
  display: none;
}

/* Планшет: уже боковая панель и поля */
@media (min-width: 821px) and (max-width: 1100px) {
  aside {
    width: 205px;
    padding: 26px 15px;
  }
  main {
    margin-left: 205px;
    padding: 0 26px;
  }
  .logo {
    font-size: 20px;
  }
  h1 {
    font-size: 27px;
  }
}

/* Телефон: меню уезжает в выдвижную панель поверх контента */
@media (max-width: 820px) {
  aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 85vw);
    padding: 22px 16px calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-106%);
    transition: transform 0.25s ease;
    z-index: 80;
    overflow-y: auto;
    box-shadow: 0 0 70px rgba(7, 17, 45, 0.35);
  }
  body.menu-open aside {
    transform: none;
  }
  #scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 45, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 70;
  }
  body.menu-open #scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .logo small,
  .navlabel {
    display: block;
  }
  .navlabel {
    margin: 26px 10px 12px;
  }
  nav {
    display: block;
    overflow: visible;
    margin-top: 0;
  }
  nav button {
    width: 100%;
    white-space: normal;
    font-size: 14px;
    padding: 12px 13px;
    min-height: 44px;
  }
  .asidebottom {
    display: block;
    margin-top: 22px;
    font-size: 12px;
  }
  .asidebottom small {
    display: block;
  }
  .asidebottom button {
    width: 100%;
    font-size: 12px;
    margin-top: 8px;
    min-height: 42px;
  }
  main {
    margin: 0;
    padding: 0 14px;
  }
  header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 58px;
    gap: 10px;
    background: #f5f5f5;
    margin: 0 -14px;
    padding: 0 14px;
  }
  [data-theme="dark"] header {
    background: #101814;
  }
  #menubtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 42px;
    height: 42px;
    font-size: 19px;
    border-radius: 10px;
    padding: 0;
  }
  .pagehead {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .pagehead .toolbar {
    justify-content: flex-start;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  input,
  select,
  textarea {
    font-size: 16px; /* отключает авто-зум полей на iOS */
  }
  dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    overflow-y: auto;
  }
  form {
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .tablewrap {
    -webkit-overflow-scrolling: touch;
  }
  .tablewrap table {
    min-width: 620px;
  }
  #toast {
    width: calc(100vw - 32px);
    text-align: center;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  footer {
    flex-direction: column;
    gap: 6px;
  }
  #places-map {
    height: 340px;
  }
  .loginwrap {
    padding: 18px 4px;
  }
}

/* Очень узкие экраны */
@media (max-width: 400px) {
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat {
    padding: 13px;
  }
  .stat b {
    font-size: 22px;
  }
}
