/* 光回線 営業管理アプリ — モバイルファースト */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  background: #f3f6fa;
  color: #1f2933;
  -webkit-text-size-adjust: 100%;
}
h1, h2 { margin: 0; font-weight: 700; }

/* App bar */
.appbar {
  background: linear-gradient(135deg, #1F4E78 0%, #2E75B6 100%);
  color: #fff;
  padding: env(safe-area-inset-top) 16px 12px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.appbar h1 { font-size: 18px; padding-top: 12px; }
.month-switch {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 8px;
}
.month-switch button {
  background: rgba(255,255,255,0.2); border: 0; color: #fff;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 22px; cursor: pointer;
}
.month-switch button:active { background: rgba(255,255,255,0.4); }
#monthLabel { font-size: 17px; font-weight: 600; min-width: 110px; text-align: center; }

/* Tabs */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e0e6ee;
  position: sticky; top: 102px; z-index: 9;
}
.tab {
  flex: 1; padding: 14px 0; border: 0; background: transparent;
  color: #64748b; font-size: 14px; font-weight: 600; cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab.is-active { color: #1F4E78; border-bottom-color: #1F4E78; background: #f8fafc; }

/* Main / panels */
main { padding: 12px; max-width: 720px; margin: 0 auto; }
.panel { display: none; }
.panel.is-active { display: block; }

.card {
  background: #fff; border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card h2 { font-size: 15px; color: #1F4E78; margin-bottom: 12px; }

.lbl {
  display: block; font-size: 13px; font-weight: 600;
  color: #475569; margin: 12px 0 6px;
}
.lbl:first-child { margin-top: 0; }

input.big, select.big, textarea {
  width: 100%; padding: 12px;
  font-size: 16px; /* iOS で zoom させない */
  border: 1px solid #cbd5e1; border-radius: 8px;
  background: #fff; color: #1f2933;
  font-family: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #2E75B6;
  box-shadow: 0 0 0 3px rgba(46,117,182,0.18);
}

.chk-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.chk-row input { width: 22px; height: 22px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.actions { display: flex; gap: 8px; margin-top: 16px; }
.btn {
  flex: 1; padding: 14px; border: 0; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.btn.primary { background: #1F4E78; color: #fff; }
.btn.primary:active { background: #163b5c; }
.btn.danger { background: #fff; color: #dc2626; border: 1px solid #fecaca; }
.btn.danger:active { background: #fef2f2; }

.msg { font-size: 13px; min-height: 18px; margin-top: 8px; }
.msg.ok { color: #059669; }
.msg.err { color: #dc2626; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
table.data th, table.data td {
  padding: 8px 6px; text-align: center; border-bottom: 1px solid #e2e8f0;
}
table.data thead th {
  background: #f1f5f9; color: #1F4E78; font-weight: 700;
  position: sticky; top: 0;
}
table.data tbody tr:nth-child(even) { background: #f8fafc; }
table.data tfoot th { background: #FFE699; }
table.data td:first-child, table.data th:first-child { text-align: left; }

/* Lists */
.list .row {
  padding: 10px 0; border-bottom: 1px solid #eef2f7;
  display: grid; grid-template-columns: 80px 1fr auto; gap: 8px;
  align-items: center; font-size: 14px;
}
.list .row .d { font-weight: 600; color: #1F4E78; }
.list .row .meta { color: #64748b; font-size: 12px; }
.list .row .nums { font-variant-numeric: tabular-nums; color: #1f2933; }
.list .empty { color: #94a3b8; padding: 24px 0; text-align: center; }

/* Staff management */
.staff-list .item {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #eef2f7;
}
.staff-list .item input {
  flex: 1; padding: 10px; font-size: 15px;
  border: 1px solid transparent; border-radius: 6px; background: #f8fafc;
}
.staff-list .item input:focus { background: #fff; border-color: #2E75B6; }
.staff-list .item .del {
  background: transparent; border: 0; color: #dc2626;
  font-size: 18px; padding: 6px 10px; cursor: pointer;
}
.add-row { display: flex; gap: 8px; margin-top: 12px; }
.add-row input { flex: 1; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; }
.add-row .btn { flex: 0 0 auto; padding: 10px 16px; }
.hint { font-size: 12px; color: #64748b; margin-top: 12px; }

/* Footer */
.foot {
  text-align: center; color: #94a3b8; font-size: 12px;
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* PC width */
@media (min-width: 720px) {
  .appbar h1 { font-size: 22px; }
  .card { padding: 20px; }
  .actions .btn { flex: 0 0 auto; padding: 12px 28px; }
}
