:root {
  color-scheme: light;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #202435;
  --muted: #737b8c;
  --line: #dfe4ee;
  --primary: #26304f;
  --primary-dark: #151c35;
  --accent: #7d63df;
  --success: #23b87a;
  --danger: #c03535;
  --warning: #d98b22;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(38, 48, 79, 0.94), rgba(125, 99, 223, 0.78)),
    url("https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-card {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 24px 56px rgba(14, 18, 32, 0.34);
  padding: 30px;
}

.login-copy {
  margin: 8px 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.login-error {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
}

.app-shell {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(32, 36, 53, 0.08);
  padding: 14px 18px;
  backdrop-filter: blur(12px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

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

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.18;
}

h1 span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

h2 {
  font-size: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.module-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.module-tabs a {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(32, 36, 53, 0.05);
  font-size: 14px;
  font-weight: 700;
  padding: 13px 12px;
  text-align: center;
  text-decoration: none;
}

.module-tabs a.active,
.module-tabs a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.entry-form,
.records-panel {
  display: grid;
  gap: 16px;
}

.form-section,
.records-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(32, 36, 53, 0.07);
  padding: 22px;
}

.section-title,
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.form-grid,
.tire-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 12px 13px;
  background: #f8f9fb;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(125, 99, 223, 0.17);
  border-color: var(--accent);
  background: #fff;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 42px;
  padding: 10px 15px;
}

.primary,
.save-button {
  background: var(--primary);
  color: #fff;
}

.primary {
  width: 100%;
}

.save-button {
  min-width: 210px;
}

.primary:hover,
.save-button:hover {
  background: var(--primary-dark);
}

.ghost {
  background: #eef1f7;
  color: var(--primary);
}

.ghost:hover {
  background: #e1e6f0;
}

.dynamic-list {
  display: grid;
  gap: 12px;
}

.service-row {
  display: grid;
  grid-template-columns: 1.1fr 2fr 0.7fr auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 12px;
}

.check-grid label {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 12px;
}

.list-toolbar input {
  max-width: 440px;
}

.status-message {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.records {
  display: grid;
  gap: 12px;
}

.empty {
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.record {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.record strong {
  display: block;
  margin-bottom: 4px;
}

.record p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: #f0edff;
  border: 1px solid #d8d0ff;
  border-radius: 8px;
  color: #5b43bb;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
  margin-bottom: 6px;
}

.danger {
  background: #ffe7e7;
  color: var(--danger);
}

@media (max-width: 980px) {
  .topbar,
  .section-title,
  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .top-actions button,
  .save-button {
    width: 100%;
  }

  .module-tabs,
  .form-grid,
  .tire-grid,
  .check-grid,
  .record,
  .service-row {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .list-toolbar input {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .topbar {
    position: static;
  }

  .brand-block {
    align-items: flex-start;
  }

  h1 {
    font-size: 22px;
  }
}
