@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --color-bg: #f4f7fb;
  --color-surface: #ffffff;
  --color-surface-2: #f1f5f9;
  --color-primary: #155eef;
  --color-primary-hover: #1249b9;
  --color-accent: #0f766e;
  --color-danger: #dc2626;
  --color-warning: #b45309;
  --color-success: #15803d;
  --color-text-primary: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #7b8794;
  --color-border: #d8e0eb;
  --color-divider: #e8eef6;
  --shadow-glow: 0 12px 24px rgba(21, 94, 239, 0.18);
  --shadow-panel: 0 14px 34px rgba(15, 23, 42, 0.07);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  text-size-adjust: 100%;
}

body.client-body,
body.auth-body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text-primary);
  background: linear-gradient(180deg, #fbfdff 0%, var(--color-bg) 42%, #eef4fb 100%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  max-width: 100%;
  display: block;
}

/* Shell */
.client-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.client-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--color-border);
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.04);
}

.client-brand {
  min-height: 72px;
  padding: 4px 10px 20px;
  border-bottom: 1px solid var(--color-divider);
}

.client-brand-mark {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  color: var(--color-primary);
  text-transform: uppercase;
}

.client-brand-name {
  display: block;
  margin-top: 5px;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 800;
}

.client-nav {
  display: grid;
  gap: 7px;
}

.client-sidebar-footer {
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
}

.client-nav-item,
.client-nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.2;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.client-nav-button {
  appearance: none;
}

.button_to {
  margin: 0;
}

.client-nav-item:hover,
.client-nav-button:hover,
.client-nav-item.active {
  color: var(--color-text-primary);
  background: var(--color-surface-2);
  border-color: var(--color-border);
}

.client-nav-item.active {
  font-weight: 700;
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: var(--color-primary);
  background: rgba(21, 94, 239, 0.1);
  font-size: 13px;
  font-weight: 800;
}

.nav-icon::before {
  line-height: 1;
}

.nav-icon-dashboard::before { content: "D"; }
.nav-icon-vehicles::before { content: "V"; }
.nav-icon-rentals::before { content: "R"; }
.nav-icon-trips::before { content: "T"; }
.nav-icon-documents::before { content: "F"; }
.nav-icon-profile::before { content: "U"; }
.nav-icon-logout::before { content: "O"; }

.client-main {
  min-width: 0;
}

.client-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 0 clamp(18px, 3vw, 36px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--color-divider);
  backdrop-filter: blur(16px);
}

.client-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px clamp(18px, 3vw, 36px) 56px;
}

/* Page */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.page-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

.page-subtitle,
.muted {
  color: var(--color-text-secondary);
}

.page-subtitle {
  margin: 10px 0 0;
  max-width: 660px;
  line-height: 1.55;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.25;
}

/* Layout primitives */
.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.stack {
  display: grid;
  gap: 16px;
}

.split-row,
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--color-surface-2);
  border-radius: var(--radius);
}

