:root {
  --ink: #071725;
  --muted: #60717c;
  --line: #d6e2e8;
  --soft: #f4fafb;
  --panel: #fff;
  --brand: #09a9c6;
  --deep: #03101c;
  --sun: #ffb21a;
  --orange: #ff6b00;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(5, 22, 35, .1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(37, 214, 229, .12), transparent 32%),
    linear-gradient(315deg, rgba(255, 178, 26, .12), transparent 30%),
    #eef6f8;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

aside {
  background:
    radial-gradient(circle at 28% 10%, rgba(37, 214, 229, .26), transparent 24%),
    linear-gradient(180deg, #03101c 0%, #061b2d 52%, #0a2736 100%);
  color: white;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
}

.brand span {
  color: rgba(255,255,255,.72);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav, .ghost {
  min-height: 40px;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  color: rgba(255,255,255,.78);
  background: transparent;
  font-weight: 700;
}

.nav.active, .nav:hover {
  background: linear-gradient(90deg, rgba(9, 169, 198, .25), rgba(255, 178, 26, .14));
  color: white;
}

.ghost {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.16);
}

main {
  padding: 24px;
}

.hero {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--orange), var(--sun), var(--brand)) 1;
}

.hero img {
  width: min(980px, 100%);
  max-height: 205px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 18px rgba(5, 22, 35, .1));
}

.hero h2 {
  margin: 0;
  font-size: 24px;
}

.hero p {
  margin: 4px 0 0;
  color: var(--muted);
}

.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.panel h2, .panel h3 {
  margin: 0 0 12px;
}

.view { display: none; }
.view.active { display: grid; gap: 16px; }
.two { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); align-items: start; }

.auth-panel {
  max-width: 520px;
  display: none;
}

.auth-panel.active {
  display: block;
}

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

.card {
  padding: 16px;
  border-top: 4px solid var(--brand);
}

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

.card strong {
  font-size: 26px;
}

.form {
  display: grid;
  gap: 11px;
}

.two-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full { grid-column: 1 / -1; }

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

form button {
  min-height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #087ea0);
  color: white;
  font-weight: 800;
}

.small-btn {
  min-height: 30px;
  border-radius: 8px;
  padding: 6px 10px;
  background: #e9f8fb;
  color: var(--deep);
  border: 1px solid var(--line);
  font-weight: 800;
}

.vehicle-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
}

.vehicle-cell img,
.vehicle-placeholder {
  width: 70px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #e9f8fb;
}

.vehicle-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

button.secondary,
form button.secondary {
  background: white;
  color: var(--deep);
  border: 1px solid var(--line);
}

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

.toolbar {
  margin-bottom: 14px;
}

.toolbar select,
.toolbar input {
  width: auto;
  min-width: 230px;
}

.alert-list {
  display: grid;
  gap: 9px;
}

.alert-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--sun);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  font-size: 14px;
}

.calendar-grid {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.calendar-row {
  display: grid;
  grid-template-columns: 210px repeat(7, minmax(100px, 1fr));
  gap: 6px;
  min-width: 920px;
}

.calendar-head,
.calendar-vehicle,
.calendar-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 9px;
  min-height: 52px;
  font-size: 13px;
}

.calendar-head {
  background: #e9f8fb;
  color: var(--deep);
  font-weight: 800;
  text-align: center;
  min-height: 38px;
}

.calendar-vehicle {
  font-weight: 800;
}

.calendar-day.busy {
  background: #fff7e7;
  border-color: #ffd391;
  color: #704100;
}

.calendar-day.service {
  background: #fff2f0;
  border-color: #ffc9c2;
  color: var(--danger);
}

.print-preview {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  line-height: 1.42;
  font-size: 13px;
}

.print-preview img {
  display: block;
  width: 420px;
  max-width: 88%;
  margin: 0 auto 12px;
}

.print-preview h1,
.print-preview h2 {
  text-align: center;
  margin: 0;
}

.print-preview h2 {
  margin: 4px 0 18px;
  color: #0b7993;
  font-size: 14px;
}

.print-preview h3 {
  margin: 15px 0 7px;
  font-size: 13px;
  border-bottom: 1px solid #cfd7de;
  padding-bottom: 4px;
}

.money-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

@media print {
  aside, .hero, .no-print, .view:not(.active) { display: none !important; }
  .app { display: block; }
  main { padding: 0; }
  .panel, .print-preview { border: 0; box-shadow: none; padding: 0; }
}

.notice {
  margin-top: 12px;
  color: var(--danger);
  font-size: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: white;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  background: #e9f8fb;
  color: var(--deep);
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  aside { position: sticky; top: 0; z-index: 3; padding: 14px; }
  nav { display: flex; overflow-x: auto; }
  .nav { flex: 0 0 auto; }
  .ghost { display: none; }
  main { padding: 16px; }
  .stats, .two { grid-template-columns: 1fr; }
}
