:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #374151;
  --primary-dark: #1f2937;
  --info: #2563eb;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-raised: 0 12px 28px rgba(17, 24, 39, 0.08);
  --radius: 8px;
  --control-height: 40px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

body:not(.is-logged-in) {
  overflow: hidden;
}

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

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.is-logged-in .login-screen {
  display: none;
}

.login-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  padding: 32px;
}

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

.brand-mark.large {
  width: 56px;
  height: 56px;
  font-size: 17px;
}

.login-company {
  color: var(--primary-dark);
  font-weight: 900;
  margin: 0 0 2px;
}

.login-card h1 {
  font-size: 25px;
  margin: 0;
}

.login-copy {
  color: var(--muted);
  line-height: 1.7;
  margin: 22px 0;
}

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

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.login-driver-select {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  color: var(--muted);
  font-weight: 800;
}

.login-actions button {
  min-height: 44px;
}

.login-button {
  min-height: 44px;
}

.login-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.purpose-disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--muted);
  padding: 12px 14px;
}

.purpose-disclosure summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.purpose-disclosure ol {
  margin: 12px 0;
  padding-left: 20px;
}

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

.sidebar {
  background: #ffffff;
  color: var(--text);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.brand-name,
.brand-sub {
  margin: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.nav-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 42px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-button.active {
  background: #f3f4f6;
  border-color: var(--line);
  color: var(--text);
  font-weight: 800;
}

.nav-button:hover {
  background: #f9fafb;
  color: var(--text);
}

.purpose-panel p {
  max-width: 960px;
  color: var(--muted);
}

.document-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
}

.document-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.document-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.document-card > span {
  color: var(--info);
  font-weight: 800;
}

.document-card h4 {
  margin: 0;
  font-size: 16px;
}

.document-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.document-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.document-card dt {
  color: var(--muted);
  font-weight: 700;
}

.document-card dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.muted-line {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.nav-button[data-view="admin"] {
  margin-bottom: 18px;
}

.settings-nav-button {
  margin-top: auto;
}

.role-driver .nav-button[data-view="admin"],
.role-driver .nav-button[data-view="sales"],
.role-driver .nav-button[data-view="billing"],
.role-driver .nav-button[data-view="work"],
.role-driver .nav-button[data-view="masters"],
.role-driver .nav-button[data-view="drivers"],
.role-driver .nav-button[data-view="settings"],
.role-driver .month-control,
.role-driver #admin-view,
.role-driver #sales-view,
.role-driver #billing-view,
.role-driver #work-view,
.role-driver #masters-view,
.role-driver #drivers-view,
.role-driver #settings-view {
  display: none !important;
}

.role-admin .driver-nav-button {
  display: none !important;
}

.driver-only-nav {
  display: none;
}

.role-driver .driver-only-nav {
  display: flex;
}

.role-admin .driver-only-nav {
  display: none !important;
}

.role-driver .nav-list {
  flex: 1;
}

.nav-button.permission-denied {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.nav-icon {
  width: 22px;
  height: 22px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.sidebar-note {
  display: none;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
  background: #f9fafb;
}

.sidebar-note p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.note-label {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1.3;
}

h2 {
  margin-bottom: 4px;
  font-size: 22px;
  line-height: 1.35;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.45;
}

.topbar p,
.section-title-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.month-control {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 6px;
  white-space: nowrap;
}

.user-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 6px;
  white-space: nowrap;
}

.user-switcher span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-switcher select {
  min-width: 120px;
  padding: 0 10px;
}

.month-control button,
.icon-button {
  width: var(--control-height);
  height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  cursor: pointer;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-title-row,
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-period-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}

.section-title-row {
  margin-bottom: 20px;
}

#admin-view > .section-title-row {
  align-items: stretch;
  border: 1px solid #d8dee8;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    linear-gradient(135deg, #e5e7eb, #ffffff);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
  margin-bottom: 14px;
  padding: 22px;
}

#admin-view > .section-title-row h2 {
  margin: 0 0 6px;
  color: #111827;
  font-size: 30px;
  line-height: 1.25;
}

#admin-view > .section-title-row p {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  font-weight: 700;
}

#admin-view .dashboard-actions {
  align-self: center;
}

#admin-view .icon-button {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.07);
  font-size: 18px;
  font-weight: 900;
}

.dashboard-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dashboard-guide div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
  box-shadow: var(--shadow);
}

.dashboard-guide span {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: #374151;
  font-weight: 900;
}

.dashboard-guide strong {
  color: #111827;
  font-size: 14px;
}

