:root {
  --primary: #2a245c;
  --primary-dark: #1d1848;
  --primary-light: #4c4a79;
  --secondary: #2dabe1;
  --secondary-dark: #168cc2;
  --secondary-light: #eaf7fc;
  --accent: #f3ae41;
  --accent-light: #fff3dd;
  --background: #f7f9fc;
  --surface: #ffffff;
  --border: #e5eaf0;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;
  --shadow: 0 16px 40px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-main);
  background: var(--background);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(45, 171, 225, 0.13), transparent 32%),
    linear-gradient(315deg, rgba(243, 174, 65, 0.13), transparent 30%),
    var(--background);
}

.auth-shell {
  width: min(100%, 440px);
}

.login-card,
.panel,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 22px;
  padding: 34px;
  border-radius: 16px;
}

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

.login-brand strong,
.brand strong {
  display: block;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--primary);
  background: linear-gradient(135deg, #ffffff, #eaf7fc);
  font-weight: 800;
}

.brand-mark.large {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-copy h1,
.page-header h1 {
  margin: 0;
  color: var(--text-main);
  font-size: 30px;
  line-height: 1.12;
}

.login-copy p,
.page-header p {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.search-box input {
  width: 100%;
  border: 1px solid #d9e2ec;
  outline: none;
  color: var(--text-main);
  background: #ffffff;
}

.field input,
.field select {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
}

.field input:focus,
.field select:focus,
.search-box:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(45, 171, 225, 0.16);
}

.field small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.button-primary {
  color: #ffffff;
  background: var(--primary);
}

.button-secondary {
  color: var(--secondary-dark);
  background: var(--secondary-light);
}

.button-danger {
  color: #991b1b;
  background: #feecec;
}

.button.compact {
  min-height: 36px;
  padding: 8px 12px;
}

.button.full {
  width: 100%;
}

.text-link {
  justify-self: center;
  color: var(--secondary-dark);
  font-size: 14px;
  font-weight: 700;
}

.alert {
  display: grid;
  gap: 6px;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.45;
}

.alert small {
  color: inherit;
  opacity: 0.82;
  overflow-wrap: anywhere;
}

.alert-danger {
  color: #991b1b;
  background: #feecec;
}

.alert-success {
  color: #166534;
  background: #eafbef;
  border: 1px solid rgba(34, 197, 94, 0.24);
  margin-bottom: 16px;
}

.alert-warning {
  color: #92400e;
  background: var(--accent-light);
  border: 1px solid rgba(243, 174, 65, 0.34);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.menu {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.menu-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border-left: 4px solid transparent;
  border-radius: 12px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 700;
}

.menu-item.active,
.menu-item:hover {
  border-left-color: var(--secondary);
  color: #ffffff;
  background: rgba(45, 171, 225, 0.16);
}

.menu-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: inherit;
}

.menu-icon::before {
  font-size: 16px;
  line-height: 1;
}

.menu-icon[data-icon="grid"]::before { content: "▦"; }
.menu-icon[data-icon="truck"]::before { content: "▣"; }
.menu-icon[data-icon="route"]::before { content: "⇢"; }
.menu-icon[data-icon="calendar"]::before { content: "□"; }
.menu-icon[data-icon="user"]::before { content: "◉"; }
.menu-icon[data-icon="users"]::before { content: "◎"; }
.menu-icon[data-icon="building"]::before { content: "▤"; }
.menu-icon[data-icon="box"]::before { content: "▧"; }
.menu-icon[data-icon="layers"]::before { content: "▨"; }
.menu-icon[data-icon="file"]::before { content: "▥"; }
.menu-icon[data-icon="settings"]::before { content: "⚙"; }

.main-shell {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.search-box {
  display: flex;
  width: min(100%, 520px);
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  background: #ffffff;
}

.search-box input {
  min-width: 0;
  border: 0;
  padding: 0;
}

.search-icon::before {
  content: "⌕";
  color: var(--text-muted);
  font-size: 18px;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-main);
  background: #ffffff;
  cursor: pointer;
}

.notification-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #cbd5e1;
}

.notification-dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(243, 174, 65, 0.18);
}

.notification-area {
  position: relative;
}

.notification-button small {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: var(--danger);
  font-size: 10px;
  font-weight: 800;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: none;
  width: min(360px, 86vw);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.notification-area:hover .notification-popover,
.notification-area:focus-within .notification-popover {
  display: grid;
  gap: 10px;
}

.notification-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-preview {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.notification-preview.unread {
  border-color: rgba(243, 174, 65, 0.45);
  background: var(--accent-light);
}

.notification-preview strong,
.notification-preview span,
.notification-preview small {
  display: block;
}

.notification-preview strong {
  font-size: 13px;
}

.notification-preview span,
.notification-preview small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.menu-lines,
.menu-lines::before,
.menu-lines::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-main);
}

