:root {
  --sidebar-bg: #10243e;
  --sidebar-accent: #f39c32;
  --app-bg: #f2f4f7;
  --panel-bg: #ffffff;
  --text-main: #1b2430;
  --text-muted: #8892a6;
  --border-color: #e5eaf2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--app-bg);
  color: var(--text-main);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--sidebar-bg);
  color: #d6e2f3;
  padding: 20px 14px;
}

.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 30px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--sidebar-accent);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.brand-subtitle {
  margin: 0;
  font-size: 11px;
  opacity: 0.85;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #d6e2f3;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(243, 156, 50, 0.18);
  color: #ffffff;
}

.inline-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
}

.inline-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-with-icon,
.meta-with-icon,
.ref-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.entity-title-block {
  display: grid;
  gap: 2px;
}

.search-with-icon {
  width: min(330px, 100%);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: #7d8a9d;
}

.search-with-icon .orders-search {
  border: 0;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
}

.search-with-icon .orders-search:focus {
  outline: none;
}

.main-content {
  padding: 22px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.page-subtitle {
  margin: 6px 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(17, 33, 59, 0.03);
}

.kpi-label {
  display: block;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 11px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
}

.content-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 34% 66%;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.panel h2 {
  margin: 0 0 16px;
  text-transform: uppercase;
  font-size: 12px;
  color: #67748b;
  letter-spacing: 0.03em;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.panel p {
  margin: 6px 0;
  color: #49566c;
  font-size: 13px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.see-all {
  color: #297dcf;
  font-size: 12px;
  text-decoration: none;
}

.orders-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.orders-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding: 12px 0;
}

.orders-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.orders-list strong {
  font-size: 13px;
  display: block;
}

.orders-list p {
  margin: 4px 0 0;
  color: #8391a4;
  font-size: 12px;
}

.order-side {
  text-align: right;
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.status {
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid transparent;
  font-size: 11px;
}

.status-processing {
  color: #2878b8;
  background: #ecf6fd;
  border-color: #cce6fa;
}

.status-complete {
  color: #2b8f5f;
  background: #edf8f2;
  border-color: #ccefdc;
}

.status-loading {
  color: #ad741f;
  background: #fdf6eb;
  border-color: #f8dfb8;
}

.status-cancelled {
  color: #bd4054;
  background: #fdeef0;
  border-color: #f7cad1;
}

.orders-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.orders-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.orders-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.new-order-button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: #1e4e86;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.orders-toolbar {
  margin-bottom: 10px;
}

.orders-search {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  font-size: 13px;
}

.orders-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.orders-tabs {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  padding: 10px;
}

.orders-tab {
  border: 1px solid #d7e6f7;
  background: #f5f8fc;
  color: #5f7a95;
  border-radius: 999px;
  font-size: 11px;
  padding: 4px 9px;
  cursor: pointer;
}

.orders-tab.active {
  border-color: #1f5ca0;
  color: #ffffff;
  background: #1f5ca0;
}

.orders-table-wrap {
  overflow-x: auto;
}

.orders-filter-empty {
  margin: 12px 14px 16px;
  font-size: 13px;
  color: #6f7e94;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.orders-table-col-pdf {
  width: 52px;
  text-align: center;
  vertical-align: middle;
}

.orders-table th.orders-table-col-pdf {
  padding-left: 8px;
  padding-right: 8px;
}

.order-pdf-btn {
  border: 0;
  margin: 0;
  padding: 6px;
  cursor: pointer;
  color: #c62828;
  background: transparent;
  border-radius: 8px;
  line-height: 0;
  transition: background 0.15s ease;
}

.order-pdf-btn:hover {
  background: rgba(198, 40, 40, 0.1);
}

.order-pdf-btn:focus-visible {
  outline: 2px solid #1e4e86;
  outline-offset: 2px;
}

.order-pdf-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.orders-table th,
.orders-table td {
  text-align: left;
  font-size: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.orders-table th {
  color: #6f7e94;
  font-size: 11px;
  font-weight: 600;
}

.orders-table td strong {
  color: #2f4e79;
}

.new-order-head {
  margin-bottom: 12px;
}

.new-order-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.new-order-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.new-order-shell {
  width: min(560px, 100%);
  margin: 0 auto;
}

.available-balance {
  background: #edf5fb;
  border: 1px solid #bcd5ea;
  border-radius: 7px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: #456b8f;
}

.available-balance strong {
  color: #0076a8;
}

.balance-banner {
  background: #edf5fb;
  border: 1px solid #bcd5ea;
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: #456b8f;
}

.balance-banner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.balance-after-row .balance-value-after {
  font-size: 13px;
  font-weight: 600;
  color: #1f8f5f;
}

.balance-value-main {
  color: #0b6fa8;
  font-size: 15px;
}

.order-pricing-summary {
  background: #f3f6f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.order-pricing-summary .pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: #5f6f84;
  padding: 4px 0;
}

.order-pricing-summary .pricing-row-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #dde4ec;
}

.pricing-total-value {
  font-size: 14px;
  color: #1b2430;
}

.pricing-value {
  color: #334155;
}

.new-order-form {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
}

.new-order-form .btn-confirm {
  background: #1e4e86;
  border: 1px solid #163a66;
  color: #ffffff;
}

.field-block {
  margin-bottom: 10px;
}

.field-block label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: #5f6f84;
}

.field-block select,
.field-block input {
  width: 100%;
  border: 1px solid #d9e2ed;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  background: #fff;
  color: #223448;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.btn-cancel,
.btn-confirm {
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
}

.btn-cancel {
  background: #f3f6f9;
  border: 1px solid #d9e2ed;
  color: #27374b;
}

a.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-confirm {
  background: #86a9d1;
  border: 1px solid #7396bf;
  color: #ffffff;
}

.vehicles-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.vehicles-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.vehicles-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.add-vehicle-button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: #1e4e86;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
}

a.add-vehicle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.vehicles-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.vehicle-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.vehicle-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.vehicle-top h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.vehicle-top p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #7d8a9d;
}

