:root {
  --navy: #1f4e78;
  --light: #d9e1f2;
  --input: #fff2cc;
  --border: #ccc;
  --danger: #c00000;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Arial, sans-serif;
  margin: 0;
  color: #1a1a1a;
  background: #fafafa;
}
header {
  background: var(--navy);
  color: white;
  padding: 12px 24px;
}
header h1 { margin: 0; font-size: 20px; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 12px; flex-wrap: wrap; }
.client-switcher select { padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border); }
nav a {
  color: white;
  text-decoration: none;
  margin-right: 18px;
  font-size: 14px;
  opacity: 0.9;
}
nav a:hover { text-decoration: underline; opacity: 1; }
nav a.export-link { font-weight: bold; }
main { padding: 20px 24px; max-width: 1200px; margin: 0 auto; }

table { border-collapse: collapse; width: 100%; margin-bottom: 20px; font-size: 14px; }
th, td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
th { background: var(--light); }
tr:nth-child(even) { background: #f5f5f5; }
.money { text-align: right; font-variant-numeric: tabular-nums; }

.section-title { background: var(--light); font-weight: bold; }
.total-row td { font-weight: bold; border-top: 2px solid #333; }
.memo-row td { font-style: italic; color: #555; }

form.filters { margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
form.filters select, form.filters input[type=text] {
  padding: 6px; border: 1px solid var(--border); border-radius: 4px;
}
form.filters button { padding: 6px 14px; }

select.category-select { font-size: 13px; padding: 3px; }
.vat-treatment-select { min-width: 250px; }
.vat-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.vat-warning { border-left-color: var(--danger); }

.flash-container { max-width: 1200px; margin: 10px auto 0; padding: 0 24px; }
.flash { padding: 8px 14px; border-radius: 4px; margin-bottom: 8px; }
.flash-ok { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }

.caveat { background: #fff3cd; border-left: 4px solid #cc9900; padding: 10px 14px; margin: 10px 0 20px; font-size: 13px; }
.input-box { background: var(--input); padding: 10px 14px; margin-bottom: 16px; border-radius: 4px; }
.input-box label { margin-right: 16px; }

.chat-box { max-width: 700px; margin: 0 auto; }
.chat-msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; white-space: pre-wrap; }
.chat-msg.user { background: var(--light); margin-left: 60px; }
.chat-msg.assistant { background: #eee; margin-right: 60px; }
.chat-form { display: flex; gap: 8px; margin-top: 16px; }
.chat-form textarea { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; }
.chat-form button { padding: 0 20px; }

.dup-row { opacity: 0.6; }
.dup-tag { font-size: 11px; color: var(--danger); font-weight: bold; }
.cancel-btn { background: var(--danger); color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }

.schedule-summary { margin: 0 0 18px; color: #444; }
.schedule-card { background: white; border: 1px solid var(--border); border-radius: 6px; padding: 14px; margin-bottom: 18px; }
.schedule-card h3 { color: var(--navy); margin: 0 0 10px; }
.schedule-card table { margin-bottom: 0; }
.incomplete-row { background: #fff3cd !important; color: #6b5200; }
