:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --primary: #0f5666;
  --primary-deep: #0a3f4f;
  --primary-soft: #eaf6f7;
  --secondary: #f4a62a;
  --text: #1b2c35;
  --muted: #5d6f7c;
  --line: #e7edf3;
  --green: #1d7f5a;
  --green-soft: #eafaf2;
  --amber: #d98a00;
  --amber-soft: #fff5df;
  --red: #be4f4f;
  --red-soft: #fdecec;
  --blue: #1c5dbe;
  --blue-soft: #edf4ff;
  --shadow: 0 18px 36px rgba(15, 86, 102, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}


/* =========================
   LOGIN
========================= */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    #f2f6f9,
    #eaf5f8
  );

  padding: 22px;
}

.login-card {
  width: min(430px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px 26px;
}

.login-logo {
  margin-bottom: 20px;
}

.login-card h1 {
  margin: 6px 0 10px;
  font-size: 2rem;
}

.login-description {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.login-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  outline: none;
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 70px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
}

.login-message {
  min-height: 20px;
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}


/* =========================
   COMMON
========================= */

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    var(--secondary),
    #ffcf70
  );
  border-radius: 16px;
  color: var(--primary-deep);
  font-weight: 800;
}

.brand-panel strong,
.brand-panel small {
  display: block;
}

.brand-panel small {
  color: rgba(255, 255, 255, 0.7);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--primary-deep)
  );

  color: white;

  box-shadow:
    0 16px 28px rgba(20, 92, 111, 0.2);
}

.btn-light {
  background: white;
  color: var(--primary);
  border: 1px solid var(--line);
}

.full-width {
  width: 100%;
}


/* =========================
   DASHBOARD
========================= */

.dashboard-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(
    180deg,
    #0d3f4e 0%,
    #0a2d3b 100%
  );

  color: white;

  padding: 28px 20px;

  display: flex;
  flex-direction: column;

  gap: 28px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  display: block;
  border: none;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-card {
  margin-top: auto;
  padding: 18px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-card .label {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-card strong,
.sidebar-card small {
  display: block;
}

.dashboard-main {
  padding: 28px;
}

.topbar-dashboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
}

.topbar-dashboard h1 {
  font-size: clamp(2rem, 3vw, 2.5rem);
}

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


/* =========================
   STATS
========================= */

.stats-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(180px, 1fr));

  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}

.stat-card.accent {
  background: linear-gradient(
    135deg,
    var(--primary-soft),
    #ffffff
  );
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: 2.1rem;
  margin: 10px 0 6px;
}


/* =========================
   PANEL
========================= */

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

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.search-box input {
  min-width: 250px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
}


/* =========================
   TRIPS
========================= */

.trip-list {
  display: grid;
  gap: 14px;
}

.trip-card {
  display: grid;
  grid-template-columns:
    1.1fr 1.5fr auto;

  gap: 16px;
  align-items: center;

  background: #fff;

  border: 1px solid var(--line);

  border-radius: 18px;

  padding: 18px;
}

.trip-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trip-customer {
  font-size: 1.15rem;
  font-weight: 800;
}

.trip-route {
  color: var(--muted);
  font-size: 0.94rem;
}

.trip-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.trip-date {
  font-weight: 700;
}

.trip-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.trip-notes {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 5px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-upcoming {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-completed {
  background: var(--green-soft);
  color: var(--green);
}

.status-cancelled {
  background: var(--red-soft);
  color: var(--red);
}

.status-call-only {
  background: #fff3eb;
  color: #d9792d;
}

.status-new {
  background: #f0f1ff;
  color: #5a5cc4;
}

.trip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.small-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.small-btn.primary {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary);
}

.small-btn.danger {
  border-color: #e6b7b5;
  background: #fff0ef;
  color: #a62e2b;
}


/* =========================
   DRAWER
========================= */

.trip-drawer {
  position: fixed;
  right: 20px;
  top: 20px;
  bottom: 20px;

  width: min(
    420px,
    calc(100% - 30px)
  );

  background: white;

  border: 1px solid var(--line);

  border-radius: 24px;

  box-shadow:
    0 30px 50px rgba(16, 37, 46, 0.18);

  padding: 18px;

  overflow-y: auto;

  z-index: 40;
}

.trip-drawer.hidden {
  display: none;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.icon-btn {
  border: none;
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  width: 38px;
  height: 38px;
}

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

.manual-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.manual-form input,
.manual-form select,
.manual-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}


/* =========================
   TOAST
========================= */

.toast {
  position: fixed;

  right: 18px;
  bottom: 18px;

  background: rgba(15, 86, 102, 0.95);

  color: white;

  padding: 12px 16px;

  border-radius: 12px;

  box-shadow: var(--shadow);

  opacity: 0;

  transform: translateY(10px);

  pointer-events: none;

  transition: all 0.2s ease;

  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}


/* =========================
   EMPTY STATE
========================= */

.empty-state {
  padding: 45px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

  .dashboard-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-bottom: 20px;
  }

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

  .trip-card {
    grid-template-columns: 1fr;
  }

  .trip-actions {
    justify-content: flex-start;
  }

}

@media (max-width: 640px) {

  .dashboard-main {
    padding: 18px;
  }

  .topbar-dashboard,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    min-width: 100%;
  }

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

  .login-card {
    padding: 26px 20px;
  }
  .brand-login {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-login strong,
.brand-login small {
  display: block;
}

.brand-login small {
  color: var(--muted);
  margin-top: 3px;
}

.login-heading {
  margin-bottom: 24px;
}

.login-heading h1 {
  margin-bottom: 10px;
}

.login-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 600;
}

.login-form button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.back-link {
  display: block;
  margin-top: 20px;
  text-align: center;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}


}