:root { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
body { margin: 0; background: #f6f7fb; color: #111; }
.container { max-width: 980px; margin: 0 auto; padding: 16px; }
.card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.row { display:flex; gap:12px; flex-wrap: wrap; }
.field { flex: 1 1 220px; display:flex; flex-direction:column; gap:6px; }
label { font-size: 12px; color:#444; }
input, select, textarea { padding: 10px; border: 1px solid #d7dbe7; border-radius: 10px; font-size: 14px; }
textarea { min-height: 90px; }
.btn { display:inline-block; padding: 10px 14px; border-radius: 10px; border: 0; cursor: pointer; background:#111; color:#fff; }
.btn.secondary { background:#606a80; }
.btn.secondary:hover{background:#ddd; color: #111; transition: .18s ease;}
.btn.run { background:#07b64a; }
.btn.run:hover{background:#caf1d6; color: #05530b; transition: .18s ease;}
.btn.danger { background:#c0392b; }
.btn.danger:hover{background:#ffc8c8; color: #ac0000; transition: .18s ease;}
.table { width:100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; border-bottom: 1px solid #eee; font-size: 14px; }
.nav { display:flex; gap:12px; align-items:center; flex-wrap: wrap; margin-bottom: 12px;}
.flash { padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.flash.ok { background: #e8fff1; border:1px solid #b7f2cd; }
.flash.ng { background: #ffecec; border:1px solid #ffbcbc; }
.errors { color:#b00020; font-size: 13px; }
@media (max-width: 640px) {
  .container { padding: 10px; }
  .card { padding: 12px; }
  .table th:nth-child(3), .table td:nth-child(3) { display:none; } /* スマホは列を少し隠す例 */
}






/* --- Nav redesign --- */
.nav {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.nav-left, .nav-right { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.brand { text-decoration:none; color:#111; margin-right: 8px; }
.nav-link {
  text-decoration:none;
  color:#111;
  padding: 8px 10px;
  border-radius: 10px;
}
.nav-link:hover { background:#f2f4f8; }
.nav-link.active { background:#111; color:#fff; }

.nav-item { position: relative; }
.has-dropdown .dropdown{
  position:absolute;
  top: 29px;
  left: 0;
  min-width: 160px;
  background:#fff;
  border:1px solid #eef0f6;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.10);
  padding: 6px;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 50;
}
.has-dropdown:hover .dropdown,
.has-dropdown.open .dropdown{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-item{
  display:block;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration:none;
  color:#111;
}
.dropdown-item:hover { background:#f2f4f8; }

.nav-user { color:#444; font-size: 14px; }





/* --- Sticky header for expense list --- */
.table-wrap{
  max-height: 70vh;   /* 画面の高さに応じて一覧が長くてもヘッダ固定が効きやすい */
  overflow: auto;
  border-radius: 12px;
}
.table.sticky thead th{
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

/* action column */
.col-actions { width: 72px; text-align:center; white-space:nowrap; }
.icon-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  text-decoration:none;
  background:#f2f4f8;
}
.icon-btn:hover { background:#e8ecf5; }





/* --- Validation UI --- */
.is-invalid {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}
.error-text {
  color: #b00020;
  font-size: 13px;
  margin-top: 6px;
}
.error-summary {
  border: 1px solid #ffbcbc;
  background: #ffecec;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
}
.error-summary h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
}
.error-summary ul { margin: 0; padding-left: 18px; }
.error-summary a { color: #b00020; text-decoration: underline; }
.dup-warning {
  border: 1px solid #ffe08a;
  background: #fff7da;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
}





/* ===== Brand logo in nav ===== */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.brand-logo {
  display: block;
  height: 32px;   /* まずはこのくらい */
  width: auto;
  max-width: 220px;
}

/* スマホで少し小さく */
@media (max-width: 768px) {
  .brand-logo {
    height: 26px;
    max-width: 180px;
  }
}






