.td-filter-card {
  align-items: flex-start;
}

.td-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.td-mode-segment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(77,163,255,0.24);
  border-radius: 8px;
  background: rgba(77,163,255,0.08);
}

.td-mode-chip {
  min-height: 30px;
  padding: 6px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text2, #8da8cc);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.td-mode-chip:hover {
  color: var(--text, #e8f0ff);
  background: rgba(255,255,255,0.055);
}

.td-mode-chip.active {
  color: var(--text, #e8f0ff);
  background: rgba(77,163,255,0.24);
  box-shadow: inset 0 0 0 1px rgba(77,163,255,0.26);
}

.td-search {
  width: 360px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #2a3142);
  background: var(--panel2, #151a26);
  color: var(--text, #e6e9f2);
  font-size: 13px;
  outline: none;
}

.td-search:focus {
  border-color: var(--accent, #4da3ff);
}

.td-days-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text2, #8da8cc);
  font-size: 12px;
  font-weight: 600;
}

.td-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.td-summary-item {
  min-height: 74px;
  border: 1px solid var(--border, rgba(77,163,255,0.12));
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  padding: 12px 14px;
}

.td-summary-value {
  font-family: var(--mono, monospace);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.td-summary-label {
  margin-top: 5px;
  color: var(--text3, #4d6a8a);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.td-table-card {
  padding: 0;
  overflow: hidden;
}

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

.td-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.td-table--cards {
  table-layout: fixed;
  min-width: 1180px;
}

.td-table--cards .td-col-driver {
  width: 22%;
}

.td-table--cards .td-col-company {
  width: 13%;
}

.td-table--cards .td-col-last {
  width: 16%;
}

.td-table--cards .td-col-current {
  width: 16%;
}

.td-table--cards .td-col-request {
  width: 18%;
}

.td-table--cards .td-col-action {
  width: 15%;
}

.td-table th,
.td-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  vertical-align: top;
}

.td-table th {
  color: var(--text3, #4d6a8a);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0,0,0,0.18);
  white-space: nowrap;
}

.td-table tbody tr:hover {
  background: rgba(77,163,255,0.055);
}

.td-plate {
  font-family: var(--mono, monospace);
  font-size: 13px;
  color: var(--text, #e8f0ff);
  font-weight: 700;
  white-space: nowrap;
}

.td-subtext {
  margin-top: 2px;
  color: var(--text3, #4d6a8a);
  font-size: 11px;
  line-height: 1.35;
}

.td-card-id {
  font-family: var(--mono, monospace);
  color: var(--text2, #8da8cc);
  word-break: break-word;
}

.td-card-id--driver {
  margin-top: 4px;
}

.td-company-name {
  color: var(--text, #e8f0ff);
  font-weight: 700;
  line-height: 1.35;
}

.td-last-line strong,
.td-last-main {
  color: var(--text, #e8f0ff);
  font-weight: 700;
}

.td-last-main {
  font-family: var(--mono, monospace);
  white-space: nowrap;
}

.td-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.td-status-ok {
  color: var(--green, #22d3a0);
  border-color: rgba(34,211,160,0.3);
  background: rgba(34,211,160,0.10);
}

.td-status-active {
  color: var(--accent, #4da3ff);
  border-color: rgba(77,163,255,0.34);
  background: rgba(77,163,255,0.12);
}

.td-status-failed {
  color: var(--red, #ff5c5c);
  border-color: rgba(255,92,92,0.35);
  background: rgba(255,92,92,0.10);
}

.td-status-stale,
.td-status-dirty {
  color: var(--yellow, #f6c90e);
  border-color: rgba(246,201,14,0.35);
  background: rgba(246,201,14,0.10);
}

.td-status-no_card,
.td-status-offline,
.td-status-unknown {
  color: var(--text3, #4d6a8a);
  border-color: rgba(141,168,204,0.18);
  background: rgba(141,168,204,0.06);
}

.td-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 230px;
}

.td-table--tacho .td-action-row {
  min-width: 150px;
}

.td-table--cards .td-action-row {
  width: 170px;
  min-width: 170px;
  margin-left: auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.td-table--cards .td-action-row .td-file-link,
.td-table--cards .td-action-row .btn-primary {
  width: 100%;
  box-sizing: border-box;
}

.td-table--cards .td-disabled-note {
  max-width: 170px;
  width: 100%;
}

.td-action-row .btn-sm,
.td-action-row .btn-secondary,
.td-action-row .btn-primary {
  white-space: nowrap;
}

.td-file-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(34,211,160,0.3);
  color: var(--green, #22d3a0);
  background: rgba(34,211,160,0.10);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.td-file-link:hover {
  background: rgba(34,211,160,0.16);
}

.td-file-link-tacho {
  border-color: rgba(77,163,255,0.35);
  color: var(--accent, #4da3ff);
  background: rgba(77,163,255,0.10);
}

.td-disabled-note {
  max-width: 190px;
  color: var(--text3, #4d6a8a);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.td-choice-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 7, 16, 0.72);
  backdrop-filter: blur(8px);
}

.td-choice-modal {
  width: min(520px, 100%);
  border: 1px solid rgba(77,163,255,0.22);
  border-radius: 8px;
  background: var(--panel, #101827);
  box-shadow: 0 28px 80px rgba(0,0,0,0.5);
  padding: 18px;
}

.td-choice-title {
  color: var(--text, #e8f0ff);
  font-size: 18px;
  font-weight: 800;
}

.td-choice-body {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--text2, #8da8cc);
  font-size: 13px;
  line-height: 1.45;
}

.td-choice-body strong {
  color: var(--text, #e8f0ff);
}

.td-choice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.td-choice-all {
  border-color: rgba(246,201,14,0.3);
  color: var(--yellow, #f6c90e);
}

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

  .td-table th,
  .td-table td {
    padding: 9px 10px;
  }

  .td-action-row {
    justify-content: flex-start;
  }
}