.split-row > :last-child,
.info-row > :last-child {
  text-align: right;
  font-weight: 700;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.actions-between {
  justify-content: space-between;
}

.center-block {
  width: min(500px, 100%);
  margin: 24px auto 0;
}

.panel,
.vehicle-card,
.auth-card,
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

.panel {
  padding: clamp(18px, 2.4vw, 24px);
}

.panel-soft {
  background: linear-gradient(135deg, #ffffff, #f4f8fd);
}

.panel-danger {
  border-color: rgba(220, 38, 38, 0.35);
}

/* Buttons */
.btn {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  color: var(--color-text-primary);
  font-weight: 800;
  line-height: 1.1;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  border-color: #b5c2d4;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.btn-primary {
  color: #ffffff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-danger {
  color: #ffffff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-full {
  width: 100%;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Chips and status */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  border-radius: 999px;
}

.chip-success {
  color: var(--color-success);
  background: rgba(21, 128, 61, 0.1);
}

.chip-warning {
  color: var(--color-warning);
  background: rgba(180, 83, 9, 0.1);
}

.chip-danger {
  color: var(--color-danger);
  background: rgba(220, 38, 38, 0.1);
}

.chip-accent {
  color: var(--color-accent);
  background: rgba(15, 118, 110, 0.1);
}

.chip-muted {
  color: var(--color-text-secondary);
  background: rgba(82, 96, 113, 0.1);
}

/* Cards */
.stat-card,
.metric {
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.metric {
  min-height: 78px;
  background: #f8fafc;
  border-color: var(--color-divider);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.metric-label {
  display: block;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  display: block;
  margin-top: 5px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
  font-weight: 800;
  word-break: break-word;
}

.stat-value {
  margin-bottom: 8px;
  color: var(--color-primary);
  font-size: 36px;
  font-weight: 800;
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vehicle-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.vehicle-card {
  overflow: hidden;
}

.vehicle-card.is-muted {
  opacity: 0.78;
}

.vehicle-media,
.vehicle-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 154px;
  background:
    radial-gradient(circle at 28% 24%, rgba(21, 94, 239, 0.16), transparent 32%),
    linear-gradient(145deg, #fbfdff, #e7eef7);
  border-bottom: 1px solid var(--color-divider);
}

.vehicle-media.is-warning {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.12), #eef3f8);
}

.vehicle-media.is-danger {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.12), #eef3f8);
}

.vehicle-symbol,
.doc-symbol,
.feature-symbol {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  font-size: 22px;
  font-weight: 800;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.vehicle-symbol::before {
  content: "BD";
}

.vehicle-plate {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: calc(100% - 32px);
  padding: 0 12px;
  overflow: hidden;
  color: #ffffff;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-primary);
  border-radius: 6px;
}

.vehicle-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.vehicle-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.vehicle-summary {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  margin-top: 16px;
}

.vehicle-hero {
  aspect-ratio: 1;
  min-height: 0;
  border: 0;
  border-radius: var(--radius);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

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

.label {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.input,
.select,
textarea.input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--color-text-primary);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
}

textarea.input {
  min-height: 110px;
  padding-top: 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
textarea.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-secondary);
}

/* Tables */
.table-panel {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-divider);
}

.table th {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0;
}

/* Components */
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 14px;
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.step::before {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  content: attr(data-step);
  color: var(--color-text-secondary);
  background: var(--color-surface-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.step.is-current {
  color: var(--color-primary);
}

.step.is-current::before {
  color: #ffffff;
  background: var(--color-primary);
}

.step.is-done {
  color: var(--color-success);
}

.step.is-done::before {
  content: "✓";
  color: #ffffff;
  background: var(--color-success);
}

.step-separator {
  flex: 0 0 auto;
  color: var(--color-text-muted);
}

.timer-card {
  text-align: center;
  padding: clamp(26px, 5vw, 44px);
}

.timer-label {
  margin: 0 0 14px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.timer-display {
  color: var(--color-primary);
  font-size: clamp(42px, 8vw, 62px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.object-row,
.doc-row,
.trip-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--color-surface-2);
  border-radius: var(--radius);
}

.trip-card {
  align-items: flex-start;
  border: 1px solid rgba(21, 128, 61, 0.2);
  background: rgba(21, 128, 61, 0.05);
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notice-box {
  padding: 16px;
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: var(--radius);
}

.notice-box.info {
  background: rgba(21, 94, 239, 0.06);
  border-color: rgba(21, 94, 239, 0.2);
}

.choice-card {
  padding: 22px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
}

.choice-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.upload-zone,
.photo-box {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.upload-zone {
  padding: 38px 18px;
}

.upload-zone:hover,
.photo-box:hover {
  border-color: var(--color-primary);
  background: rgba(21, 94, 239, 0.04);
}

.photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
}

.photo-box {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}

.photo-box.is-uploaded {
  border-color: var(--color-success);
  background: rgba(21, 128, 61, 0.04);
}

.photo-preview {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: var(--color-surface-2);
  border-radius: 999px;
}

.progress-bar {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.quick-link {
  min-height: 118px;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
}

.avatar {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: #ffffff;
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 999px;
}

/* Auth */
.auth-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 30px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

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

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* States */
.flash {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-weight: 800;
}

.flash-alert {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.flash-notice {
  color: var(--color-success);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.error-list {
  margin: 0 0 18px;
  padding: 14px 18px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
}

.empty-state {
  padding: 34px;
  color: var(--color-text-secondary);
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

@media (max-width: 960px) {
  .client-shell {
    grid-template-columns: 1fr;
  }

  .client-sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .client-brand {
    min-height: auto;
    padding-bottom: 16px;
  }

  .client-nav,
  .client-sidebar-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-sidebar-footer {
    margin-top: 0;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid,
  .vehicle-summary {
    grid-template-columns: 1fr;
  }

  .page-head {
    display: grid;
  }

  .vehicle-hero {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 640px) {
  .client-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .client-user {
    width: 100%;
    justify-content: space-between;
  }

  .client-nav,
  .client-sidebar-footer,
  .choice-actions {
    grid-template-columns: 1fr;
  }

  .actions,
  .actions-between,
  .auth-links,
  .row-top,
  .object-row,
  .doc-row,
  .trip-card,
  .split-row,
  .info-row {
    align-items: stretch;
    flex-direction: column;
  }

  .split-row > :last-child,
  .info-row > :last-child {
    text-align: left;
  }

  .btn {
    width: 100%;
  }

  .chip {
    width: fit-content;
  }
}