.dashboard-guide small {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.primary-action,
.secondary-action {
  min-height: var(--control-height);
  border-radius: var(--radius);
  padding: 0 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

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

.primary-action:hover {
  background: var(--primary-dark);
}

.secondary-action {
  color: var(--text);
  background: #ffffff;
  border-color: var(--line);
}

.secondary-action:hover,
.mini-action:hover,
.month-control button:hover,
.icon-button:hover,
.segmented button:hover {
  background: #f9fafb;
}

.hidden {
  display: none !important;
}

.mini-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
  padding: 0 10px;
}

.mini-action:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.danger-action {
  color: var(--danger);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

#admin-view .kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi,
.panel,
.driver-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 20px;
  min-width: 0;
  border-radius: 10px;
}

#admin-view .kpi {
  border-color: #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

#admin-view .kpi::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: #cbd5e1;
}

#admin-view .kpi:nth-child(2)::before {
  background: #64748b;
}

#admin-view .kpi:nth-child(3)::before {
  background: #f59e0b;
}

#admin-view .kpi:nth-child(4)::before {
  background: #ef4444;
}

#admin-view .kpi.alert::before {
  background: #dc2626;
}

.kpi-date-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--muted);
}

.kpi span,
.kpi small,
.driver-summary span,
.calculated-strip span {
  color: var(--muted);
}

#admin-view .kpi > span {
  display: block;
  color: #4b5563;
  font-size: 13px;
  font-weight: 900;
}

.kpi strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

#admin-view .kpi > strong {
  color: #111827;
  font-size: 28px;
  letter-spacing: 0;
}

.monthly-goal-card {
  grid-column: span 4;
  border-color: #d1d5db;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

#admin-view .monthly-goal-card {
  border-color: #cbd5e1;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98)),
    #ffffff;
}

#admin-view .monthly-goal-card::before {
  background: #374151;
}

.goal-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.goal-card-grid div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 14px;
}

#admin-view .goal-card-grid div {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

.goal-card-grid strong {
  font-size: 22px;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.goal-card-grid small {
  display: block;
  line-height: 1.5;
}

#admin-view .goal-card-grid small {
  color: #64748b;
  font-weight: 900;
}

.plan-line {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  min-width: 0;
  white-space: normal;
}

.plan-ratio-top {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.plan-diff-bottom {
  display: block;
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
  white-space: normal;
}

.kpi,
.panel,
.driver-summary > div,
.calculated-strip div,
.target-balance div,
.fuel-result,
.settings-list div,
.permission-grid div,
.chart-card,
.driver-count-item {
  min-width: 0;
}

.kpi.alert strong {
  color: var(--danger);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 18px;
}

#admin-view .panel {
  border-color: #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
}

#admin-view .panel-header {
  align-items: flex-start;
  border-bottom: 1px solid #edf2f7;
  margin: -2px -2px 14px;
  padding: 2px 2px 14px;
}

#admin-view .panel-header h3 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.35;
}

#admin-view .panel-subtext {
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

#admin-view .safety-overview {
  border-left: 5px solid #374151;
}

#admin-view .dashboard-exception-panel {
  border-left: 5px solid #dc2626;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.managed-table {
  max-height: 420px;
  overflow: auto;
}

#documents-view .table-wrap,
#drivers-view .table-wrap,
#settings-view .table-wrap {
  max-height: 460px;
  overflow: auto;
}

.managed-list {
  max-height: min(320px, 45vh);
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fafb;
}

.collapsible-section {
  padding: 0;
  overflow: visible;
}

.collapsible-section > :not(.panel-summary) {
  margin-left: 22px;
  margin-right: 22px;
}

.collapsible-section > :last-child {
  margin-bottom: 22px;
}

.panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid transparent;
  font-weight: 900;
  color: var(--text);
}

.panel-summary::-webkit-details-marker {
  display: none;
}

.panel-summary::after {
  content: "⌄";
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f9fafb;
  transition: transform 0.16s ease, background 0.16s ease;
}

.collapsible-section[open] .panel-summary {
  border-bottom-color: var(--line);
}

.collapsible-section[open] .panel-summary::after {
  transform: rotate(180deg);
  background: #ffffff;
}

.panel-summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#admin-view .table-wrap {
  border-color: #e2e8f0;
  border-radius: 10px;
  margin-top: 12px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 14px;
  text-align: left;
  white-space: nowrap;
  height: 56px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border-bottom: 1px solid #d1d5db;
}

#admin-view th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  letter-spacing: 0;
}

#admin-view td {
  color: #1f2937;
  font-weight: 700;
}

#admin-view tbody tr:hover {
  background: #f8fafc;
}

tbody tr:hover {
  background: #f9fafb;
}

td.numeric-cell,
th.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.positive-value {
  color: var(--success);
  font-weight: 900;
  white-space: nowrap;
}

.negative-value {
  color: var(--danger);
  font-weight: 900;
  white-space: nowrap;
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented button {
  border: 0;
  background: #f8fafc;
  color: var(--muted);
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
}

.segmented .selected {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(55, 65, 81, 0.12), 0 6px 14px rgba(17, 24, 39, 0.10);
  color: var(--primary);
  font-weight: 900;
}

.driver-performance-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.driver-performance-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.driver-performance-switch select,
.driver-performance-switch input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
}

