:root {
  --ink: #17202a;
  --ink-soft: #334155;
  --muted: #667085;
  --line: #d8e0e8;
  --page: #f3f6f8;
  --panel: #ffffff;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #e7f5f3;
  --pending: #f59e0b;
  --pending-soft: #fff7df;
  --accepted: #16a34a;
  --accepted-soft: #eaf8ef;
  --refused: #dc2626;
  --refused-soft: #fff0f0;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.08);
  --shadow-soft: 0 8px 24px rgba(23, 32, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(243, 246, 248, 0) 320px),
    var(--page);
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(15, 33, 42, 0.88), rgba(15, 118, 110, 0.72)),
    url("https://images.unsplash.com/photo-1486262715619-67b85e0b08d3?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  width: min(1020px, 100%);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  box-shadow: 0 26px 70px rgba(3, 7, 18, 0.32);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: 48px;
  color: #fff;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.42));
}

.brand-mark {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
  letter-spacing: 0;
}

.brand-panel h1,
.topbar h1,
.login-card h2,
.panel h2,
.vehicle-row h3 {
  margin: 0;
}

.brand-panel h1 {
  max-width: 560px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.brand-panel p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  line-height: 1.6;
}

.login-card,
.panel {
  background: var(--panel);
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
}

.hint,
.section-head p,
.vehicle-main p,
.vehicle-status p,
.user-row span {
  color: var(--muted);
}

.hint {
  margin: 18px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 8px;
}

.alert-danger {
  color: #991b1b;
  background: #fee2e2;
}

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input::placeholder {
  color: #98a2b3;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #119184, var(--primary));
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.18);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #ef4444, var(--refused));
}

.btn-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 48px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.34), rgba(15, 23, 42, 0)),
    #17202a;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.topbar h1 {
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #99f6e4;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.86);
}

.layout {
  display: grid;
  gap: 22px;
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 48px) 50px;
}

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

.stat,
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: #fff;
  border-left-width: 6px;
}

.stat::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  opacity: 0.16;
  background: currentColor;
}

.stat span {
  color: var(--muted);
  font-weight: 750;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 2.1rem;
  line-height: 1;
}

.stat-pending {
  color: var(--pending);
  border-left-color: var(--pending);
}

.stat-accepted {
  color: var(--accepted);
  border-left-color: var(--accepted);
}

.stat-refused {
  color: var(--refused);
  border-left-color: var(--refused);
}

.content-grid {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  padding: 22px;
}

.panel > h2 {
  margin-bottom: 18px;
}

.list-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head p {
  margin: 7px 0 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}

.chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  cursor: pointer;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.chip:hover {
  border-color: #b8c4cf;
  color: var(--ink);
}

.chip.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

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

.vehicle-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(220px, 1fr) minmax(155px, 0.7fr) minmax(250px, 1.15fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 7px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.vehicle-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.status-pending {
  border-left-color: var(--pending);
  background: linear-gradient(90deg, var(--pending-soft), #fff 42%);
}

.status-accepted {
  border-left-color: var(--accepted);
  background: linear-gradient(90deg, var(--accepted-soft), #fff 42%);
}

.status-refused {
  border-left-color: var(--refused);
  background: linear-gradient(90deg, var(--refused-soft), #fff 42%);
}

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

.status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  background: var(--pending);
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.14);
}

.status-accepted .status-dot {
  background: var(--accepted);
  box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.14);
}

.status-refused .status-dot {
  background: var(--refused);
  box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.14);
}

.vehicle-main h3 {
  overflow-wrap: anywhere;
}

.vehicle-main p,
.vehicle-status p {
  margin: 5px 0 0;
  line-height: 1.45;
}

.vehicle-times {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

.vehicle-times span {
  padding-left: 10px;
  border-left: 2px solid #e7edf2;
}

.vehicle-times strong {
  display: block;
  color: var(--ink);
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 11px;
  color: #fff;
  background: var(--pending);
  font-size: 0.82rem;
  font-weight: 900;
}

.status-accepted .badge {
  background: var(--accepted);
}

.status-refused .badge {
  background: var(--refused);
}

.vehicle-actions {
  display: grid;
  gap: 9px;
}

.review-form {
  display: grid;
  grid-template-columns: 112px minmax(150px, 1fr);
  gap: 8px;
}

.review-form input[name="controller_reason"],
.review-form .btn {
  grid-column: span 2;
}

.empty-state {
  margin: 0;
  padding: 28px;
  border: 1px dashed #b9c5d0;
  border-radius: 10px;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
}

.admin-panel {
  margin-top: 4px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 22px;
}

.users-table {
  display: grid;
  gap: 10px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.user-row span {
  display: block;
  margin-top: 4px;
}

@media (max-width: 1120px) {
  .content-grid,
  .admin-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

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

  .brand-panel {
    min-height: 330px;
  }
}

@media (max-width: 720px) {
  .login-page {
    padding: 14px;
  }

  .topbar,
  .section-head,
  .user-nav,
  .user-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .vehicle-row {
    grid-template-columns: 1fr;
  }

  .brand-panel,
  .login-card {
    padding: 28px;
  }

  .layout {
    padding-inline: 14px;
  }

  .panel {
    padding: 18px;
  }

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

  .review-form input[name="controller_reason"],
  .review-form .btn {
    grid-column: auto;
  }
}


.table-wrapper {
    overflow-x: auto;
}

.planning-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.planning-table th {
    text-align: left;
    padding: 12px;
    background: var(--surface-alt);
    border-bottom: 2px solid var(--line);
    font-weight: 600;
}

.planning-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.planning-table tbody tr:hover {
    background: rgba(0,0,0,0.03);
}

.status-pending .badge {
    background: #f59e0b;
    color: white;
}

.status-accepted .badge {
    background: #22c55e;
    color: white;
}

.status-refused .badge {
    background: #ef4444;
    color: white;
}