:root {
  --bg: #f4fbf8;
  --surface: #ffffff;
  --text: #1f2a2f;
  --muted: #67797e;
  --line: #d7e7e0;
  --brand: #0d7a70;
  --brand-soft: #e2f5f1;
  --new-bg: #fff7dc;
  --new-line: #efca57;
  --ok-bg: #e7f6ec;
  --ok-line: #69b585;
  --warn-bg: #fff2df;
  --warn-line: #f0b56d;
  --bad-bg: #fde9ec;
  --bad-line: #e06b79;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body {
  background:
    radial-gradient(circle at 8% -6%, #ebfaf6 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, #eaf2ff 0%, transparent 34%),
    var(--bg);
}

.container {
  width: min(1240px, 95vw);
  margin: 24px auto 40px;
  display: grid;
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(13, 122, 112, 0.05);
}

.hero {
  padding: 18px 20px;
  background: linear-gradient(136deg, #ffffff, #f0fcf8 57%, #edf4ff);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
}

.hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.stats {
  padding: 0 14px 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.82rem;
  color: #42565b;
  background: #fff;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 8px 11px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

button.primary,
.button-link.primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

button.soft,
.button-link.soft {
  background: var(--brand-soft);
  color: #11514b;
  border-color: #bce4db;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fcfefd;
  color: var(--text);
  padding: 8px 10px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.small {
  color: var(--muted);
  font-size: 0.83rem;
}

.table-wrap {
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1140px;
}

th,
td {
  border-bottom: 1px solid #ecf2ef;
  padding: 9px 10px;
  text-align: left;
  font-size: 0.9rem;
}

th {
  position: sticky;
  top: 0;
  background: #f7fcfa;
  z-index: 1;
  color: #334f56;
  font-weight: 600;
  font-size: 0.82rem;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover {
  background: #fbfefc;
}

tr.is-new {
  background: #fffdf2;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid;
  padding: 2px 8px;
  white-space: nowrap;
}

.badge-new { background: var(--new-bg); border-color: var(--new-line); color: #7b5e00; }
.badge-done { background: var(--ok-bg); border-color: var(--ok-line); color: #236446; }
.badge-plan { background: #e9f2ff; border-color: #8cabda; color: #24456e; }
.badge-cancel { background: #f2f2f2; border-color: #d4d4d4; color: #5e5e5e; }
.badge-tocancel { background: var(--warn-bg); border-color: var(--warn-line); color: #845016; }

.proposal {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.proposal .meta {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid;
  font-size: 0.74rem;
  padding: 2px 8px;
}

.meta-ok { background: var(--ok-bg); border-color: var(--ok-line); color: #236446; }
.meta-warn { background: var(--warn-bg); border-color: var(--warn-line); color: #845016; }
.meta-bad { background: var(--bad-bg); border-color: var(--bad-line); color: #8a2230; }

.empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 24px;
}

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(23, 33, 40, 0.34);
  backdrop-filter: blur(2px);
  z-index: 9999;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  position: relative;
  z-index: 10000;
}

body.modal-open {
  overflow: hidden;
}

.grid-2 {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-1 {
  display: grid;
  gap: 10px;
}

label {
  font-size: 0.82rem;
  color: #3e585f;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.modal-title {
  margin: 0;
  font-size: 1.04rem;
}

.success {
  color: #1d6f45;
}

.warning {
  color: #955b14;
}

.error {
  color: #9d1a39;
}

@media (max-width: 900px) {
  .container {
    margin-top: 14px;
    width: min(1240px, 96vw);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}