.revision-request-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  text-align: left;
}

.revision-request-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.revision-request-form select,
.revision-request-form input,
.revision-request-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--text);
}

#driver-performance-label {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

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

.badge.ok {
  background: #dcfce7;
  color: var(--success);
}

.badge.warn {
  background: #fff7ed;
  color: #c2410c;
}

.approval-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.approval-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.approval-item strong {
  font-size: 14px;
}

.approval-item span {
  color: var(--muted);
  font-size: 13px;
}

.annual-dashboard-panel,
.annual-target-panel {
  margin-bottom: 16px;
}

.compact-kpis {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.annual-visual-grid,
.annual-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.annual-compare-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.annual-visual-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.annual-compare-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.target-balance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 4px;
}

.target-balance div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fafb;
  padding: 12px;
}

.target-balance span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.target-balance strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.target-management-group {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 16px;
  background: #f9fafb;
  display: grid;
  gap: 14px;
}

.target-management-header {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #ffffff;
}

.target-management-header span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 900;
}

.target-management-header h3 {
  margin: 10px 0 4px;
  font-size: 18px;
}

.target-management-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.plan-line {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 800;
  min-width: 0;
  white-space: normal;
}

.plan-line span {
  display: block;
}

.plan-ratio-top {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.plan-diff-bottom {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.plan-line .positive-value {
  color: var(--success);
}

.plan-line .negative-value {
  color: var(--danger);
}

.kpi-diff:empty {
  display: none;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.chart-card h4,
.annual-compare-grid h4 {
  margin: 0 0 12px;
}

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

.chart-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

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

.chart-bars i {
  display: block;
  height: 8px;
  border-radius: 999px;
}

.plan-bar {
  background: #d1d5db;
}

.actual-bar {
  background: var(--info);
}

.line-chart-wrap {
  display: grid;
  gap: 10px;
  overflow-x: auto;
}

.line-chart {
  width: 100%;
  min-width: 720px;
  height: auto;
}

.line-chart-grid {
  stroke: #d1d5db;
  stroke-dasharray: 5 6;
  stroke-width: 1;
}

.line-chart-axis,
.line-chart-month,
.line-chart-value {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.line-chart-value {
  fill: var(--text);
  font-size: 11px;
}

.line-chart-plan,
.line-chart-actual {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-plan {
  stroke: #9ca3af;
  stroke-width: 3;
  stroke-dasharray: 9 8;
}

.line-chart-actual {
  stroke: var(--info);
  stroke-width: 6;
}

.line-chart-marker {
  stroke: #94a3b8;
  stroke-dasharray: 4 6;
  stroke-width: 1.5;
  opacity: 0.8;
}

.line-chart-dot {
  fill: #ffffff;
  stroke: var(--info);
  stroke-width: 4;
}

.line-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.line-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.line-chart-legend i {
  width: 22px;
  height: 4px;
  border-radius: 999px;
  display: inline-block;
}

.line-chart-legend .actual {
  background: var(--info);
}

.line-chart-legend .plan {
  background: repeating-linear-gradient(90deg, #9ca3af 0 7px, transparent 7px 12px);
}

.pie-chart-wrap {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.pie-chart {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.pie-legend {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pie-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.annual-warning {
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
}

.annual-warning.ok {
  background: #dcfce7;
  color: var(--success);
}

.annual-warning.warn {
  background: #fff7ed;
  color: #c2410c;
}

.annual-target-form {
  align-items: end;
}

.annual-memo-label {
  grid-column: span 2;
}

.annual-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.compact-filter {
  min-width: 180px;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.panel-subtext {
  color: var(--muted);
  margin-top: 4px;
}

.report-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.compact-controls {
  grid-template-columns: minmax(180px, 220px);
}

.schedule-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.driver-filter-chips,
.schedule-actions,
.calendar-legend,
.calendar-events {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.driver-filter-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #ffffff;
  font-weight: 800;
}

.legend-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.work,
.schedule-cell.work,
.schedule-edit-card.work {
  background: #dcfce7;
  color: var(--success);
}

.legend-dot.nonwork,
.schedule-cell.nonwork,
.schedule-edit-card.nonwork {
  background: #fff7ed;
  color: #c2410c;
}

.legend-dot.holiday,
.schedule-cell.holiday,
.schedule-edit-card.holiday {
  background: #edf0f4;
  color: #657287;
}

.schedule-calendar {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.schedule-row {
  display: grid;
  min-width: 1200px;
  border-bottom: 1px solid var(--line);
}

.schedule-row:last-child {
  border-bottom: 0;
}

.schedule-head {
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-row > div {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
}

.schedule-row > div:last-child {
  border-right: 0;
}

.schedule-driver-name {
  justify-content: start;
  padding: 0 10px;
  font-weight: 900;
  background: #ffffff;
  position: sticky;
  left: 0;
  z-index: 1;
}

.schedule-day-head small,
.schedule-cell small,
.schedule-edit-card small {
  display: block;
  font-size: 10px;
  opacity: 0.8;
}

.schedule-cell {
  font-size: 13px;
  font-weight: 900;
  border-top: 4px solid transparent;
}

.schedule-day-head.weekday-date,
.schedule-cell.weekday-date,
.schedule-edit-card.weekday-date {
  border-top-color: #b7c3d0;
}

.schedule-day-head.saturday-date,
.schedule-cell.saturday-date,
.schedule-edit-card.saturday-date {
  border-top-color: #4b88d1;
}

.schedule-day-head.sunday-date,
.schedule-cell.sunday-date,
.schedule-edit-card.sunday-date {
  border-top-color: #d15b5b;
}

.schedule-day-head.holiday-date,
.schedule-cell.holiday-date,
.schedule-edit-card.holiday-date {
  border-top-color: #b84b43;
  box-shadow: inset 0 0 0 2px rgba(184, 75, 67, 0.18);
}

.calendar-events {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-events span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #ffffff;
}

.schedule-editor-controls {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 220px);
}

.schedule-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.schedule-edit-card {
  border: 1px solid var(--line);
  border-top-width: 4px;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.schedule-edit-card span {
  font-weight: 900;
}

.schedule-edit-card select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 8px;
}

.empty-calendar {
  min-height: 88px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.master-editor {
  grid-column: 1 / -1;
}

.fuel-section {
  order: 1;
}

.driver-settings-section {
  order: 2;
}

.calendar-section {
  order: 3;
}

.master-add-section {
  order: 4;
}

.item-master-section {
  order: 5;
}

.bulk-register-panel {
  margin-bottom: 16px;
}

.bulk-register-form {
  display: grid;
  gap: 14px;
}

.bulk-register-form fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 14px;
}

.bulk-register-form legend {
  color: var(--primary-dark);
  font-weight: 900;
  padding: 0 6px;
}

.toast-message {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: none;
  width: fit-content;
  margin: 0 0 12px auto;
  border: 1px solid #c4e5d4;
  border-radius: 8px;
  background: #f2fbf6;
  color: var(--success);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-weight: 900;
}

.toast-message.visible {
  display: block;
}

.deleted-row {
  opacity: 0.66;
}

.schedule-clear-actions {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.inline-form {
  display: grid;
  grid-template-columns: 180px minmax(180px, 1fr) minmax(220px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.announcement-form {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  max-width: 720px;
}

.announcement-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.announcement-form input {
  width: 100%;
}

.announcement-form .primary-action {
  justify-self: flex-start;
  min-width: 180px;
}

.announcement-form .save-hint {
  min-height: 18px;
}

.vehicle-expiry-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  padding: 12px;
}

.focus-highlight {
  animation: focusPulse 1.6s ease;
}

@keyframes focusPulse {
  0% {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
  }
  100% {
    outline: 3px solid transparent;
    box-shadow: none;
  }
}

.driver-directory-table .rate-input {
  min-width: 150px;
}

.master-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fuel-form {
  display: grid;
  grid-template-columns: 180px minmax(160px, 1fr) minmax(160px, 1fr) minmax(120px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.fuel-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 64px;
  background: #fbfcfe;
}

.fuel-result span,
.fuel-result strong {
  display: block;
}

.fuel-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fuel-result strong {
  margin-top: 5px;
  font-size: 18px;
}

.master-grid,
.closing-grid,
.settings-grid,
.latest-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

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

.closing-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

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

.latest-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.compact-list,
.check-list,
.export-grid,
.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 62px;
  padding: 12px;
}

.compact-item strong,
.compact-item span {
  display: block;
}

.compact-item span {
  color: var(--muted);
  font-size: 13px;
}

.compact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.master-table {
  min-width: 620px;
}

.driver-settings-table {
  min-width: 980px;
}

.rate-input {
  width: 100%;
  min-width: 112px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #ffffff;
}

.rate-input.compact-number {
  min-width: 84px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.permission-grid div,
.check-list div,
.latest-grid article,
.settings-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.permission-grid strong,
.permission-grid span,
.latest-grid strong,
.latest-grid span,
.settings-list strong,
.settings-list span {
  display: block;
}

.permission-grid span,
.latest-grid span,
.settings-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

.latest-grid span,
.settings-list span {
  margin-top: 0;
}

.check-list div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.check.ok {
  background: #dff3e9;
  color: var(--success);
}

.check.warn {
  background: #fff1df;
  color: #9c5621;
}

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

.billing-output-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.billing-output-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.billing-output-controls input,
.billing-output-controls select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
  font-weight: 800;
}

.billing-adjust-table {
  min-width: 720px;
}

.billing-adjust-table input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.billing-adjust-table td:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.document-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 18px;
}

.document-topline {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}

.document-preview h4 {
  margin: 0 0 18px;
  font-size: 22px;
}

.document-preview dl {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.document-preview dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.document-preview dt {
  color: var(--muted);
}

.document-preview dd {
  margin: 0;
  font-weight: 800;
}

.document-lines {
  min-width: 0;
  font-size: 13px;
}

.document-lines td {
  white-space: normal;
}

.payment-statement-lines th,
.payment-statement-lines td {
  font-size: 12px;
  padding: 8px 6px;
}

.document-control-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-top: 12px;
  display: grid;
  gap: 4px;
}

.document-control-box span,
.issuer-line {
  color: var(--muted);
  font-size: 12px;
}

.template-note {
  color: var(--muted);
  margin: 12px 0 0;
  font-size: 13px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.flow div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
}

.flow span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e5f2f3;
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.driver-form {
  padding: 16px;
  margin-bottom: 16px;
}

.visually-hidden-select {
  display: none;
}

.linked-readonly-field {
  background: #f9fafb;
  color: var(--text);
  font-weight: 800;
}

.driver-section-panel {
  display: none;
}

.driver-section-panel.active {
  display: block;
}

.driver-preference-grid {
  margin-bottom: 0;
}

.driver-preference-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.driver-preference-grid h4 {
  margin: 0 0 12px;
}

.driver-preference-grid label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.driver-preference-grid input,
.driver-preference-grid select,
.driver-expiry-request-form input,
.driver-expiry-request-form textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
}

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

.driver-expiry-request-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.driver-expiry-request-form .memo-label,
.driver-expiry-request-form .form-actions {
  grid-column: 1 / -1;
}

.request-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.request-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.request-card .mini-action {
  flex: 0 0 auto;
}

.request-card > div {
  min-width: 0;
}

.request-card strong,
.request-card small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.request-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.request-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.schedule-edit-card.draft {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.toggle-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.safety-overview {
  margin-bottom: 16px;
}

.warning-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.warning-item {
  border: 1px solid #f0c9bd;
  border-radius: var(--radius);
  background: #fef2f2;
  color: var(--danger);
  padding: 10px 12px;
  font-weight: 800;
  white-space: pre-line;
}

.warning-item.pending {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.warning-item.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: var(--success);
}

.driver-announcement-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.announcement-item {
  display: grid;
  gap: 4px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
  color: #1d4ed8;
  padding: 10px 12px;
}

.announcement-item strong {
  font-size: 12px;
}

.announcement-item span {
  color: var(--text);
  font-weight: 800;
}

.workflow-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.workflow-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
}

.workflow-step span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #edf2f6;
  color: var(--muted);
}

.workflow-step.active {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: #f0fbfb;
}

.workflow-step.done span {
  background: var(--success);
  color: #ffffff;
}

.workflow-step:disabled {
  opacity: 0.45;
}

.input-status-summary {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.input-status-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
}

.input-status-item span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
}

.input-status-item strong {
  font-size: 13px;
}

.input-status-item small {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.4;
}

.input-status-item.complete {
  border-color: #c4e5d4;
  background: #f2fbf6;
}

.input-status-item.complete span {
  background: var(--success);
}

.input-status-item.missing {
  border-color: #f0c9bd;
  background: #fff7f2;
}

.input-status-item.missing span {
  background: var(--accent);
}

.workflow-panel {
  display: none;
}

.workflow-panel.active {
  display: block;
}

.completion-panel.active {
  display: grid;
  place-items: start center;
  min-height: 520px;
  padding-top: 24px;
}

.completion-card {
  width: min(760px, 100%);
  border: 1px solid #c4e5d4;
  border-radius: 8px;
  background: #f6fcf9;
  padding: 28px;
  text-align: center;
}

.completion-mark {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--success);
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
}

.completion-card h3 {
  margin: 16px 0 8px;
  font-size: 24px;
}

.completion-card p {
  color: var(--muted);
  margin: 0 0 18px;
}

.work-start-panel.active,
.break-check-panel.active {
  display: grid;
  place-items: start center;
  min-height: 520px;
  padding-top: 24px;
}

.work-start-card {
  width: min(760px, 100%);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 28px;
  text-align: center;
}

.work-start-illustration {
  position: relative;
  height: 128px;
  margin: 0 auto 18px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 58%, #e5e7eb 58%, #e5e7eb 100%);
}

.break-rest-card {
  border-color: #fed7aa;
  background: #fffaf5;
}

.break-rest-card .work-start-kicker {
  background: #ffedd5;
  color: #c2410c;
}

.break-illustration {
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 64%, #f3f4f6 64%, #f3f4f6 100%);
}

.break-illustration .road-line,
.break-illustration .mini-truck,
.break-illustration .sun-mark {
  display: none;
}

.rest-cup {
  position: absolute;
  left: calc(50% - 42px);
  bottom: 28px;
  width: 84px;
  height: 54px;
  border-radius: 0 0 18px 18px;
  background: #374151;
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.16);
}

.rest-cup::after {
  content: "";
  position: absolute;
  top: 12px;
  right: -20px;
  width: 26px;
  height: 28px;
  border: 7px solid #374151;
  border-left: 0;
  border-radius: 0 18px 18px 0;
}

.rest-steam {
  position: absolute;
  bottom: 88px;
  width: 10px;
  height: 34px;
  border-radius: 999px;
  border-left: 3px solid #fb923c;
  opacity: 0.8;
}

.steam-one {
  left: calc(50% - 18px);
}

.steam-two {
  left: calc(50% + 14px);
  height: 26px;
  opacity: 0.55;
}

.rest-table {
  position: absolute;
  right: 22%;
  bottom: 24px;
  left: 22%;
  height: 5px;
  border-radius: 999px;
  background: #d1d5db;
}

.break-location-grid {
  margin-top: 18px;
  text-align: left;
}

.work-start-illustration .road-line {
  position: absolute;
  right: 18px;
  bottom: 29px;
  left: 18px;
  height: 4px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #ffffff 0 34px, transparent 34px 58px);
}

.mini-truck {
  position: absolute;
  left: calc(50% - 62px);
  bottom: 38px;
  width: 124px;
  height: 42px;
  border-radius: 8px 14px 8px 8px;
  background: #374151;
  box-shadow: inset 46px 0 0 #4b5563;
}

.mini-truck::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 24px;
  height: 14px;
  border-radius: 4px;
  background: #dbeafe;
}

.mini-truck span {
  position: absolute;
  bottom: -10px;
  width: 20px;
  height: 20px;
  border: 4px solid #111827;
  border-radius: 999px;
  background: #ffffff;
}

.mini-truck span:first-child {
  left: 22px;
}

.mini-truck span:last-child {
  right: 18px;
}

.sun-mark {
  position: absolute;
  top: 18px;
  right: 28px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f59e0b;
}

.work-start-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.work-start-card h3 {
  margin: 14px 0 8px;
  color: var(--text);
  font-size: 26px;
}

.work-start-card p {
  max-width: 520px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.work-start-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.work-start-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  text-align: left;
}

.work-start-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.work-start-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
}

.completion-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.completion-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.completion-summary span,
label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.completion-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.auto-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.auto-info-grid div,
.call-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.auto-info-grid span,
.call-status-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auto-info-grid strong,
.call-status-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.call-status-card {
  margin-top: 14px;
}

.call-status-card .danger,
.calculated-strip .danger {
  color: var(--danger);
}

.call-status-card .ok,
.calculated-strip .ok {
  color: var(--success);
}

.form-error {
  min-height: 20px;
  color: var(--danger);
  font-weight: 800;
  margin: 8px 0 0;
}

.mobile-driver-head {
  display: none;
}

.driver-step-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
  margin: 2px 0 12px;
}

.driver-step-title:not(:first-child) {
  margin-top: 20px;
}

.driver-step-title span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e5f2f3;
  color: var(--primary-dark);
}

.odometer-helper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  margin-top: 14px;
}

.odometer-helper.reference-only {
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
}

.odometer-helper div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.odometer-helper span,
.odometer-helper strong {
  display: block;
}

.odometer-helper span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.odometer-helper strong {
  margin-top: 4px;
  font-size: 18px;
}

.odometer-helper .has-adjustment {
  color: var(--accent);
}

.odometer-helper p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.odometer-helper p.warning {
  color: var(--danger);
  font-weight: 800;
}

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

.wide-field,
.form-inline-actions {
  grid-column: 1 / -1;
}

.form-inline-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.checkbox-label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.other-field {
  display: none;
}

.other-field.visible {
  display: grid;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.driver-form label.field-complete,
.driver-form label.field-missing {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.driver-form label.field-complete {
  border-color: #b8dfc8;
  background: #f2fbf6;
  color: #245f3f;
}

.driver-form label.field-missing {
  border-color: #efc0b4;
  background: #fff7f2;
  color: #8a3424;
}

.driver-form label.field-complete input,
.driver-form label.field-complete select,
.driver-form label.field-complete textarea {
  border-color: #9ed0b2;
  background: #fbfffc;
}

.driver-form label.field-missing input,
.driver-form label.field-missing select,
.driver-form label.field-missing textarea {
  border-color: #e6a797;
  background: #ffffff;
}

.driver-form label.field-complete::after,
.driver-form label.field-missing::after {
  content: attr(data-field-state);
  justify-self: start;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
}

.driver-form label.field-complete::after {
  background: #dff2e6;
  color: #287045;
}

.driver-form label.field-missing::after {
  background: #ffe2da;
  color: #ad3f2d;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.memo-label {
  margin-top: 14px;
}

.incident-detail-field {
  display: none;
}

.incident-detail-field.visible {
  display: grid;
}

.calculated-strip,
.driver-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.break-recorder-panel {
  margin: 14px 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.break-recorder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.break-recorder-head strong,
.break-recorder-head span {
  display: block;
}

.break-recorder-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.break-recorder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.break-record-list {
  display: grid;
  gap: 10px;
}

.break-record-item {
  display: grid;
  grid-template-columns: 70px repeat(4, minmax(0, 1fr)) 70px auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.break-record-item strong {
  align-self: center;
}

.break-record-item span {
  align-self: center;
  color: var(--text);
  font-weight: 900;
  text-align: right;
}

.empty-break-record {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 12px;
}

.warning-text {
  color: var(--warning);
}

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

.role-driver[data-driver-theme="blue"] {
  --primary: #2563eb;
  --info: #2563eb;
}

.role-driver[data-driver-theme="green"] {
  --primary: #16a34a;
  --info: #16a34a;
}

.role-driver[data-driver-theme="orange"] {
  --primary: #ea580c;
  --info: #ea580c;
}

.role-driver[data-driver-theme="purple"] {
  --primary: #7c3aed;
  --info: #7c3aed;
}

.role-driver.driver-dark-mode {
  --bg: #111827;
  --panel: #1f2937;
  --text: #f9fafb;
  --muted: #cbd5e1;
  --line: #374151;
  background: var(--bg);
}

.role-driver.driver-dark-mode .main,
.role-driver.driver-dark-mode .sidebar {
  background: #111827;
  color: var(--text);
}

.role-driver.driver-dark-mode .panel,
.role-driver.driver-dark-mode .driver-form,
.role-driver.driver-dark-mode .driver-preference-grid section,
.role-driver.driver-dark-mode .driver-summary div {
  background: #1f2937;
  color: var(--text);
}

.calculated-strip {
  margin: 16px 0;
}

.calculated-strip div,
.driver-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.calculated-strip strong,
.driver-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.driver-counts-card {
  grid-column: span 2;
}

.driver-counts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.driver-count-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

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

.driver-count-item strong {
  color: var(--text);
  font-size: 14px;
  margin: 0 0 4px;
}

.driver-count-item span {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.driver-count-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 4px;
}

.exception-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.exception-edit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  margin-top: 16px;
  padding: 14px;
}

.exception-edit-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.exception-edit-heading span,
.exception-edit-heading small {
  color: var(--muted);
  font-weight: 800;
}

.report-edit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  margin-bottom: 16px;
  padding: 14px;
}

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

.company-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

.company-form .form-actions {
  grid-column: 1 / -1;
}

.save-hint {
  color: var(--success);
  font-weight: 800;
}

.schedule-driver-name small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill,
.screen-badge {
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff1df;
  color: #9c5621;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.saved,
.screen-badge.saved {
  background: #dff3e9;
  color: var(--success);
}

/* Unified business-system theme overrides */
button {
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

input,
select,
textarea,
.rate-input {
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

textarea {
  padding: 12px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus,
.rate-input:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.08);
}

.panel,
.kpi,
.driver-form,
.document-preview,
.chart-card,
.approval-item,
.compact-item,
.master-editor,
.master-add-section,
.security-card,
.completion-card,
.call-status-card {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.primary-action,
.secondary-action,
.mini-action,
.icon-button,
.nav-button,
.segmented button,
.login-button {
  min-height: var(--control-height);
  border-radius: var(--radius);
}

.status-pill,
.badge,
.annual-warning {
  font-size: 12px;
}

.status-pill.saved,
.badge.ok,
.warning-item.ok,
.annual-warning.ok,
.driver-form label.field-complete::after {
  background: #dcfce7;
  color: var(--success);
}

.status-pill,
.badge.warn,
.annual-warning.warn {
  background: #fff7ed;
  color: #c2410c;
}

.danger-action,
.negative-value,
.kpi.alert strong {
  color: var(--danger);
}

.positive-value {
  color: var(--success);
}

.driver-form label.field-complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.driver-form label.field-missing {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.driver-form label.field-missing::after {
  background: #ffedd5;
  color: #c2410c;
}

.schedule-head,
th {
  background: #f9fafb;
}

.workflow-step.active,
.security-card strong,
.driver-step-title span {
  background: #f3f4f6;
  color: var(--text);
}

.workflow-step.active {
  border-color: #9ca3af;
}

.workflow-step.done span,
.completion-mark {
  background: var(--success);
  color: #ffffff;
}

.call-status-card strong.ok,
#break-check-result.ok {
  color: var(--success);
}

.call-status-card strong.danger,
#break-check-result.danger {
  color: var(--danger);
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    overflow-y: visible;
    padding: 14px;
    gap: 12px;
  }

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

  .sidebar-note {
    display: none;
  }

  .topbar,
  .section-title-row,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .driver-performance-controls {
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
  }

  .kpi-grid,
  .admin-layout,
  .annual-visual-grid,
  .annual-visual-grid-compact,
  .annual-compare-grid,
  .annual-compare-grid-single,
  .target-balance,
  .inline-form,
  .fuel-form,
  .report-controls,
  .odometer-helper,
  .odometer-helper.reference-only,
  .auto-info-grid,
  .form-grid,
  .template-grid,
  .flow,
  .master-grid,
  .closing-grid,
  .settings-grid,
  .latest-grid,
  .permission-grid,
  .settings-list,
  .export-grid,
  .billing-output-controls,
  .bulk-register-form fieldset,
  .vehicle-expiry-fields,
  .calculated-strip,
  .driver-summary {
    grid-template-columns: 1fr;
  }

  .driver-counts-card {
    grid-column: span 1;
  }

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

  .dashboard-actions,
  .exception-actions,
  .company-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  #admin-view .kpi-grid,
  .dashboard-guide {
    grid-template-columns: 1fr;
  }

  .monthly-goal-card {
    grid-column: span 1;
  }

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

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

  .workflow-progress,
  .input-status-summary,
  .completion-summary {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 18px;
  }

  .user-switcher,
  .month-control {
    width: 100%;
    justify-content: space-between;
  }

  .compact-item,
  .compact-actions,
  .master-edit-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .sidebar,
  .topbar,
  .section-title-row,
  .closing-grid,
  .flow,
  .template-grid .document-preview:first-child,
  .template-note {
    display: none !important;
  }

  .app-shell,
  .main,
  .view,
  #billing-view {
    display: block !important;
    padding: 0;
    min-height: auto;
  }

  .panel,
  .document-preview {
    box-shadow: none;
    border: 0;
  }

  .template-grid {
    display: block;
  }
}

@media (max-width: 560px) {
  body {
    background: #ffffff;
  }

  .login-card {
    padding: 22px;
  }

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

  .app-shell {
    min-height: 100svh;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 19px;
  }

  .brand-sub,
  .topbar p {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 0;
    padding: 10px;
  }

  .brand {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-button {
    justify-content: center;
    padding: 9px 6px;
    font-size: 12px;
    gap: 4px;
  }

  .nav-icon {
    display: none;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 14px;
  }

  .month-control,
  .user-switcher {
    display: none;
  }

  .mobile-driver-head {
    position: sticky;
    top: 48px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -4px -4px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
    box-shadow: var(--shadow);
  }

  .mobile-driver-head span,
  .mobile-driver-head strong {
    display: block;
  }

  .mobile-driver-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .desktop-status {
    display: none;
  }

  .driver-form {
    margin-bottom: 96px;
    padding: 14px;
  }

  .driver-form input,
  .driver-form select,
  .driver-form textarea {
    min-height: 50px;
    font-size: 16px;
  }

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

  .odometer-helper button,
  .odometer-helper p {
    grid-column: 1 / -1;
  }

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

  .form-inline-actions,
  .break-recorder-head,
  .break-recorder-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .break-recorder-panel {
    padding: 12px;
  }

  .break-record-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .break-record-item span {
    text-align: left;
  }

  .break-record-item .mini-action {
    min-height: 44px;
  }

  .calculated-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .calculated-strip div {
    padding: 10px;
  }

  .calculated-strip strong {
    font-size: 16px;
  }

  .sticky-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: #ffffff;
    border-top: 1px solid var(--line);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(21, 35, 49, 0.08);
  }

  .sticky-actions .secondary-action {
    width: 38%;
  }

  .sticky-actions .primary-action {
    width: 62%;
  }

  .pie-chart-wrap {
    grid-template-columns: 1fr;
  }

  .document-management-grid,
  .document-card-grid {
    grid-template-columns: 1fr;
  }

  .document-card dl div {
    display: grid;
    gap: 2px;
  }

  .document-card dd {
    text-align: left;
  }

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

  .panel-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
  }

  .panel-summary::after {
    position: absolute;
    right: 16px;
    top: 16px;
  }

  .panel-summary small {
    margin-left: 0;
    padding-right: 42px;
  }

  .collapsible-section {
    position: relative;
  }

  .collapsible-section > :not(.panel-summary) {
    margin-left: 16px;
    margin-right: 16px;
  }

  .annual-memo-label {
    grid-column: auto;
  }

  .form-actions {
    flex-direction: row;
  }

  .section-title-row .primary-action,
  .section-title-row .secondary-action,
  .login-actions .primary-action,
  .login-actions .secondary-action {
    width: 100%;
  }
}
