:root {
  color-scheme: light;
  --ink: #152238;
  --muted: #667085;
  --line: #dbe3ee;
  --brand: #164c83;
  --brand-dark: #0d3158;
  --accent: #d59a2f;
  --surface: #ffffff;
  --background: #f1f5f9;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif; color: var(--ink); background: var(--background); }
h1, h2, h3, p { margin-top: 0; }
button, input, select, textarea { font: inherit; }
.eyebrow { color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .16em; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 0, #2869a4, transparent 42%), linear-gradient(145deg, #0a2541, #102d50 55%, #081827); }
.login-card { width: min(440px, 100%); padding: 42px; border-radius: 24px; background: rgba(255,255,255,.97); box-shadow: 0 28px 80px rgba(0,0,0,.35); }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; color: white; background: var(--brand); font-size: 1.35rem; font-weight: 800; margin-bottom: 24px; }
.login-card h1 { margin-bottom: 7px; }
.subtitle, .privacy-note { color: var(--muted); }
.form-stack { display: grid; gap: 18px; margin-top: 28px; }
label { display: grid; gap: 8px; font-size: .9rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; background: #fff; }
input:focus { outline: 3px solid rgba(22,76,131,.14); border-color: var(--brand); }
button, .primary-link { border: 0; border-radius: 10px; padding: 13px 18px; color: white; background: var(--brand); font-weight: 800; cursor: pointer; text-decoration: none; }
button:hover, .primary-link:hover { background: var(--brand-dark); }
.alert { margin-top: 18px; padding: 12px; border-radius: 9px; color: #9b1c1c; background: #fff0f0; }
.privacy-note { margin: 24px 0 0; text-align: center; font-size: .78rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 5vw, 72px); color: white; background: var(--brand-dark); }
.topbar h1 { margin: 0; font-size: clamp(1.25rem, 3vw, 1.75rem); }
.topbar h1 span { display: block; margin-top: 5px; color: #b8cce0; font-size: .75em; font-weight: 500; }
.user-actions { display: flex; align-items: center; gap: 15px; }
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a { padding: 8px 12px; border-radius: 8px; color: #eaf2fa; text-align: center; text-decoration: none; font-size: .84rem; }
.main-nav a:hover { background: rgba(255,255,255,.1); }
.main-nav small { color: #aebfd1; }
.button-secondary { padding: 9px 13px; border: 1px solid rgba(255,255,255,.35); background: transparent; }
.dashboard { width: min(1180px, calc(100% - 40px)); margin: 32px auto 64px; }
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
.stat-grid article, .panel { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 30px rgba(35,55,80,.06); }
.stat-grid span { display: block; min-height: 42px; color: var(--muted); font-size: .88rem; }
.stat-grid strong { font-size: 2.2rem; }
.panel { margin-top: 22px; }
.panel-heading { border-bottom: 1px solid var(--line); margin: -4px 0 18px; }
.empty { margin: 0; color: var(--muted); }
.inline-actions, .row-actions, .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.muted-link { color: var(--brand); background: #e8f0f8; }
.muted-link:hover { color: white; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h2 { margin-bottom: 0; }
.success { margin-bottom: 18px; padding: 12px 16px; border-radius: 9px; color: #17633b; background: #e8f8ef; }
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { padding: 15px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); background: #f8fafc; font-size: .78rem; }
tbody tr:hover { background: #fbfdff; }
.row-actions a, .text-button, .back-link, .form-actions a { color: var(--brand); font-weight: 700; text-decoration: none; }
.text-button { padding: 0; color: #9b1c1c; background: none; font-size: inherit; }
.text-button:hover { color: #641010; background: none; }
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; color: #17633b; background: #e8f8ef; font-size: .76rem; font-weight: 800; }
.status.inactive, .status.maintenance { color: #8a3b15; background: #fff0e7; }
.status.in_service { color: #164c83; background: #e8f0f8; }
.narrow { max-width: 900px; }
.back-link { display: inline-block; margin-bottom: 18px; }
.data-form { padding: 28px; }
.form-section + .form-section { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-help { margin: 16px 0 0; color: var(--muted); font-size: .82rem; }
.form-actions { margin-top: 28px; }
.full-width { grid-column: 1 / -1; }
.padded { padding: 24px; }
.small-button { padding: 9px 12px; }
.task-list { display: grid; gap: 14px; }
.task-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.task-card h3 { margin: 10px 0 7px; }
.task-card p { margin: 4px 0; color: var(--muted); }
.status.scheduled { color: #164c83; background: #e8f0f8; }
.status.in_progress { color: #7b4d00; background: #fff5d9; }
.status.completed { color: #17633b; background: #e8f8ef; }
.status.cancelled { color: #8b1e1e; background: #ffecec; }
.status.abnormal { color: #8b1e1e; background: #ffecec; }
.photo-field { padding: 15px; border: 1px dashed #9bb1c7; border-radius: 12px; background: #f8fbff; }
.photo-field small { color: var(--muted); font-weight: 500; }
.check-list { display: grid; gap: 10px; }
.check-row { display: grid; grid-template-columns: 1fr 100px 100px; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; }
.check-row span small { display: block; margin-top: 3px; color: var(--muted); }
.radio-option { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 9px; background: #eef7f2; }
.radio-option.ng { background: #fff0f0; }
.radio-option input { width: auto; margin: 0; }
.report-form { display: grid; gap: 20px; }
.trip-card { margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.trip-number { margin-bottom: 16px; color: var(--brand); font-weight: 900; }
.trip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.trip-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 16px; }
.total-distance { margin-top: 20px; padding: 18px; border-radius: 12px; color: white; background: var(--brand-dark); text-align: right; font-size: 1.1rem; }
.small-value { font-size: 1.15rem !important; overflow-wrap: anywhere; }
.export-summary { margin-top: 24px; padding: 20px; border-radius: 12px; background: #f3f7fb; }
.export-summary h3 { margin-bottom: 12px; }
.export-summary ol { margin: 0; padding-left: 24px; color: var(--muted); line-height: 1.8; }
.language-form { margin: 0; }
.restore-form { display: flex; align-items: center; gap: 8px; }
.restore-form input { width: 135px; padding: 8px 10px; }
.danger-button { padding: 9px 12px; background: #9b1c1c; }
.danger-button:hover { background: #641010; }
.stat-danger { border-color: #e8a2a2 !important; background: #fff4f4 !important; }
.stat-danger strong { color: #9b1c1c; }
.priority { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #edf2f7; font-size: .75rem; font-weight: 800; }
.priority.important { color: #7b4d00; background: #fff5d9; }
.priority.urgent { color: #8b1e1e; background: #ffecec; }
.priority-border { padding: 16px; border-left: 4px solid #9bb1c7; border-radius: 8px; background: #f8fafc; }
.priority-border + .priority-border { margin-top: 12px; }
.priority-border.important { border-left-color: #d59a2f; }
.priority-border.urgent { border-left-color: #b42318; background: #fff5f5; }
.priority-border.read { opacity: .74; }
.new-badge { padding: 3px 7px; border-radius: 999px; color: white; background: #b42318; font-size: .65rem; vertical-align: middle; }
.reminder-list { display: grid; gap: 10px; }
.reminder-card { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fbfdff; text-decoration: none; }
.reminder-card.urgent { border-color: #e2b458; background: #fffaf0; }
.reminder-card.overdue { border-color: #e8a2a2; background: #fff2f2; }
.status-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.status-strip a { padding: 15px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.status-strip .done { border: 1px solid #9dd4b5; background: #e8f8ef; }
.status-strip .pending { border: 1px solid #e2c176; background: #fff8e7; }
code { padding: 3px 6px; border-radius: 5px; background: #edf2f7; font-size: .78rem; }
@media (max-width: 760px) {
  .login-card { padding: 28px 22px; }
  .topbar, .welcome, .page-heading { align-items: flex-start; flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .user-actions { width: 100%; justify-content: space-between; }
  .main-nav { width: 100%; overflow-x: auto; }
  .form-grid, .trip-grid { grid-template-columns: 1fr; }
  .task-card { align-items: flex-start; flex-direction: column; }
  .check-row { grid-template-columns: 1fr 75px 75px; padding: 12px; }
  .restore-form { min-width: 265px; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .reminder-card { flex-direction: column; }
}
