:root {
  --brand: #1b8a8c;
  --brand-600: #157577;
  --brand-700: #0f5f61;
  --brand-50: #e8f5f5;
  --brand-100: #cdeaea;
  --bg: #f2f6f7;
  --surface: #ffffff;
  --text: #1d2b36;
  --text-2: #4b5b68;
  --muted: #7a8894;
  --line: #e3e9ec;
  --line-2: #eef2f4;
  --ok: #1f9d55; --ok-bg: #e7f6ee;
  --warn: #d9822b; --warn-bg: #fff4e6;
  --danger: #e04848; --danger-bg: #fdecec;
  --info: #2f7fe0; --info-bg: #e9f2fd;
  --sun: #e04848; --sat: #2f7fe0;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 56, .06);
  --shadow: 0 2px 8px rgba(16, 42, 56, .06), 0 1px 2px rgba(16, 42, 56, .04);
  --font: "Noto Sans JP", "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
a { color: var(--brand); text-decoration: none; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.hidden { display: none !important; }
.sun { color: var(--sun); } .sat { color: var(--sat); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--line-2); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.outline { border-color: var(--brand); color: var(--brand); }
.btn.outline:hover { background: var(--brand-50); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.lg { height: 50px; font-size: 16px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--line-2); }

/* Forms */
.field { margin-bottom: 14px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8894' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfd8dd; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Tag / badge */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tag.important { background: var(--danger); color: #fff; }
.tag.info { background: var(--info); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.brand { background: var(--brand-50); color: var(--brand-700); }
.pill.info { background: var(--info-bg); color: var(--info); }
.count { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; border: 2px solid #fff; box-sizing: content-box; }
.dot-red { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; }

.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; height: 44px; font-weight: 600; color: var(--muted); cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { color: var(--brand); }
.tabs button.on::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.seg { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }

/* Modal / toast */
.modal-bg { position: fixed; inset: 0; background: rgba(16, 32, 40, .45); z-index: 200; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@media (min-width: 700px) { .modal-bg { align-items: center; } }
.modal { background: #fff; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.modal.wide { max-width: 760px; }
@media (min-width: 700px) { .modal { border-radius: 14px; } }
.modal-title { font-size: 17px; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: #1d2b36; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 300; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }

.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.empty .ic { width: 36px; height: 36px; color: #b8c4cb; display: block; margin: 0 auto 8px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
