:root {
  --bg: #eff1f3;
  --surface: #ffffff;
  --surface-soft: #f3f5f8;
  --text: #00356f;
  --muted: #4a6186;
  --brand-blue: #00356f;
  --brand-blue-deep: #002a5b;
  --brand-blue-2: #0a438d;
  --brand-yellow: #ffcc00;
  --brand-yellow-deep: #f1b800;
  --line: #d2dce9;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Rajdhani", "Barlow", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #e8ecf2 0%, #f3f5f8 180px, var(--bg) 100%),
    repeating-linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.015) 0,
      rgba(0, 0, 0, 0.015) 8px,
      transparent 8px,
      transparent 16px
    );
}

a {
  color: inherit;
}

.shell {
  width: calc(100% - 2rem);
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 30;
}

.utility-bar {
  background: var(--brand-blue-deep);
  color: #f4f6f8;
  font-size: 0.95rem;
  border-bottom: 5px solid var(--brand-yellow);
}

.utility-content {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  padding-left: 320px;
}

.utility-content a {
  text-decoration: none;
}

.utility-logo-link {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  display: inline-flex;
  justify-content: flex-start;
}

.utility-logo {
  height: 88px;
  width: auto;
  display: block;
}

.brand-bar {
  background: #ffffff;
  border-bottom: 2px solid #d9e1ec;
  box-shadow: var(--shadow);
}

.brand-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-wordmark strong {
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--brand-blue-deep);
}

.brand-wordmark small {
  font-size: 0.78rem;
  color: #335682;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #294c7a;
  font-weight: 700;
}

.user-meta form {
  margin: 0;
}

.btn-logout {
  padding: 0.3rem 0.65rem;
  width: auto;
  border-color: #9bb3d4;
  color: var(--brand-blue-deep);
  background: #ffffff;
}

.btn-logout:hover {
  background: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: var(--brand-blue-deep);
}

.main-nav a {
  text-decoration: none;
  border: 1px solid #c9d5e7;
  color: #1c3f73;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  transition: 0.2s ease;
}

.main-nav a:hover {
  border-color: #9db3d3;
  background: #f1f4f9;
}

.main-nav a.active {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow);
  color: var(--brand-blue-deep);
}

main {
  flex: 1 0 auto;
  padding: 1.35rem 0 calc(2.5rem + 64px);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin-top: 0;
  background: var(--brand-blue-deep);
  border-top: 5px solid var(--brand-yellow);
  z-index: 25;
}

.site-footer-content {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #f4f6f8;
  font-size: 0.9rem;
}


.hero {
  background: #eceff2;
  color: var(--brand-blue-deep);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1rem;
  border: 1px solid #d4dce7;
}

.eyebrow {
  margin: 0;
  color: var(--brand-blue);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.hero h1 {
  margin: 0.45rem 0 0.5rem;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.1;
  font-style: italic;
  text-transform: uppercase;
}

.hero-copy {
  margin: 0;
  color: #496083;
  font-size: 1.03rem;
  max-width: 58ch;
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn {
  text-decoration: none;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand-yellow);
  color: var(--brand-blue-deep);
}

.btn-secondary {
  border-color: #9bb3d4;
  color: var(--brand-blue-deep);
  background: #ffffff;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -55% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 196, 0, 0.2) 0%, rgba(245, 196, 0, 0) 72%);
}

.card h2,
.panel h2 {
  margin: 0 0 0.55rem;
  font-size: 1.08rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.card p {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.62rem;
}

input,
select,
button {
  width: 100%;
  border: 1px solid #ccd3dc;
  border-radius: 10px;
  padding: 0.58rem 0.72rem;
  font: inherit;
  background: #ffffff;
}

textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid #ccd3dc;
  border-radius: 10px;
  padding: 0.58rem 0.72rem;
  font: inherit;
  resize: vertical;
}

.inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.check-field input {
  width: auto;
}

button {
  background: var(--brand-blue-deep);
  color: #ffffff;
  border-color: var(--brand-blue-deep);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--brand-blue);
}

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

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