.vehicle-bottom {
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.vehicle-bottom span {
  color: #7d8a9d;
}

.drivers-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.drivers-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.drivers-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.add-driver-button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: #1e4e86;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
}

a.add-driver-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.drivers-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.driver-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.driver-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.driver-top h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.driver-top p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #7d8a9d;
}

.driver-bottom {
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.driver-bottom span {
  color: #7d8a9d;
}

.account-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.account-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.account-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.account-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  margin-bottom: 12px;
}

.account-kpi {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
}

.account-kpi-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.account-kpi-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.account-kpi-label {
  color: #7a8a9f;
  font-size: 11px;
  text-transform: uppercase;
}

.account-kpi-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.account-kpi-balance .account-kpi-icon {
  background: #e9f8ef;
  color: #2b8f5f;
}

.account-kpi-balance .account-kpi-value {
  color: #177f56;
}

.account-kpi-debit .account-kpi-icon {
  background: #eaf6fd;
  color: #2b7fb2;
}

.account-kpi-debit .account-kpi-value {
  color: #2b7fb2;
}

.account-kpi-credit .account-kpi-icon {
  background: #fff5e9;
  color: #c08a2a;
}

.account-kpi-credit .account-kpi-value {
  color: #c08a2a;
}

.account-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.account-table-wrap {
  overflow-x: auto;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.account-table th,
.account-table td {
  text-align: left;
  font-size: 11px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-color);
}

.account-table th {
  color: #6f7e94;
  font-size: 11px;
  font-weight: 600;
  background: #f9fbfe;
}

.account-table td:nth-child(4),
.account-table td:nth-child(5),
.account-table td:nth-child(6),
.account-table th:nth-child(4),
.account-table th:nth-child(5),
.account-table th:nth-child(6) {
  text-align: right;
}

.account-table td:nth-child(4) {
  color: #b84e43;
}

.account-table td:nth-child(5) {
  color: #2b8f5f;
}

.invoices-head {
  margin-bottom: 10px;
}

.invoices-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.invoices-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.invoices-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.invoices-table-wrap {
  overflow-x: auto;
}

.invoices-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.invoices-table th,
.invoices-table td {
  text-align: left;
  font-size: 11px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-color);
}

.invoices-table th {
  color: #6f7e94;
  font-size: 11px;
  font-weight: 600;
  background: #f9fbfe;
}

.invoices-table td strong {
  color: #2f4e79;
}

.invoice-action {
  color: #334f75;
  text-decoration: none;
  font-size: 11px;
}

.invoice-action:hover {
  text-decoration: underline;
}

.field-validation {
  display: block;
  color: #b4232c;
  font-size: 11px;
  margin-top: 4px;
}

.field-checkbox {
  margin-top: 2px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #5f6f84;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #1e4e86;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .vehicles-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .drivers-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .account-kpis {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-bottom: 8px;
  }

  .main-content {
    padding: 14px;
  }

  .orders-page-head {
    flex-direction: column;
  }

  .orders-tabs {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }

  .vehicles-head {
    flex-direction: column;
  }

  .vehicles-grid {
    grid-template-columns: 1fr;
  }

  .drivers-head {
    flex-direction: column;
  }

  .drivers-grid {
    grid-template-columns: 1fr;
  }

  .account-head {
    flex-direction: column;
  }

  .account-kpis {
    grid-template-columns: 1fr;
  }
}