:root {
  color-scheme: var(--color-scheme, light);
  font-family: var(--font-family-base, "Open Sans", Arial, sans-serif);
  --nav-text: var(--color-white, #ffffff);
  --nav-text-muted: var(--color-super-light-blue, #e6eaee);
  --nav-hover: var(--color-hover-blue, #26486e);
  background: var(--bg, #ededed);
  color: var(--text, #424242);
}

:root[data-theme="dark"] {
  --nav-text: var(--color-white, #ffffff);
  --nav-text-muted: #d5deea;
  --nav-hover: #1f3d62;
  background: var(--bg, #0d1520);
  color: var(--text, #f3f7fb);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  color: var(--text, #424242);
  font-family: var(--font-family-base, "Open Sans", Arial, sans-serif);
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.inline-link {
  color: var(--secondary, #004786);
  font-weight: 760;
  text-decoration: none;
}

.inline-link:hover {
  color: var(--primary-hover, #26486e);
}

.app-shell {
  --shell-topbar-height: 56px;
  --shell-tabs-height: 48px;
  --shell-header-height: calc(var(--shell-topbar-height) + var(--shell-tabs-height));

  display: grid;
  grid-template-columns: minmax(0, 284px) minmax(0, 1fr);
  grid-template-rows: var(--shell-header-height) minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "sidebar main";
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg, #ededed);
}

.public-shell {
  display: block;
  height: auto;
  min-height: 100vh;
  overflow: visible;
  background: var(--bg);
}

.app-header {
  grid-area: header;
  display: grid;
  grid-template-rows: var(--shell-topbar-height) var(--shell-tabs-height);
  min-width: 0;
  min-height: 0;
  height: var(--shell-header-height);
  overflow-y: hidden;
  z-index: 30;
}

.app-sidebar {
  position: relative;
  grid-area: sidebar;
  display: flex;
  align-self: stretch;
  height: auto;
  max-width: 100%;
  min-height: 0;
  flex-direction: column;
  padding: var(--space-3, 24px) var(--space-2, 16px);
  border-right: 1px solid rgba(0, 32, 66, 0.34);
  background: var(--primary, #002855);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.app-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.app-topbar {
  display: flex;
  height: var(--shell-topbar-height);
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-1, 8px);
  padding: 0 var(--space-2, 16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--color-white, #ffffff);
  background: var(--primary, #002855);
  overflow: hidden;
}

.topbar-brand {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: var(--space-1, 8px);
  min-width: 0;
  color: var(--color-white, #ffffff);
  font-size: var(--font-size-sm, 14px);
  font-weight: var(--font-weight-bold, 700);
  line-height: var(--line-height-button, 20px);
  text-decoration: none;
}

.topbar-brand-icon {
  width: 29px;
  height: 24px;
  object-fit: contain;
  padding: 3px;
  border-radius: 6px;
  background: #ffffff;
}

.topbar-brand-name {
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.primary-tabs {
  display: flex;
  align-items: stretch;
  gap: var(--space-1, 8px);
  height: var(--shell-tabs-height);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 var(--space-3, 24px);
  border-bottom: 1px solid var(--line, #d1d1d1);
  background: var(--surface, #ffffff);
  scrollbar-width: thin;
}

.primary-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  padding: 0 var(--space-2, 16px);
  border-bottom: 3px solid transparent;
  color: var(--color-premio-blue, #002855);
  font-size: var(--font-size-sm, 14px);
  font-weight: var(--font-weight-bold, 700);
  line-height: var(--line-height-button, 20px);
  text-decoration: none;
  white-space: nowrap;
}

.primary-tab:hover,
.primary-tab.is-active {
  border-bottom-color: var(--accent, #ffcd00);
  color: var(--color-white, #ffffff);
  background: var(--primary-hover, #26486e);
}

:root[data-theme="dark"] .primary-tab {
  color: var(--text-soft, #e4edf6);
}

:root[data-theme="dark"] .primary-tab:hover,
:root[data-theme="dark"] .primary-tab.is-active {
  color: var(--color-white, #ffffff);
}

.drawer-scrim {
  display: none;
}

.icon-button,
.ui-icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0 var(--space-1, 8px);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius-button, 3px);
  color: var(--color-white, #ffffff);
  background: transparent;
  cursor: pointer;
  font-size: var(--font-size-sm, 14px);
  font-weight: var(--font-weight-bold, 700);
  line-height: var(--line-height-button, 20px);
}

.icon-button:hover {
  background: var(--primary-hover, #26486e);
}

.drawer-toggle {
  display: none;
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.35rem 0.45rem 1.35rem;
  color: var(--nav-text, #ffffff);
  text-decoration: none;
}

.brand span {
  min-width: 0;
}

.brand-mark,
.loading-mark,
.brand-icon,
.loading-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md, 8px);
  color: var(--accent-ink, #ffffff);
  background: var(--primary, #002855);
  font-weight: 900;
  letter-spacing: 0;
}

.brand-icon,
.loading-icon {
  display: block;
  object-fit: contain;
  padding: 5px;
  border-radius: 8px;
  background: #ffffff;
}

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

.brand strong {
  font-size: 1.02rem;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--nav-text-muted, #e6eaee);
  font-size: 0.74rem;
}

.main-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  padding-right: 0.35rem;
  padding-bottom: 0.75rem;
  scrollbar-gutter: stable;
}

.main-nav::-webkit-scrollbar {
  width: 8px;
}

.main-nav::-webkit-scrollbar-thumb {
  border: 2px solid var(--primary, #002855);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.nav-section {
  display: block;
  flex: 0 0 auto;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md, 8px);
  background: rgba(255, 255, 255, 0.06);
  overflow: visible;
}

.nav-section.is-open,
.nav-section.is-active {
  border-color: rgba(255, 205, 0, 0.55);
  background: rgba(38, 72, 110, 0.72);
}

.nav-category-button {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.84rem 0.85rem 0.7rem;
  border: 0;
  color: var(--nav-text, #ffffff);
  background: transparent;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  line-height: 1.15;
  text-align: left;
  text-transform: uppercase;
  border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.nav-category-button:not(.is-open) {
  border-radius: var(--radius-md, 8px);
}

.nav-category-button:hover,
.nav-category-button.is-active {
  color: var(--color-white, #ffffff);
  background: var(--nav-hover, #26486e);
}

.nav-category-button:focus-visible {
  outline: 2px solid var(--accent, #ffcd00);
  outline-offset: -2px;
}

.nav-category-button span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-category-chevron {
  flex: 0 0 auto;
  color: var(--accent, #ffcd00);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.78;
  transition:
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.nav-category-button.is-open .nav-category-chevron {
  opacity: 1;
  transform: rotate(90deg);
}

.nav-category-items {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
  padding: 0.12rem 0.35rem 0.62rem;
  border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
}

.nav-category-items.is-collapsed {
  display: none;
}

.nav-section-title,
.nav-category-label {
  display: block;
  color: var(--nav-text-muted, #e6eaee);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-nav a,
.link-button {
  border: 0;
  background: none;
  text-decoration: none;
  cursor: pointer;
}

.main-nav a {
  color: var(--nav-text-muted, #e6eaee);
}

.link-button {
  color: var(--secondary, #004786);
}

.main-nav a {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 0.62rem 0.74rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 720;
}

.main-nav a.nav-item {
  width: 100%;
  padding-left: 1.4rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.main-nav a.active,
.main-nav a:hover {
  border-color: rgba(255, 205, 0, 0.48);
  color: var(--color-white, #ffffff);
  background: var(--nav-hover, #26486e);
}

.main-nav a.active {
  box-shadow: inset 3px 0 0 var(--accent, #ffcd00);
}

.user-chip {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: var(--space-1, 8px);
  max-width: clamp(128px, 24vw, 320px);
  min-width: 0;
  padding: 2px var(--space-1, 8px);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius-button, 3px);
  color: var(--color-white, #ffffff);
  background: rgba(255, 255, 255, 0.1);
}

.user-chip > span:last-child {
  min-width: 0;
}

.user-chip small,
.user-chip strong {
  display: block;
}

.user-chip small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.user-chip strong {
  max-width: 26ch;
  overflow: hidden;
  color: var(--color-white, #ffffff);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-button, 3px);
  color: var(--primary, #002855);
  background: var(--accent, #ffcd00);
  font-weight: 900;
}

.page-content {
  width: min(1240px, calc(100% - clamp(1.5rem, 4vw, 4rem)));
  max-width: 100%;
  margin: 0 auto;
  padding: 2.4rem 0 4rem;
  min-width: 0;
}

.public-shell .page-content {
  display: grid;
  width: min(1120px, calc(100% - clamp(1.5rem, 8vw, 5rem)));
  min-height: 100vh;
  place-items: center;
  padding: 2rem 0;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--secondary, #004786);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0.65rem;
  color: var(--text);
  font-size: 2.8rem;
  line-height: 1.02;
  letter-spacing: 0;
}

h1:focus {
  outline: none;
}

h2 {
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.page-intro {
  max-width: 650px;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  width: 100%;
  min-height: 650px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel,
.login-aside {
  padding: clamp(2rem, 6vw, 5rem);
}

.login-panel {
  align-self: center;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  margin: 0 0 1.6rem;
}

.login-brand-logo {
  display: block;
  flex: 0 1 213px;
  width: min(213px, 100%);
  height: auto;
  aspect-ratio: 1065 / 215;
  object-fit: contain;
  padding: 6px 10px;
  border: 1px solid rgba(0, 40, 85, 0.12);
  border-radius: 10px;
  background: #ffffff;
}

.login-brand span {
  display: grid;
  gap: 0.1rem;
}

.login-brand small {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.login-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--line);
  background: #0b1014;
}

.login-aside::before {
  content: "";
  display: block;
  width: 86px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.login-aside h2 {
  max-width: 480px;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.login-aside p:last-child {
  max-width: 520px;
  color: var(--text-muted);
  line-height: 1.7;
}

.form-field {
  min-width: 0;
  margin: 1.1rem 0;
}

.form-field label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 760;
}

.form-field small {
  display: block;
  margin-top: 0.42rem;
  color: var(--text-muted);
}

.form-field input,
.form-field select,
.form-field textarea,
.damage-table select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--text);
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #d1d1d1);
  border-radius: var(--radius-sm, 4px);
  outline: none;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.9rem 0.95rem;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.damage-table select:focus {
  border-color: var(--primary, #002855);
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(255, 205, 0, 0.44));
}

.form-field textarea {
  resize: vertical;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 720;
}

.checkbox-row input {
  width: auto;
}

.validation-message {
  display: block;
  margin-top: 0.35rem;
  color: #ff9c9c;
  font-size: 0.78rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: var(--radius-button, 3px);
  font-size: var(--font-size-sm, 14px);
  font-weight: var(--font-weight-bold, 700);
  line-height: var(--line-height-button, 20px);
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 0.6rem;
  color: var(--color-white, #ffffff);
  background: var(--primary, #002855);
  border: 1px solid var(--primary, #002855);
}

.primary-button:hover {
  background: var(--primary-hover, #26486e);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.link-button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.secondary-button {
  color: var(--text);
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #d1d1d1);
}

.secondary-button:hover {
  border-color: var(--primary-hover, #26486e);
  background: var(--surface-3, #e6eaee);
}

:root[data-theme="dark"] .ui-button--secondary,
:root[data-theme="dark"] .ui-button--ghost {
  color: var(--text-soft, #e4edf6);
}

.topbar-logout,
.topbar-action {
  flex: 0 0 auto;
  min-width: 88px;
}

.app-topbar .secondary-button {
  min-height: 28px;
  padding: 3px 10px;
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--color-white, #ffffff);
  background: transparent;
}

.app-topbar .secondary-button:hover {
  border-color: var(--accent, #ffcd00);
  background: var(--primary-hover, #26486e);
}

.inline-button {
  width: auto;
}

.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-button, 3px);
  cursor: pointer;
  font-size: var(--font-size-sm, 14px);
  font-weight: var(--font-weight-bold, 700);
  line-height: var(--line-height-button, 20px);
  text-decoration: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.ui-button--primary {
  color: var(--color-white, #ffffff);
  background: var(--primary, #002855);
  border-color: var(--primary, #002855);
}

.ui-button--primary:hover {
  background: var(--primary-hover, #26486e);
  border-color: var(--primary-hover, #26486e);
}

.ui-button--secondary {
  color: var(--primary, #002855);
  background: var(--surface, #ffffff);
  border-color: var(--line, #d1d1d1);
}

.ui-button--secondary:hover {
  color: var(--color-white, #ffffff);
  background: var(--primary-hover, #26486e);
  border-color: var(--primary-hover, #26486e);
}

.ui-button--ghost {
  color: var(--primary, #002855);
  background: transparent;
}

.ui-button--ghost:hover {
  background: var(--surface-3, #e6eaee);
}

.ui-button--sm {
  min-height: 32px;
  padding: 6px 12px;
}

.ui-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.ui-card {
  padding: var(--space-3, 24px);
  border: 1px solid var(--line-soft, #ededed);
  border-radius: var(--radius-2xl, 16px);
  color: var(--text, #424242);
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-card, 0 2px 6px rgba(0, 0, 0, 0.08));
}

.ui-card__header,
.ui-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 16px);
}

.ui-card__body {
  min-width: 0;
}

.ui-card__header + .ui-card__body,
.ui-card__body + .ui-card__footer {
  margin-top: var(--space-2, 16px);
}

.ui-input {
  display: grid;
  gap: 6px;
}

.ui-input label {
  color: var(--text, #424242);
  font-size: var(--font-size-sm, 14px);
  font-weight: var(--font-weight-bold, 700);
  line-height: var(--line-height-button, 20px);
}

.ui-input input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line, #d1d1d1);
  border-radius: var(--radius-sm, 4px);
  color: var(--text, #424242);
  background: var(--surface, #ffffff);
  font-size: var(--font-size-sm, 14px);
  line-height: var(--line-height-button, 20px);
}

.ui-input input:focus {
  border-color: var(--primary, #002855);
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(255, 205, 0, 0.44));
}

.ui-input small {
  color: var(--text-muted, #5e5e5e);
  font-size: var(--font-size-xs, 12px);
}

.ui-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  border: 0;
  background: rgba(0, 32, 66, 0.4);
}

.ui-drawer-scrim.is-open {
  display: block;
}

.ui-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  padding: var(--space-3, 24px);
  color: var(--text, #424242);
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-elevated, 0 12px 32px rgba(0, 40, 85, 0.16));
  transform: translateX(104%);
  transition: transform var(--transition-fast);
}

.ui-drawer.is-open {
  transform: translateX(0);
}

.ui-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 16px);
}

.ui-drawer__header h2 {
  margin: 0;
}

.ui-drawer__body {
  margin-top: var(--space-3, 24px);
}

.ui-drawer .ui-icon-button {
  border-color: var(--line, #d1d1d1);
  color: var(--primary, #002855);
  background: var(--surface, #ffffff);
}

.header-actions .primary-button,
.form-actions .primary-button,
.document-upload-panel .primary-button {
  margin-top: 0;
}

.alert {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  line-height: 1.45;
}

.alert-error,
.state-error {
  color: #ffd7d7;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.alert-success {
  color: #d8ffe8;
  background: rgba(79, 210, 139, 0.12);
  border: 1px solid rgba(79, 210, 139, 0.35);
}

.dashboard-header {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.7rem;
}

.dashboard-header > div {
  min-width: 0;
}

.header-actions,
.form-actions {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-actions > *,
.form-actions > * {
  max-width: 100%;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
}

.metric-grid-three {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.dashboard-metric-grid {
  gap: var(--space-3, 24px);
  margin-bottom: var(--space-4, 32px);
}

.metric-card {
  min-height: 120px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(18, 24, 34, 0.6);
  border-left-width: 5px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: 0 8px 24px rgba(2, 8, 18, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-card span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--text);
  font-size: 1.7rem;
  margin-top: 0.25rem;
}

.metric-card small {
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-size: 0.78rem;
}

.metric-card span,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 1rem 0 0.7rem;
  color: var(--text);
  font-size: 2.75rem;
  line-height: 1;
}

.metric-card small {
  color: var(--text-muted);
  line-height: 1.45;
}

.dashboard-action-card {
  position: relative;
  padding-right: 2.55rem;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.dashboard-action-card::after {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 0.56rem;
  height: 0.56rem;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: 0.75;
  transform: rotate(45deg);
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

.dashboard-action-card:hover {
  border-color: rgba(244, 183, 64, 0.46);
  background: linear-gradient(180deg, var(--surface), rgba(244, 183, 64, 0.07));
  box-shadow: 0 10px 26px rgba(0, 40, 85, 0.14);
  transform: translateY(-2px);
}

.dashboard-action-card:hover::after {
  opacity: 1;
  transform: translateX(2px) rotate(45deg);
}

.dashboard-action-card:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(255, 205, 0, 0.5);
  outline-offset: 3px;
}

.metric-overdue {
  border-left-color: var(--danger);
}

.metric-due {
  border-left-color: var(--warning);
}

.metric-open {
  border-left-color: var(--info);
}

.metric-done {
  border-left-color: var(--success);
}

.driver-stat-grid {
  align-items: stretch;
}

.stat-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  min-width: 0;
  min-height: 132px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--status-neutral);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-soft);
  transition:
    border-color var(--transition-fast),
    transform var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.stat-card-link {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.stat-card-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 205, 0, 0.54);
  box-shadow: 0 12px 28px rgba(0, 40, 85, 0.16);
}

.stat-card-link:focus-visible {
  outline: 3px solid rgba(255, 205, 0, 0.72);
  outline-offset: 3px;
}

.stat-card.info {
  border-left-color: var(--status-info);
  background: linear-gradient(180deg, var(--surface), rgba(43, 123, 255, 0.08));
}

.stat-card.danger {
  border-left-color: var(--status-danger);
  background: linear-gradient(180deg, var(--surface), rgba(255, 77, 79, 0.08));
}

.stat-card.warning {
  border-left-color: var(--status-warning);
  background: linear-gradient(180deg, var(--surface), rgba(244, 183, 64, 0.08));
}

.stat-card.success {
  border-left-color: var(--status-success);
  background: linear-gradient(180deg, var(--surface), rgba(79, 210, 139, 0.08));
}

.stat-card-icon {
  display: grid;
  place-items: center;
  align-self: start;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.stat-card-value,
.stat-card-label {
  display: block;
}

.stat-card-label {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card-value {
  margin: 0.65rem 0 0.35rem;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1;
}

.stat-card small {
  color: var(--text-muted);
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 0.26rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.badge-offen {
  color: #e6f2ff;
  background: var(--tint-info);
  border-color: rgba(98, 210, 255, 0.26);
}

.badge-bald-faellig {
  color: #fff4d6;
  background: var(--tint-warning);
  border-color: rgba(244, 183, 64, 0.28);
}

.badge-ueberfaellig {
  color: #ffdfe0;
  background: var(--tint-danger);
  border-color: rgba(255, 77, 79, 0.3);
}

:root[data-theme="light"] .badge-ueberfaellig {
  color: var(--color-price-tag-dark-red, #7e1117);
}

.badge-erledigt {
  color: #dff7e8;
  background: var(--tint-success);
  border-color: rgba(79, 210, 139, 0.28);
}

.badge-neutral {
  color: #cfdae0;
  background: var(--tint-neutral);
  border-color: rgba(145, 161, 170, 0.28);
}

.cell-hint {
  display: inline-block;
  max-width: min(100%, 22rem);
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.empty-state-icon,
.empty-state-text {
  display: block;
}

.empty-state-icon {
  margin-bottom: 0.45rem;
  color: var(--secondary, #004786);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty-state-text {
  color: var(--text-muted);
  line-height: 1.5;
}

.deadline-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-list-grid {
  align-items: stretch;
}

.deadline-list,
.vehicle-card,
.form-panel,
.table-panel,
.state-panel,
.report-tile,
.damage-summary article {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.deadline-list {
  padding: 1.15rem;
}

.deadline-list header,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.deadline-list header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.deadline-list header h2,
.panel-header h2 {
  margin: 0;
}

.deadline-list header span,
.panel-header span {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: #0c1116;
  font-weight: 850;
}

:root[data-theme="dark"] .deadline-list header span,
:root[data-theme="dark"] .panel-header span,
:root[data-theme="dark"] .selected-file {
  background: var(--surface-2, #111c2a);
}

.deadline-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.deadline-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.deadline-list li > * {
  min-width: 0;
}

.deadline-list li:last-child {
  border-bottom: 0;
}

.deadline-list strong,
.deadline-list small {
  display: block;
}

.deadline-list small,
.damage-table small {
  margin-top: 0.35rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.deadline-list time {
  color: var(--text-soft);
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 780;
}

.list-overdue time {
  color: #ff9c9c;
}

.list-due time {
  color: #ffd17b;
}

.empty-state {
  margin: 0;
  padding: 2rem 0 0.6rem;
  color: var(--text-muted);
}

.panel-empty {
  padding: 1.2rem;
}

.state-panel {
  padding: 1.4rem;
  color: var(--text-soft);
}

.state-panel span {
  display: block;
  margin-top: 0.35rem;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-card {
  min-height: 118px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.summary-card span,
.summary-card small {
  display: block;
}

.summary-card span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin: 0.72rem 0 0.35rem;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.summary-card small {
  color: var(--text-muted);
  line-height: 1.4;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.42fr);
  gap: 1rem;
  align-items: start;
}

.admin-form-stack {
  display: grid;
  gap: 1rem;
}

.section-kicker {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--secondary, #004786);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-copy {
  margin-bottom: 1rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.table-actions {
  min-width: min(100%, 190px);
}

.table-actions .link-button {
  display: inline-flex;
  margin: 0 0.75rem 0.45rem 0;
}

.filter-panel {
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.filter-panel .form-field {
  margin: 0;
}

.filter-panel .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  align-items: end;
}

.filter-actions {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-actions > * {
  max-width: 100%;
}

.deadline-center-filter-panel .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  align-items: end;
  gap: 0.6rem;
}

.deadline-center-filter-panel {
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.85rem;
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.deadline-center-filter-panel .form-field label {
  margin-bottom: 0.28rem;
  font-size: 0.74rem;
  font-weight: 800;
}

.deadline-center-filter-panel .form-field input,
.deadline-center-filter-panel .form-field select {
  min-height: 34px;
  padding: 0.48rem 0.58rem;
  font-size: 0.84rem;
}

.deadline-center-filter-panel .filter-actions {
  align-items: end;
  justify-content: flex-end;
  gap: 0.5rem;
}

.deadline-center-filter-panel .filter-actions .primary-button,
.deadline-center-filter-panel .filter-actions .secondary-button {
  min-height: 34px;
  padding: 0.42rem 0.8rem;
  margin-top: 0;
}

.deadline-center-metrics {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.deadline-center-metrics .metric-card {
  min-height: 98px;
  padding: 0.78rem 0.88rem;
}

.deadline-status-card {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.deadline-status-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 205, 0, 0.72);
  background: linear-gradient(180deg, var(--surface), rgba(255, 205, 0, 0.14));
  box-shadow: 0 12px 28px rgba(0, 40, 85, 0.16);
}

.deadline-status-card:focus-visible {
  outline: 3px solid rgba(255, 205, 0, 0.72);
  outline-offset: 3px;
}

.deadline-center-metrics .metric-card strong {
  margin: 0.62rem 0 0.36rem;
  font-size: 2rem;
}

.deadline-center-columns {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 0.85rem;
}

.deadline-center-columns .deadline-list {
  overflow: hidden;
  padding: 0.9rem;
  scroll-margin-top: 5.5rem;
}

.deadline-center-columns .deadline-list header {
  align-items: flex-start;
  gap: 0.6rem;
  padding-bottom: 0.75rem;
}

.deadline-center-columns .deadline-list header h2 {
  min-width: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.deadline-center-columns .deadline-list header span {
  flex: 0 0 auto;
}

.deadline-center-columns .deadline-list li {
  display: block;
  padding: 0;
  border-bottom: 0;
}

.deadline-center-columns .deadline-list strong,
.deadline-center-columns .deadline-list small,
.deadline-center-columns .deadline-list .inline-link,
.deadline-card-link {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.deadline-center-columns .deadline-list strong {
  line-height: 1.28;
}

.deadline-center-columns .deadline-list small {
  font-size: 0.78rem;
}

.deadline-center-columns .deadline-list ul {
  display: grid;
  gap: 0.68rem;
  padding-top: 0.8rem;
}

.deadline-card-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  min-height: 64px;
  padding: 0.78rem 0.86rem;
  border: 1px solid rgba(230, 185, 0, 0.58);
  border-radius: var(--radius-md, 8px);
  color: var(--primary, #002855);
  background: linear-gradient(180deg, rgba(255, 205, 0, 0.98), rgba(255, 239, 162, 0.96));
  box-shadow: 0 6px 14px rgba(0, 40, 85, 0.08);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.deadline-card-link:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 40, 85, 0.35);
  background: linear-gradient(180deg, rgba(255, 214, 35, 1), rgba(255, 244, 184, 0.98));
  box-shadow: 0 10px 20px rgba(0, 40, 85, 0.14);
}

.deadline-card-link:focus-visible {
  outline: 3px solid rgba(0, 40, 85, 0.24);
  outline-offset: 3px;
}

.deadline-card-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--primary, #002855);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.deadline-card-meta {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

:root[data-theme="light"] .deadline-card-meta {
  color: #585858;
}

.deadline-card-more {
  display: block;
  padding: 0.35rem 0.15rem 0;
  color: var(--text-muted);
  font-weight: 750;
}

.list-overdue .deadline-card-link {
  border-color: rgba(198, 22, 45, 0.34);
  box-shadow:
    inset 4px 0 0 rgba(198, 22, 45, 0.68),
    0 6px 14px rgba(0, 40, 85, 0.08);
}

.list-due .deadline-card-link {
  box-shadow:
    inset 4px 0 0 rgba(0, 71, 134, 0.46),
    0 6px 14px rgba(0, 40, 85, 0.08);
}

.deadline-center-columns .empty-state {
  padding-top: 0.85rem;
}

.deadline-center-table {
  margin-top: 1rem;
}

.analytics-metric-grid {
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.analytics-metric-grid .metric-card {
  min-height: 108px;
  justify-content: flex-start;
}

.analytics-action-card {
  justify-content: center;
}

.analytics-metric-grid .metric-card strong {
  font-size: 2.15rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.analytics-metric-grid .metric-card span,
.analytics-metric-grid .metric-card small {
  overflow-wrap: anywhere;
}

.analytics-data-gaps {
  margin-bottom: 1.25rem;
}

.analytics-main-grid {
  clear: both;
}

.analytics-cost-panel {
  margin-top: 1.25rem;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.report-tile {
  display: flex;
  min-height: 178px;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  padding: 1.25rem;
}

.report-tile h2 {
  margin-bottom: 0.4rem;
}

.report-tile p {
  max-width: 46rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.report-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  min-height: 190px;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.report-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 40, 85, 0.18);
  border-radius: var(--radius);
  color: var(--primary, #002855);
  background: rgba(255, 205, 0, 0.28);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
}

.report-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.report-card h2 {
  margin-bottom: 0.35rem;
}

.report-card p {
  color: var(--text-muted);
  line-height: 1.5;
}

.report-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.workflow-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius);
  color: var(--primary, #002855);
  background: var(--accent);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.workflow-step strong,
.workflow-step > div > span {
  display: block;
}

.workflow-step > div > span {
  margin-top: 0.2rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.import-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.import-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.file-drop {
  padding: 1rem;
  margin: 1rem 0;
  border: 1px dashed rgba(244, 183, 64, 0.4);
  border-radius: var(--radius);
  background: rgba(244, 183, 64, 0.06);
}

.file-drop input {
  width: 100%;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text-soft);
  background: #0c1116;
}

.result-type {
  font-weight: 850;
}

.result-error {
  color: #ffb6b6;
}

.result-warning {
  color: #ffd98f;
}

.settings-layout,
.damage-form-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr);
  gap: 1rem;
  align-items: start;
}

.settings-summary {
  display: grid;
  gap: 1rem;
}

.settings-main {
  display: grid;
  gap: 1rem;
}

.settings-detail-list {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 0;
}

.settings-detail-list div {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line-soft);
}

.settings-detail-list span,
.settings-detail-list strong {
  display: block;
}

.settings-detail-list span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-detail-list strong {
  margin-top: 0.3rem;
  color: var(--text-soft);
}

.driver-vehicle-grid,
.driver-portal-layout {
  display: grid;
  gap: 1rem;
}

.driver-vehicle-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.driver-portal-layout {
  grid-template-columns: minmax(240px, 0.44fr) minmax(0, 1.56fr);
  grid-template-areas: "list detail";
  align-items: start;
}

.driver-portal-hero {
  grid-area: hero;
  min-width: 0;
}

.driver-portal-hero > div:first-child {
  min-width: 0;
}

.driver-vehicle-list {
  grid-area: list;
  min-width: 0;
  display: grid;
  gap: 0.65rem;
  position: sticky;
  top: 1rem;
}

.driver-vehicle-list-item {
  display: block;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-soft);
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.driver-vehicle-list-item:hover,
.driver-vehicle-list-item.active {
  border-color: rgba(244, 183, 64, 0.42);
  background: rgba(244, 183, 64, 0.08);
}

.driver-vehicle-list-item span,
.driver-vehicle-list-item strong,
.driver-vehicle-list-item small {
  display: block;
}

.driver-vehicle-list-item span {
  color: var(--secondary, #004786);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.driver-vehicle-list-item strong {
  margin-top: 0.35rem;
  color: var(--text);
}

.driver-vehicle-list-item small {
  margin-top: 0.25rem;
  color: var(--text-muted);
}

.driver-vehicle-detail {
  grid-area: detail;
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.driver-submit {
  width: 100%;
}

.driver-damage-shell {
  display: grid;
  gap: 1rem;
  width: min(100%, 1040px);
}

.driver-context-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  min-width: 0;
  padding: 0.78rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text-soft);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.driver-context-bar span {
  color: var(--secondary, #004786);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.driver-context-bar strong {
  color: var(--text);
  font-size: 1rem;
}

.driver-context-bar small {
  color: var(--text-muted);
}

.damage-report-panel {
  width: 100%;
}

.vehicle-card,
.form-panel {
  padding: 1.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.document-upload-panel {
  padding: 1rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}

.import-result-panel {
  margin-top: 1rem;
}

.import-summary {
  padding: 1rem;
  margin-bottom: 0;
}

.damage-table .link-button + .link-button,
.damage-table .inline-link + .inline-link {
  margin-left: 0.75rem;
}

.vehicle-card span,
.vehicle-card strong,
.vehicle-card small,
.damage-summary span {
  display: block;
}

.vehicle-card > span,
.damage-summary span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vehicle-card strong {
  margin: 0.9rem 0 0.35rem;
  color: var(--text);
  font-size: 1.65rem;
}

.vehicle-card small {
  color: var(--text-muted);
}

.vehicle-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 1rem;
  align-items: stretch;
}

.vehicle-hero .vehicle-card {
  min-height: 210px;
}

.vehicle-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.vehicle-title-row strong {
  margin: 0.75rem 0 0;
}

.damage-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 1rem;
  margin-bottom: 1rem;
}

.damage-summary article {
  padding: 1.15rem;
}

.damage-summary strong {
  display: block;
  margin-top: 0.45rem;
  color: var(--text);
  font-size: 2rem;
}

.table-panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.damage-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.table-scroll .damage-table {
  min-width: 680px;
}

.damage-table th,
.damage-table td {
  padding: 0.95rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

.damage-table th {
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.damage-table tbody tr {
  background: transparent;
}

.damage-table tbody tr:hover {
  background: rgba(244, 183, 64, 0.04);
}

.damage-table tbody tr:last-child td {
  border-bottom: 0;
}

.damage-table strong {
  display: block;
  color: var(--text);
}

.damage-table select {
  min-width: 132px;
  padding: 0.55rem 0.65rem;
  margin-top: 0.5rem;
}

.task-page-header {
  align-items: flex-start;
}

.task-page-header .header-actions {
  align-self: flex-start;
}

.task-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.task-list-panel {
  clear: both;
  margin-top: 0;
}

.task-list-panel .panel-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 1rem 1.15rem;
}

.task-list-panel .panel-header h2 {
  min-width: 0;
  line-height: 1.2;
}

.task-list-panel .panel-header span {
  flex: 0 0 auto;
  margin-left: auto;
}

.task-list-panel .table-scroll {
  border-top: 1px solid var(--line-soft);
}

.task-list-panel .table-scroll .task-table {
  min-width: 980px;
}

.task-table {
  table-layout: fixed;
}

.task-table th,
.task-table td {
  overflow-wrap: anywhere;
}

.task-table td:last-child {
  white-space: nowrap;
}

.task-table .status-badge {
  white-space: nowrap;
}

.task-col-date {
  width: 8.8rem;
}

.task-col-type {
  width: 9.2rem;
}

.task-col-priority {
  width: 7.2rem;
}

.task-col-title {
  width: 13rem;
}

.task-col-description {
  width: auto;
}

.task-col-reference {
  width: 12rem;
}

.task-col-link {
  width: 6rem;
}

.priority-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.26rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.priority-low,
.status-active,
.status-done,
.status-resolved,
.status-success {
  color: #1b5e20;
  background: rgba(46, 125, 50, 0.14);
  border-color: rgba(46, 125, 50, 0.28);
}

.priority-medium,
.status-due,
.status-inreview,
.status-warning {
  color: var(--color-gray-90, #424242);
  background: rgba(255, 205, 0, 0.28);
  border-color: rgba(230, 185, 0, 0.42);
}

.priority-high,
.status-overdue,
.status-open,
.status-danger {
  color: var(--color-price-tag-dark-red, #7e1117);
  background: rgba(198, 22, 45, 0.12);
  border-color: rgba(198, 22, 45, 0.26);
}

.status-muted,
.status-inactive,
.status-cancelled,
.status-archived,
.status-sold,
.status-outofservice {
  color: var(--color-gray-90, #424242);
  background: rgba(119, 119, 119, 0.12);
  border-color: rgba(119, 119, 119, 0.24);
}

.status-info {
  color: var(--primary, #002855);
  background: rgba(0, 71, 134, 0.12);
  border-color: rgba(0, 71, 134, 0.24);
}

/* Empty state panels */
.empty-state {
  padding: 1rem;
  border: 1px dashed rgba(30, 36, 48, 0.4);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: linear-gradient(180deg, rgba(10, 14, 18, 0.16), rgba(10, 14, 18, 0.06));
}

/* Sidebar active visual */
.main-nav a.active {
  box-shadow:
    inset 4px 0 0 var(--accent, #ffcd00),
    0 6px 18px rgba(0, 32, 66, 0.22);
  background: linear-gradient(90deg, var(--primary-hover, #26486e), rgba(38, 72, 110, 0.4));
}

/* Buttons */
.primary-button {
  color: var(--color-white, #ffffff);
  background: var(--primary, #002855);
  border: 1px solid var(--primary, #002855);
  box-shadow: 0 2px 6px rgba(0, 40, 85, 0.18);
}

.primary-button:hover {
  background: var(--primary-hover, #26486e);
}

.secondary-button {
  color: var(--text, #424242);
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #d1d1d1);
}

/* Responsive: driver portal mobile */
@media (max-width: 640px) {
  .driver-portal-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "list"
      "detail";
    gap: 0.75rem;
  }

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

  .app-shell {
    grid-template-columns: 1fr;
  }
}

.vehicle-file-layout {
  display: grid;
  gap: 1rem;
}

.vehicle-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  margin: 1.25rem 0 0;
}

.detail-grid div {
  min-width: 0;
}

.detail-grid dt {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0.28rem 0 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.panel-header {
  padding: 1rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}

.loading-screen {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 100vh;
  gap: 1rem;
  color: var(--text-muted);
  background: var(--bg);
}

#blazor-error-ui {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  padding: 0.8rem 1rem;
  color: white;
  background: #8b2525;
  z-index: 1000;
}

#blazor-error-ui .reload {
  margin-left: 0.7rem;
}

#blazor-error-ui .dismiss {
  float: right;
  cursor: pointer;
}

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

  .summary-strip,
  .workflow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout,
  .driver-vehicle-grid,
  .driver-portal-layout,
  .import-workspace {
    grid-template-columns: 1fr;
  }

  .driver-portal-layout {
    grid-template-areas:
      "list"
      "detail";
  }

  .driver-vehicle-list {
    position: static;
  }

  .vehicle-hero,
  .vehicle-section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--shell-header-height) minmax(0, 1fr);
    grid-template-areas:
      "header"
      "main";
    background: var(--bg);
    min-width: 0;
    max-width: 100%;
  }

  .drawer-toggle {
    display: inline-grid;
  }

  .drawer-scrim {
    position: fixed;
    inset: var(--shell-header-height) 0 0;
    z-index: 35;
    display: none;
    border: 0;
    background: rgba(0, 32, 66, 0.42);
  }

  .drawer-scrim.is-open {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: var(--shell-header-height);
    bottom: 0;
    left: 0;
    z-index: 40;
    width: min(320px, calc(100vw - 48px));
    height: calc(100vh - var(--shell-header-height));
    height: calc(100dvh - var(--shell-header-height));
    min-height: 0;
    padding: var(--space-2, 16px);
    border-right: 1px solid rgba(0, 32, 66, 0.34);
    border-bottom: 0;
    transform: translateX(-104%);
    transition: transform var(--transition-fast);
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .brand {
    padding: 0 0 0.9rem;
  }

  .main-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0.55rem;
    min-height: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .nav-section {
    width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    display: block;
  }

  .nav-section-title {
    display: none;
  }

  .nav-category-button {
    min-height: 42px;
    padding: 0.62rem 0.75rem;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
  }

  .nav-category-items {
    gap: 0.12rem;
    padding: 0.12rem 0.25rem 0.5rem;
  }

  .main-nav a {
    width: 100%;
    flex: 0 1 auto;
    min-height: 38px;
    padding: 0.52rem 0.68rem;
    font-size: 0.92rem;
    font-weight: 720;
    white-space: normal;
  }

  .main-nav a.nav-item {
    padding: 0.52rem 0.68rem 0.52rem 1.18rem;
    font-size: 0.92rem;
    font-weight: 720;
  }

  .page-content {
    width: min(1240px, calc(100% - 2rem));
    padding: 1.4rem 0 3rem;
  }
}

@media (max-width: 760px) {
  .app-shell {
    --shell-topbar-height: 52px;
    --shell-tabs-height: 46px;
  }

  h1 {
    font-size: 1.9rem;
    line-height: 1.08;
  }

  .page-intro {
    line-height: 1.5;
  }

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

  .login-aside {
    min-height: 300px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .app-sidebar {
    padding: 0.65rem 0.75rem 0.55rem;
  }

  .brand {
    gap: 0.55rem;
    padding: 0 0 0.5rem;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 0.94rem;
  }

  .metric-grid,
  .summary-strip,
  .deadline-columns,
  .report-card-grid,
  .report-grid,
  .workflow-steps,
  .import-workspace,
  .filter-panel .form-grid,
  .settings-layout,
  .damage-form-layout,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .app-topbar {
    align-items: center;
    flex-direction: row;
    gap: 0.5rem;
    height: var(--shell-topbar-height);
    min-height: 0;
    overflow: hidden;
    padding: 0 var(--space-1, 8px);
  }

  .user-chip {
    display: none;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.82rem;
  }

  .user-chip small {
    font-size: 0.62rem;
  }

  .user-chip strong {
    max-width: 100%;
    font-size: 0.78rem;
  }

  .topbar-logout,
  .topbar-action {
    flex: 0 0 auto;
    min-height: 28px;
    min-width: 0;
    padding: 3px 8px;
    font-size: 0.78rem;
  }

  .main-nav {
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0;
  }

  .nav-section {
    width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    display: block;
  }

  .nav-section-title {
    display: none;
  }

  .nav-category-button {
    min-height: 38px;
    padding: 0.54rem 0.62rem;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
  }

  .nav-category-chevron {
    font-size: 0.9rem;
  }

  .nav-category-items {
    padding: 0.1rem 0.2rem 0.42rem;
  }

  .main-nav a {
    width: 100%;
    flex: 0 1 auto;
    min-height: 32px;
    padding: 0.38rem 0.52rem;
    font-size: 0.82rem;
    white-space: normal;
  }

  .main-nav a.nav-item {
    padding: 0.38rem 0.52rem 0.38rem 1rem;
    font-size: 0.82rem;
  }

  .damage-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .secondary-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 1.65rem;
  }

  .app-sidebar {
    padding: 0.55rem 0.5rem 0.45rem;
  }

  .brand {
    gap: 0.45rem;
  }

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

  .brand small {
    display: none;
  }

  .main-nav a {
    flex: 0 1 auto;
    justify-content: flex-start;
    min-height: 30px;
    padding: 0.34rem 0.45rem;
    font-size: 0.78rem;
    text-align: left;
  }

  .main-nav a.nav-item {
    padding: 0.34rem 0.45rem 0.34rem 0.88rem;
    font-size: 0.78rem;
  }

  .nav-category-button {
    min-height: 36px;
    padding: 0.48rem 0.55rem;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
  }

  .page-content {
    width: calc(100% - 0.75rem);
    padding: 0.85rem 0 2rem;
  }

  .app-topbar {
    padding: 0 0.5rem;
  }

  .topbar-brand-name {
    display: none;
  }

  .damage-summary {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions > *,
  .form-actions > * {
    width: 100%;
  }

  .table-actions .link-button {
    display: flex;
    width: 100%;
    margin-right: 0;
  }

  .selected-file {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .deadline-center-filter-panel .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deadline-center-filter-panel .filter-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .deadline-center-filter-panel .filter-actions .primary-button,
  .deadline-center-filter-panel .filter-actions .secondary-button {
    flex: 1 1 120px;
    width: auto;
  }
}

@media (max-width: 360px) {
  .deadline-center-filter-panel .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Cockpit layout helpers */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 1rem;
  align-items: start;
  margin-top: 1.25rem;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-side {
  position: sticky;
  top: 1rem;
}

.side-panel {
  min-width: 0;
  max-width: 100%;
  padding: 1rem;
  border: 1px solid rgba(18, 24, 34, 0.6);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface-2), rgba(20, 30, 40, 0.6));
  box-shadow: 0 8px 20px rgba(2, 6, 14, 0.6);
}

.side-panels {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.side-panel-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(30, 36, 48, 0.5);
  background: rgba(6, 10, 14, 0.25);
}
.side-panel-item strong {
  font-size: 1.25rem;
  color: var(--text);
}
.side-panel-item span {
  color: var(--text-muted);
  font-size: 0.82rem;
}
.side-panel-item a.inline-link {
  margin-top: 0.45rem;
  color: var(--primary);
  font-weight: 800;
}
.panel-critical {
  border-left: 4px solid rgba(255, 77, 79, 0.92);
}
.panel-warning {
  border-left: 4px solid rgba(244, 183, 64, 0.92);
}
.panel-info {
  border-left: 4px solid rgba(43, 123, 255, 0.92);
}
.panel-muted {
  border-left: 4px solid rgba(120, 130, 140, 0.3);
}

/* Vehicle hero */
.vehicle-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 1rem;
  align-items: start;
}
.vehicle-hero-card {
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid rgba(18, 24, 34, 0.6);
  box-shadow: 0 10px 30px rgba(2, 6, 14, 0.6);
}
.vehicle-hero-actions {
  min-width: 0;
  max-width: 100%;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
  border: 1px solid rgba(18, 24, 34, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: stretch;
}
.vehicle-hero .vehicle-key-stats {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: end;
}
.vehicle-hero .vehicle-key-stats .odometer {
  text-align: right;
}
.vehicle-action-list {
  display: grid;
  gap: 0.5rem;
}
.vehicle-action-list .secondary-button {
  width: 100%;
}
.vehicle-action-list .primary-button {
  width: 100%;
}

/* Driver portal hero */
.driver-portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
  border: 1px solid rgba(18, 24, 34, 0.6);
  margin-bottom: 0;
}

.driver-quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-width: 0;
}

.driver-quick-actions .primary-button,
.driver-quick-actions .secondary-button {
  min-width: 160px;
  padding: 0.7rem 1rem;
  white-space: normal;
  text-align: center;
}

.driver-vehicles-layout {
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-template-areas: "list detail";
  gap: 1rem;
}

.driver-vehicle-detail-page {
  width: 100%;
}

.driver-vehicle-detail-page .vehicle-hero {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: stretch;
}

.driver-vehicle-detail-page .vehicle-card {
  min-width: 0;
}

.driver-vehicle-detail-page .vehicle-card strong,
.driver-vehicle-detail-page .vehicle-card small,
.driver-vehicle-detail-page .detail-grid dd,
.driver-vehicle-detail-page .damage-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}

.driver-vehicle-detail-page .driver-action-card {
  align-content: start;
}

.driver-vehicle-detail-page .vehicle-section-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: start;
}

.driver-vehicle-detail-page .table-panel {
  min-width: 0;
}

@media (max-width: 1180px) {
  .driver-vehicles-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "list"
      "detail";
  }

  .driver-vehicles-layout .driver-vehicle-list {
    position: static;
  }
}

@media (max-width: 720px) {
  .driver-vehicle-detail-page .vehicle-hero,
  .driver-vehicle-detail-page .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Analytics / Reports two-column helpers */
.analytics-main-grid,
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}
.analytics-main,
.report-grid-main {
  min-width: 0;
}

.report-grid-main {
  display: grid;
  gap: var(--space-3, 24px);
}

.analytics-side,
.report-side {
  position: sticky;
  top: 1rem;
}
.report-card {
  display: flex;
  min-width: 0;
  max-width: 100%;
  gap: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(18, 24, 34, 0.6);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  align-items: center;
}
.report-icon {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(244, 183, 64, 0.12);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--primary);
  border: 1px solid rgba(244, 183, 64, 0.18);
}
.report-card-body {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.timeline-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(9.5rem, 0.18fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-item time {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.timeline-content {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.timeline-title-row,
.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.timeline-content p {
  margin: 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.timeline-meta span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

/* Responsive adjustments for cockpit grids */
@media (max-width: 1000px) {
  .dashboard-main-grid,
  .analytics-main-grid,
  .report-grid {
    grid-template-columns: 1fr 280px;
  }
}

@media (max-width: 820px) {
  .dashboard-main-grid,
  .analytics-main-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-side,
  .analytics-side,
  .report-side {
    position: static;
  }
  .vehicle-hero {
    grid-template-columns: 1fr;
  }
  .driver-portal-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .vehicle-hero .vehicle-key-stats {
    align-items: start;
  }
  .driver-quick-actions {
    justify-content: stretch;
  }
  .driver-quick-actions .primary-button,
  .driver-quick-actions .secondary-button {
    flex: 1 1 180px;
  }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

@media (max-width: 520px) {
  .driver-quick-actions {
    flex-direction: column;
  }

  .driver-quick-actions .primary-button,
  .driver-quick-actions .secondary-button {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .driver-vehicle-detail .table-scroll {
    overflow-x: visible;
  }

  .driver-vehicle-detail .damage-table,
  .driver-vehicle-detail .damage-table thead,
  .driver-vehicle-detail .damage-table tbody,
  .driver-vehicle-detail .damage-table tr,
  .driver-vehicle-detail .damage-table th,
  .driver-vehicle-detail .damage-table td {
    display: block;
    width: 100%;
  }

  .driver-vehicle-detail .damage-table {
    min-width: 0;
  }

  .driver-vehicle-detail .damage-table thead {
    display: none;
  }

  .driver-vehicle-detail .damage-table tr {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line-soft);
  }

  .driver-vehicle-detail .damage-table tr:last-child {
    border-bottom: 0;
  }

  .driver-vehicle-detail .damage-table td {
    display: grid;
    grid-template-columns: minmax(5.8rem, 0.44fr) minmax(0, 1fr);
    gap: 0.7rem;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .driver-vehicle-detail .damage-table td + td {
    margin-top: 0.55rem;
  }

  .driver-vehicle-detail .damage-table td::before {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .driver-vehicle-detail .damage-table .status-badge,
  .driver-vehicle-detail .damage-table .link-button {
    justify-self: start;
    white-space: normal;
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(1) td:nth-child(1)::before,
  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(2) td:nth-child(1)::before {
    content: "Titel";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(1) td:nth-child(2)::before {
    content: "Kategorie";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(1) td:nth-child(3)::before {
    content: "Fällig";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(1) td:nth-child(4)::before,
  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(2) td:nth-child(4)::before {
    content: "Status";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(2) td:nth-child(2)::before {
    content: "Typ";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(2) td:nth-child(3)::before {
    content: "Geplant";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(2) td:nth-child(5)::before {
    content: "Werkstatt";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(3) td:nth-child(1)::before {
    content: "Datei";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(3) td:nth-child(2)::before {
    content: "Typ";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(3) td:nth-child(3)::before {
    content: "Größe";
  }

  .driver-vehicle-detail .vehicle-section-grid .table-panel:nth-child(3) td:nth-child(4)::before {
    content: "Aktion";
  }
}

.login-help {
  margin-top: 1rem;
  text-align: center;
}

.login-panel code {
  display: block;
  overflow-wrap: anywhere;
  padding: 0.75rem;
  border-radius: 0.35rem;
  background: rgba(0, 40, 85, 0.08);
  color: #002855;
  font-size: 0.9rem;
}
.pagination-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 0 0;
}

.pagination-button {
  min-width: 6.5rem;
}

.pagination-status {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 12rem;
  text-align: center;
}

@media (max-width: 600px) {
  .pagination-controls {
    justify-content: center;
  }

  .pagination-status {
    flex-basis: 100%;
    order: -1;
  }
}
