:root {
  --primary: #0f8a6f;
  --primary-dark: #0a6350;
  --primary-light: #e4f6f1;
  --accent: #6b5cff;
  --bg: #f4f6f5;
  --card: #ffffff;
  --border: #e7eae8;
  --text: #16241f;
  --muted: #75827c;
  --danger: #d0452c;
  --danger-light: #fbe9e5;
  --warn: #d99a1a;
  --ok: #0f8a6f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 34, 0.05), 0 1px 1px rgba(16, 40, 34, 0.03);
  --shadow-md: 0 4px 14px rgba(16, 40, 34, 0.07), 0 1px 3px rgba(16, 40, 34, 0.05);
  --shadow-lg: 0 12px 32px rgba(16, 40, 34, 0.1), 0 2px 6px rgba(16, 40, 34, 0.05);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #e9f8f2 0%, transparent 60%),
    radial-gradient(900px 400px at 100% 0%, #f1eeff 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { color: var(--primary-dark); }
.container { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }
.narrow { max-width: 460px; }

header.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}
header.topbar .brand {
  font-weight: 800;
  color: var(--primary-dark);
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}
header.topbar form { margin: 0; }
header.topbar > div:last-child { display: flex; align-items: center; gap: 18px; }
header.topbar a { color: var(--text); font-weight: 600; font-size: 0.92rem; opacity: 0.8; transition: opacity 0.15s; }
header.topbar a:hover { opacity: 1; color: var(--primary-dark); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

h1 {
  color: var(--text);
  margin-top: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.7rem;
}
h2 { color: var(--text); margin-top: 0; font-weight: 700; letter-spacing: -0.01em; font-size: 1.2rem; }
h3 { color: var(--text); margin-top: 0; font-weight: 700; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.86rem; color: var(--text); }
input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea { min-height: 90px; }

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
  box-shadow: 0 2px 8px rgba(15, 138, 111, 0.25);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
button:hover, .btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 138, 111, 0.3);
  color: #fff;
}
button:active, .btn:active { transform: translateY(0); }
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: none;
  color: var(--primary-dark);
}

.error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(208, 69, 44, 0.18);
}

.stats-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  flex: 1;
  min-width: 150px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat .value { font-size: 1.7rem; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
.stat .label { color: var(--muted); font-size: 0.82rem; margin-top: 5px; font-weight: 500; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fafbfa;
}
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #fafcfb; }
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.badge.Proposed { background: #8a8f8c; }
.badge.Accepted { background: #2f7dbb; }
.badge.In-Progress { background: #d99a1a; }
.badge.Completed { background: #0f8a6f; }
.badge.Stalled { background: #d0452c; }

.plan-doc {
  white-space: pre-wrap;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.65;
  background: #fcfcfb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  font-size: 0.98rem;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.top-links { margin-bottom: 18px; }
.top-links a { display: inline-flex; align-items: center; gap: 4px; font-size: 0.9rem; opacity: 0.85; }
.muted { color: var(--muted); font-weight: 400; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--card);
  border: 1.5px solid var(--border);
  transition: all 0.15s;
}
.tab:hover { border-color: var(--primary); color: var(--primary-dark); }
.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(15, 138, 111, 0.25);
}

.attention-card {
  border-left: none;
  position: relative;
  overflow: hidden;
}
.attention-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--warn), #f0b843);
}
.attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.attention-item:last-of-type { border-bottom: none; }
.attention-item-title { font-size: 1.02rem; font-weight: 600; }
.attention-item-title .badge { margin-left: 8px; vertical-align: middle; }
.suggested-action {
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.87rem;
  margin-top: 8px;
  background: var(--primary-light);
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
}
.attention-item-actions .btn { margin-top: 0; }
.potential-recovery {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px dashed var(--border);
  font-size: 1.08rem;
  color: var(--primary-dark);
}

@media (max-width: 600px) {
  .container { padding: 20px 14px 40px; }
  header.topbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  header.topbar > div:last-child { gap: 12px; flex-wrap: wrap; }
  h1 { font-size: 1.4rem; }
  .card { padding: 18px; }
  table { min-width: 560px; }
}

@media print {
  header.topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .plan-doc { border: none; padding: 0; }
}