th,
td {
  text-align: left;
  padding: 0.62rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.86rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vehicle-thumb-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.vehicle-thumb {
  width: 48px;
  height: 32px;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  border: 1px solid #c9d5e6;
  background: #ffffff;
  flex: 0 0 auto;
}

.btn-link {
  color: var(--brand-blue);
  font-weight: 700;
  text-decoration: none;
}

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

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.table-actions form {
  margin: 0;
}

.permission-block {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
}

.permission-block strong {
  display: block;
  margin-bottom: 0.45rem;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
}

.permission-groups {
  display: grid;
  gap: 0.65rem;
}

.permission-group {
  border: 1px solid #d8e0ec;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.55rem 0.65rem;
}

.permission-group h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  color: var(--brand-blue-deep);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 1100px) {
  .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }
}

.danger-btn {
  background: #9d1f1f;
  border-color: #9d1f1f;
}

.danger-btn:hover {
  background: #7b1717;
}

.meta-line {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-error {
  margin: 0 0 0.65rem;
  background: #fff0f0;
  color: #8c2020;
  border: 1px solid #f0b4b4;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-weight: 700;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.image-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.image-card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  object-position: center;
  background: #f7f9fc;
  display: block;
}

.image-meta {
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.image-meta strong {
  color: var(--brand-blue-deep);
  font-size: 0.85rem;
}

.image-meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.schedule-meta {
  margin: 0;
  color: var(--muted);
}

.schedule-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.schedule-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.schedule-jump-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.schedule-date-input {
  border: 1px solid #9bb3d4;
  border-radius: 10px;
  padding: 0.47rem 0.6rem;
  font: inherit;
  color: var(--brand-blue-deep);
  background: #ffffff;
}

.schedule-chip {
  color: #2f3540;
  border-color: #b9c2ce;
}

.mobile-planning {
  display: none;
}

.mobile-planning-head h3 {
  margin: 0;
}

.mobile-planning-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.mobile-planning-controls {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.mobile-planning-controls .btn {
  text-align: center;
}

.mobile-focus-form {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}

.mobile-planning-stats {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.mobile-vehicle-list {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.55rem;
}

.mobile-vehicle-card {
  border: 1px solid #d3dcea;
  border-radius: 12px;
  padding: 0.65rem;
  background: #ffffff;
}

.mobile-vehicle-card.is-busy {
  border-color: #dcb235;
  background: #fff9e8;
}

.mobile-vehicle-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.mobile-vehicle-header p {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.mobile-status {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid #c6d3e5;
  background: #f4f7fb;
}

.mobile-vehicle-card.is-busy .mobile-status {
  border-color: #d2a700;
  background: #ffe08a;
  color: #534117;
}

.mobile-assignment-list {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.38rem;
}

.mobile-assignment-item {
  background: #ffffff;
  border: 1px solid #e1e7f1;
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  display: grid;
  gap: 0.1rem;
}

.mobile-assignment-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.schedule-legend {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
}

.legend-dot {
  width: 13px;
  height: 13px;
  display: inline-block;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: -2px;
}

.legend-assignment {
  background: #f6c717;
  border: 1px solid #c89d00;
}

.legend-weekend {
  background: #eef1f5;
  border: 1px solid #d9e0e8;
}

.legend-today {
  background: var(--brand-blue);
}

.schedule-board {
  padding: 0 0 12px;
  overflow: auto;
  max-height: 72vh;
  scrollbar-gutter: stable;
}

.schedule-head {
  display: grid;
  grid-template-columns: minmax(280px, 280px) auto;
  position: sticky;
  top: 0;
  z-index: 20;
}

.vehicle-cell {
  position: sticky;
  left: 0;
  min-width: 280px;
  z-index: 30;
  background: #ffffff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
}

.vehicle-cell span {
  color: var(--muted);
  font-size: 0.88rem;
}

.schedule-vehicle-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.schedule-vehicle-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.schedule-vehicle-thumb {
  width: 56px;
  height: 38px;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  border: 1px solid #c9d5e6;
  background: #ffffff;
  flex: 0 0 auto;
}

.vehicle-head {
  z-index: 40;
  background: var(--surface-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-head-wrap {
  position: relative;
  z-index: 5;
  min-width: max(900px, var(--timeline-width));
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.month-row {
  display: grid;
  grid-template-columns: repeat(var(--days), 1fr);
  background: #f3f5f8;
}

.month-cell {
  border-right: 1px solid var(--line);
  text-align: center;
  padding: 0.35rem 0.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #505866;
}

.day-row {
  display: grid;
  grid-template-columns: repeat(var(--days), 1fr);
  background: #fbfcfd;
}

.day-cell {
  border-right: 1px solid #e6ebf1;
  text-align: center;
  padding: 0.35rem 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.05;
}

.day-cell strong {
  font-size: 0.78rem;
}

.day-cell small {
  font-size: 0.68rem;
  color: var(--muted);
}

.day-cell.is-weekend {
  background: #f3f5f9;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(280px, 280px) auto;
}

.timeline-row {
  position: relative;
  z-index: 4;
  min-width: max(900px, var(--timeline-width));
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to right, #e7ecf2 1px, transparent 1px);
  background-size: calc(100% / var(--days)) 100%;
}

.weekend-col {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(229, 234, 241, 0.55);
  z-index: 0;
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--brand-blue);
  box-shadow: 0 0 0 1px rgba(5, 47, 103, 0.2);
  z-index: 2;
}

.gantt-bar {
  position: absolute;
  height: 24px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-yellow), #f9d64f);
  border: 1px solid #d2a700;
  color: #25221a;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.2rem 0.45rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 10px rgba(185, 145, 0, 0.25);
  z-index: 3;
}

.bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-date {
  color: #5a4b1c;
  font-size: 0.69rem;
  white-space: nowrap;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-shell {
  width: min(460px, 100%);
}

.login-panel {
  background: #ffffff;
  border: 1px solid #d4dce8;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.3rem;
}

.login-brand {
  background: var(--brand-blue-deep);
  border-bottom: 4px solid var(--brand-yellow);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.8rem;
}

.login-logo {
  width: min(260px, 100%);
  height: auto;
  display: block;
  margin: 0;
}

.login-panel h1 {
  margin: 0.3rem 0 0.4rem;
  text-transform: uppercase;
  font-style: italic;
}

.login-copy {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

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

@media (max-width: 880px) {
  .brand-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    width: 100%;
  }

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

  .utility-logo {
    height: 72px;
  }

  .schedule-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-board {
    max-height: 66vh;
  }

  .schedule-head,
  .schedule-row {
    grid-template-columns: minmax(230px, 230px) auto;
  }
}

@media (max-width: 650px) {
  .mobile-planning {
    display: block;
  }

  .schedule-legend,
  .schedule-board {
    display: none;
  }

  .schedule-toolbar {
    display: none;
  }

  .site-footer-content {
    min-height: 60px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0.15rem;
    padding: 0.35rem 0;
  }

  .utility-content {
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    padding: 0.7rem 0;
    min-height: 74px;
    padding-left: 0;
  }

  .utility-logo-link {
    position: static;
    transform: none;
  }

  .shell {
    width: min(1100px, 100% - 1rem);
  }

  .utility-logo {
    height: 60px;
  }

  .brand-wordmark strong {
    font-size: 0.86rem;
  }

  .brand-wordmark small {
    font-size: 0.7rem;
  }

  .hero {
    padding: 1rem;
  }

  .card,
  .panel {
    padding: 0.85rem;
  }

  table {
    min-width: 520px;
  }
}