.menu-lines::before,
.menu-lines::after {
  content: "";
  position: relative;
}

.menu-lines::before {
  top: -6px;
}

.menu-lines::after {
  top: 4px;
}

.mobile-only {
  display: none;
}

.user-chip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 10px 6px 6px;
  background: #ffffff;
}

.user-chip > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
}

.user-chip strong,
.user-chip small {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip small {
  color: var(--text-muted);
  font-size: 12px;
}

.content {
  min-width: 0;
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--secondary-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.metric-card {
  display: grid;
  min-height: 132px;
  gap: 10px;
  border-radius: 16px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  font-size: 34px;
  line-height: 1;
}

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

.settings-card {
  display: grid;
  min-height: 156px;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-card .menu-icon {
  width: 42px;
  height: 42px;
  color: var(--secondary-dark);
  background: var(--secondary-light);
}

.settings-card strong {
  font-size: 18px;
}

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

.dashboard-filter-panel {
  margin-bottom: 18px;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.dashboard-chart:last-child {
  grid-column: 1 / -1;
}

.chart-bars {
  display: grid;
  gap: 14px;
}

.chart-bar-row {
  display: grid;
  gap: 7px;
}

.chart-bar-label {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-bar-label span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-bar-label strong {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 13px;
}

.chart-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.chart-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), var(--primary-light));
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.panel {
  border-radius: 16px;
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge-info {
  color: var(--secondary-dark);
  background: var(--secondary-light);
}

.badge-success {
  color: #15803d;
  background: #eafbef;
}

.badge-muted {
  color: #4b5563;
  background: #eef2f7;
}

.status-pedido_criado,
.status-liberado_logistica,
.status-chegou_obra {
  color: var(--secondary-dark);
  background: var(--secondary-light);
}

.status-entrega_programada {
  color: #1d4ed8;
  background: #e0ecff;
}

.status-materiais_validados,
.status-entrega_concluida {
  color: #15803d;
  background: #eafbef;
}

.status-materiais_divergentes,
.status-aguardando_validacao {
  color: #b45309;
  background: var(--accent-light);
}

.status-em_transporte {
  color: var(--primary);
  background: #eeeafe;
}

.status-entrega_divergente,
.status-entrega_cancelada {
  color: #991b1b;
  background: #feecec;
}

.badge-warning {
  color: #b45309;
  background: var(--accent-light);
}

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

.timeline li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
}

.timeline span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--secondary);
  box-shadow: 0 0 0 5px var(--secondary-light);
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-list div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.task-list small {
  color: var(--text-muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 14px 12px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table td {
  font-size: 14px;
}

.data-table td strong,
.data-table td small {
  display: block;
}

.data-table td small,
.muted {
  color: var(--text-muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 999px;
  vertical-align: -2px;
  background: var(--swatch);
}

.form-panel {
  display: grid;
  gap: 18px;
}

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

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-weight: 700;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.empty-state {
  display: grid;
  max-width: 560px;
  gap: 14px;
  margin: 60px auto;
  place-items: center;
  text-align: center;
}

.empty-state h1 {
  margin: 0;
  font-size: 28px;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  color: #991b1b;
  background: #feecec;
  font-size: 28px;
  font-weight: 800;
}

.empty-inline {
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}

.panel-subheader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.panel-subheader h2 {
  margin: 0;
  font-size: 18px;
}

.panel-subheader p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.field textarea,
.material-row input,
.material-row select {
  width: 100%;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  outline: none;
  color: var(--text-main);
  background: #ffffff;
}

.field textarea {
  padding: 12px 14px;
  resize: vertical;
}

.materials-table {
  display: grid;
  gap: 10px;
}

.material-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(180px, 1.6fr) minmax(72px, 0.6fr) repeat(3, minmax(105px, 0.9fr)) minmax(120px, 1fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #ffffff;
}

.material-row input,
.material-row select {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.delivery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.detail-list div {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.detail-list dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 5px 0 0;
  font-weight: 700;
}

.timeline-detailed li {
  align-items: flex-start;
}

.timeline-detailed strong,
.timeline-detailed small,
.timeline-detailed p {
  display: block;
}

.timeline-detailed small,
.timeline-detailed p {
  color: var(--text-muted);
}

.timeline-detailed p {
  margin: 5px 0 0;
}

.history-diff {
  margin: 8px 0 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-muted);
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.45;
}

.history-diff.compact {
  max-width: 320px;
  max-height: 160px;
  margin: 0;
  white-space: pre-wrap;
}

.audit-table {
  min-width: 1120px;
}

.calendar-filter-panel {
  margin-bottom: 16px;
}

.calendar-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--swatch);
}

.calendar-legend i.late {
  background: var(--danger);
}

.calendar-panel {
  overflow: hidden;
}

#logistics-calendar {
  min-height: 620px;
}

.fc {
  color: var(--text-main);
  font-family: inherit;
}

.fc .fc-toolbar-title {
  font-size: 20px;
  font-weight: 800;
}

.fc .fc-button-primary {
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  font-weight: 800;
}

.fc .fc-button-primary:not(:disabled):hover,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--secondary-dark);
}

