:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --sidebar: #1f2937;
  --sidebar-hover: #374151;
  --sidebar-active: #111827;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #047857;
  --success-bg: #ecfdf5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --info: #0369a1;
  --info-bg: #f0f9ff;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

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

#app {
  min-height: 100%;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: #e5e7eb;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand {
  padding: 4px 12px 20px;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.brand p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.nav-label {
  padding: 16px 12px 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #9ca3af;
}

.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #d1d5db;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.nav-btn:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-btn.is-active {
  background: var(--sidebar-active);
  color: #fff;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  font-size: 11px;
  color: #9ca3af;
}

.main {
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.topbar .sub {
  color: var(--muted);
  font-size: 13px;
}

.content {
  padding: 24px 28px 48px;
  max-width: 1280px;
}

.notice {
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid #fcd34d;
  color: #92400e;
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger);
}

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

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

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.stat .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.stat.success .value { color: var(--success); }
.stat.info .value { color: var(--info); }
.stat.warning .value { color: var(--warning); }
.stat.danger .value { color: var(--danger); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.grow {
  flex: 1;
}

.usage {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
  margin: 8px 0;
}

.usage span {
  display: block;
  height: 100%;
}

.usage-rented { background: #0284c7; }
.usage-reserved { background: #d97706; }
.usage-washing { background: #6b7280; }
.usage-maintenance { background: #dc2626; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 12px;
  color: var(--muted);
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.split {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

.charts {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding-top: 8px;
}

.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.bar .col {
  width: 100%;
  background: #3b82f6;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.bar .n {
  font-size: 11px;
  font-weight: 600;
}

.bar .d {
  font-size: 11px;
  color: var(--muted);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
}

.pill:hover {
  background: #f9fafb;
}

.pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
}

.btn:hover {
  background: #f9fafb;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #1e40af;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.search {
  width: 260px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  background: #f9fafb;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f9fafb;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-available { background: var(--success-bg); color: var(--success); }
.badge-washing { background: #f3f4f6; color: #4b5563; }
.badge-reserved { background: var(--warning-bg); color: var(--warning); }
.badge-rented { background: var(--info-bg); color: var(--info); }
.badge-maintenance { background: var(--danger-bg); color: var(--danger); }
.badge-dispatched { background: var(--info-bg); color: var(--info); }
.badge-returned { background: var(--warning-bg); color: var(--warning); }
.badge-billed { background: var(--success-bg); color: var(--success); }

tbody tr.is-retired td {
  color: var(--muted);
}

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

.board-col {
  background: #eef0f3;
  border-radius: var(--radius);
  padding: 10px;
  min-height: 240px;
}

.board-col h4 {
  margin: 0 0 8px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

.v-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 6px;
  cursor: pointer;
}

.v-card:hover,
.v-card.is-active {
  border-color: var(--accent);
}

.v-card strong {
  display: block;
  font-size: 13px;
}

.v-card small {
  color: var(--muted);
  font-size: 11px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  display: flex;
  justify-content: flex-end;
  z-index: 20;
}

.drawer {
  width: min(440px, 100%);
  height: 100%;
  background: #fff;
  padding: 24px;
  overflow: auto;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
}

.drawer h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.meta dt {
  font-size: 11px;
  color: var(--muted);
}

.meta dd {
  margin: 0;
  font-weight: 600;
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.step .num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e5e7eb;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.step.is-done .num,
.step.is-current .num {
  background: var(--accent);
  color: #fff;
}

.step.is-current {
  color: var(--text);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 30;
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

.caption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .stats,
  .stats-5,
  .charts,
  .board,
  .form-grid,
  .split {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .brand {
    padding: 0 8px 0 0;
  }

  .nav-btn {
    width: auto;
  }

  .sidebar-foot {
    display: none;
  }
}
