/* Kinton_Input_8.html の配色・雰囲気を踏襲したベーススタイル */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Meiryo', 'Yu Gothic UI', sans-serif;
  font-size: 13px;
  background: #f0f0f0;
  color: #1a1a1a;
}
a { color: #1f6bb5; }

.toolbar {
  background: #1f6bb5;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.toolbar-title { color: #fff; font-size: 15px; font-weight: bold; margin-right: auto; }
.toolbar-title a { color: #fff; text-decoration: none; }
.toolbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.toolbar nav a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 3px;
}
.toolbar nav a:hover, .toolbar nav a.active { background: rgba(255,255,255,0.2); }
.toolbar .user-info { color: #dce6f1; font-size: 12px; margin-right: 8px; }

button, .btn {
  background: #fff; border: 1px solid #ccc; padding: 5px 14px; font-size: 12px;
  cursor: pointer; border-radius: 2px; font-family: inherit;
}
button:hover, .btn:hover { background: #e8e8e8; }
button.accent, .btn.accent { background: #ff8c00; color: #fff; border-color: #d07000; font-weight: bold; }
button.accent:hover, .btn.accent:hover { background: #e07800; }
button:disabled { opacity: 0.4; cursor: default; }

.container { padding: 16px; max-width: 1600px; margin: 0 auto; }

.card {
  background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 16px; margin-bottom: 16px;
}
.card h2 { font-size: 15px; color: #1f6bb5; margin-bottom: 12px; }

.summary-bar {
  background: #f7f7f7; border: 1px solid #ccc; border-radius: 4px;
  padding: 8px 16px; display: flex; gap: 24px; align-items: center; font-size: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.summary-label { color: #666; }
.summary-value { font-weight: bold; color: #1f6bb5; }
.summary-warn { color: #e07000; font-weight: bold; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
thead th {
  background: #dce6f1; border: 1px solid #b8cde0; padding: 6px 8px; text-align: center;
  font-weight: bold; font-size: 12px; white-space: nowrap; position: sticky; top: 0;
}
tbody tr:hover td { background: #f0f7ff; }
td {
  border: 1px solid #d0d0d0; padding: 4px 6px; vertical-align: middle; font-size: 12px;
}
td.row-num { background: #f5f5f5; text-align: center; color: #888; width: 28px; }
td input[type=text], td input[type=number], td select, td textarea {
  width: 100%; border: none; background: transparent; font-size: 12px; font-family: inherit;
  padding: 3px 4px; outline: none; color: #1a1a1a;
}
td input:focus, td select:focus, td textarea:focus { background: #fffbcc; outline: 1px solid #1f6bb5; }
td.duration { text-align: center; color: #555; background: #fafafa; white-space: nowrap; }
td.time-error input { background: #ffe0e0 !important; outline: 1px solid #cc0000 !important; }
tr.non-billing td { background: #f2f2f2; color: #777; }
tr.has-warning td.duration { position: relative; }
.overlap-warn { display: inline-block; margin-left: 3px; color: #e07000; font-size: 12px; cursor: help; }

.flag-badge {
  display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 11px; font-weight: bold;
  cursor: pointer; user-select: none;
}
.flag-1 { background: #e0e0e0; color: #555; }
.flag-0 { background: #c6efce; color: #276221; }
.flag-overridden { outline: 2px solid #f0a500; outline-offset: 1px; }

.del-cell { text-align: center; width: 28px; }
.del-cell button { background: none; border: none; cursor: pointer; color: #aaa; font-size: 14px; padding: 0 4px; }
.del-cell button:hover { color: #cc0000; }

.add-row-btn {
  width: 100%; text-align: left; background: #f7f7f7; border: none; border-top: 1px solid #d0d0d0;
  border-bottom: 1px solid #d0d0d0; padding: 8px 12px; cursor: pointer; color: #1f6bb5; font-size: 12px;
  font-family: inherit;
}
.add-row-btn:hover { background: #eef5ff; }

/* カレンダー（Kinton_Input_8.html から移植） */
.cal-wrap { position: relative; display: inline-block; }
.date-picker-input {
  cursor: pointer; background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="%231f6bb5" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>') no-repeat right 8px center;
  background-size: 16px; padding: 8px 30px 8px 8px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; font-family: inherit; width: 140px;
}
.cal-popup {
  display: none; position: absolute; top: 38px; left: 0; z-index: 200; background: #fff;
  border: 1px solid #999; border-radius: 3px; box-shadow: 3px 5px 14px rgba(0,0,0,.25); padding: 10px; width: 224px;
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav-btn { background: #f0f0f0; border: 1px solid #ccc; border-radius: 2px; cursor: pointer; font-size: 13px; padding: 2px 10px; font-family: inherit; line-height: 1.4; }
.cal-nav-btn:hover { background: #dce6f1; }
.cal-title { font-size: 13px; font-weight: bold; color: #1f6bb5; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 10px; color: #888; padding: 2px 0; }
.cal-day { text-align: center; font-size: 12px; padding: 4px 2px; border-radius: 2px; cursor: pointer; border: 1px solid transparent; }
.cal-day:hover { background: #dce6f1; }
.cal-day.is-today { background: #fff3cd; font-weight: bold; }
.cal-day.has-data { color: #1f6bb5; font-weight: bold; }
.cal-day.is-active { background: #1f6bb5 !important; color: #fff !important; border-color: #1f6bb5; }
.cal-day.is-blank { visibility: hidden; cursor: default; }
.cal-day.is-weekend { color: #bbb; }
.cal-day.is-holiday { color: #e88; }
.cal-day.no-data-weekday { background: #fff0f0; color: #c0392b; }
.cal-day.no-data-weekday::after { content: '！'; font-size: 8px; vertical-align: super; }

.login-wrap {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-box {
  background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 32px; width: 320px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.login-box h1 { color: #1f6bb5; font-size: 18px; margin-bottom: 20px; text-align: center; }
.login-box label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; margin-top: 12px; }
.login-box input {
  width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; font-family: inherit;
}
.login-box button { width: 100%; margin-top: 20px; padding: 10px; background: #1f6bb5; color: #fff; border: none; font-weight: bold; }
.login-box button:hover { background: #185a9a; }
.login-error { color: #cc0000; font-size: 12px; margin-top: 10px; text-align: center; }

.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.filter-bar .field { display: flex; flex-direction: column; gap: 3px; }
.filter-bar label { font-size: 11px; color: #666; }
.filter-bar input, .filter-bar select { padding: 5px 6px; border: 1px solid #ccc; border-radius: 2px; font-size: 12px; font-family: inherit; }

/* 日付タブ（Kinton_Input_8.html の date-tabs を移植） */
.date-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 12px; }
.date-tabs:empty { display: none; }
.date-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px;
  font-size: 12px; border: 1px solid #ccc; border-radius: 3px;
  background: #e8e8e8; color: #555; cursor: pointer; user-select: none;
}
.date-tab:hover { background: #dce6f1; }
.date-tab.active { background: #1f6bb5; color: #fff; font-weight: bold; border-color: #1f6bb5; }
.tab-close { background: none; border: none; cursor: pointer; color: #999; font-size: 12px; padding: 0 2px; line-height: 1; }
.date-tab.active .tab-close { color: #dce6f1; }
.tab-close:hover { color: #cc0000; }
a.date-tab { text-decoration: none; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #333; color: #fff;
  padding: 8px 20px; border-radius: 3px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 999;
}
.toast.show { opacity: 1; }

.report-table td, .report-table th { text-align: right; }
.report-table td:first-child, .report-table th:first-child { text-align: left; }
.report-table tr.total-row td { font-weight: bold; background: #f7f7f7; }

/* ノートPCの小さいウィンドウ向け調整 */
@media (max-width: 900px) {
  .container { padding: 10px; }
  .card { padding: 10px; }
  .toolbar { padding: 6px 10px; gap: 10px; }
  .toolbar-title { font-size: 14px; }
  .summary-bar { gap: 14px; padding: 6px 10px; }
  .filter-bar { gap: 8px; }
}

/* 大画面（22インチ相当・幅1600px以上）向けに拡大 */
@media (min-width: 1600px) {
  body { font-size: 14px; }
  .container { max-width: 1900px; }
  .card h2 { font-size: 16px; }
  button, .btn { padding: 6px 16px; font-size: 13px; }
  .summary-bar { font-size: 13px; }
  .summary-value { font-size: 13px; }
  thead th { font-size: 13px; padding: 8px 10px; }
  td { font-size: 13px; padding: 6px 8px; }
  td input[type=text], td input[type=number], td select, td textarea { font-size: 13px; }
  .date-picker-input { font-size: 14px; padding: 9px 32px 9px 10px; width: 150px; }
  .date-tab { font-size: 13px; padding: 6px 8px 6px 14px; }
}