.fc .fc-daygrid-day.fc-day-today,
.fc .fc-timegrid-col.fc-day-today {
  background: var(--secondary-light);
}

.fc .fc-event {
  border-width: 0 0 0 5px;
  border-radius: 10px;
  padding: 5px 6px;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.06);
}

.fc .calendar-event {
  border-left-color: var(--event-color) !important;
}

.fc .calendar-event-late {
  outline: 2px solid rgba(239, 68, 68, 0.28);
}

.calendar-event-content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.calendar-event-content strong,
.calendar-event-content span,
.calendar-event-content small,
.calendar-event-content em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-content strong {
  font-size: 12px;
}

.calendar-event-content span,
.calendar-event-content small,
.calendar-event-content em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
}

.driver-delivery-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.driver-card,
.driver-flow-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.driver-card-main {
  display: grid;
  gap: 8px;
}

.driver-card-main h2 {
  margin: 0;
  font-size: 22px;
}

.driver-card-main p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.4;
}

.driver-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.driver-card-meta div {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fbfdff;
}

.driver-card-meta dt,
.driver-detail-list dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.driver-card-meta dd,
.driver-detail-list dd {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.driver-page-header .button {
  flex: 0 0 auto;
}

.driver-flow-panel {
  margin-bottom: 16px;
}

.driver-action-stack {
  display: grid;
  gap: 10px;
}

.driver-action {
  min-height: 56px;
  font-size: 16px;
}

.driver-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.driver-detail-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.driver-material-list {
  display: grid;
  gap: 10px;
}

.driver-material-item,
.driver-material-edit {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.driver-material-item strong,
.driver-material-item span,
.driver-material-item small,
.driver-material-edit strong,
.driver-material-edit small {
  display: block;
}

.driver-material-item span,
.driver-material-item small,
.driver-material-edit small {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.driver-material-edit {
  grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 0.8fr) minmax(180px, 1fr);
  align-items: end;
}

.driver-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.driver-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
  cursor: pointer;
}

.driver-choice input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.driver-choice strong,
.driver-choice small {
  display: block;
}

.driver-choice small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.attachment-sections {
  display: grid;
  gap: 18px;
}

.attachment-section {
  display: grid;
  gap: 10px;
}

.attachment-section h3 {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.attachment-section .attachment-grid {
  margin-top: 0;
}

.attachment-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
}

.attachment-item img,
.attachment-file {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  border-radius: 10px;
  background: #eef2f7;
  object-fit: cover;
}

.attachment-file {
  color: var(--primary);
  font-weight: 800;
}

.attachment-item strong,
.attachment-item small {
  display: block;
  overflow-wrap: anywhere;
}

.attachment-item small {
  color: var(--text-muted);
  font-size: 12px;
}

.notification-list-page {
  display: grid;
  gap: 12px;
}

.notification-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.notification-row.unread {
  border-color: rgba(243, 174, 65, 0.48);
  background: var(--accent-light);
}

.notification-row h2 {
  margin: 8px 0 4px;
  font-size: 17px;
}

.notification-row p,
.notification-row small {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

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

  .dashboard-metric-grid,
  .dashboard-filters,
  .dashboard-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .driver-detail-grid,
  .driver-material-edit {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    width: min(84vw, 300px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

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

  .mobile-only {
    display: grid;
  }

  .topbar {
    padding: 12px;
  }

  .search-box {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .user-chip div {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .page-header {
    display: grid;
  }

  .driver-card-meta,
  .driver-choice-grid,
  .driver-detail-list {
    grid-template-columns: 1fr;
  }

  .driver-page-header .button {
    width: 100%;
  }

  .notification-row {
    display: grid;
  }

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

  .dashboard-metric-grid,
  .dashboard-filters,
  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }

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

  .form-actions {
    display: grid;
  }

  .panel-subheader {
    display: grid;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .calendar-filters {
    grid-template-columns: 1fr;
  }

  .fc .fc-toolbar {
    display: grid;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .auth-body {
    padding: 14px;
  }

  .login-card {
    padding: 24px;
  }

  .login-copy h1,
  .page-header h1 {
    font-size: 26px;
  }

  .topbar-actions form {
    display: none;
  }
}
