:root {
  --bg: #eef8f3;
  --panel: #fff;
  --text: #193227;
  --accent: #1e8a5a;
  --accent-soft: #e1f3ea;
  --border: #c9e6d7;
  --success: #126e47;
  --error: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--text); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: linear-gradient(160deg, #0f5f3c 0%, #1e8a5a 55%, #3aad79 100%); color: #fff; padding: 20px; position: sticky; top: 0; height: 100vh; box-shadow: 0 16px 32px rgba(18, 110, 71, .18); }
.sidebar h1 { margin: 0 0 4px; }
.sidebar .subtitle { margin: 0 0 20px; color: #d6f6e8; }
.sidebar nav { display: grid; gap: 8px; margin-bottom: 18px; }
.sidebar a { color: #f2fff8; text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.sidebar a:hover { background: rgba(255, 255, 255, .14); }
.main-content { flex: 1; padding: 28px; }
.main-content.is-public { max-width: 520px; margin: 48px auto; }
.panel, .card, .auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(29, 126, 83, .08); }
.auth-card { padding: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card h3 { margin: 0; font-size: 1.8rem; color: var(--accent); }
.card p { margin: 6px 0 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.dashboard-head h2 { margin: 0; }
.dashboard-welcome { margin: 4px 0 0; font-weight: 700; color: var(--accent); text-align: right; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.grid-toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font: inherit; background: #fff; color: inherit; }
button, .btn { width: auto; border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; font: inherit; background: var(--accent); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; line-height: 1.1; }
.btn.secondary { background: #4e7f67; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.grid-form label { display: grid; gap: 6px; font-size: .93rem; }
.grid-form .full { grid-column: 1 / -1; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions a, .link { color: var(--accent); text-decoration: none; background: none; border: 1px solid var(--accent); padding: 4px 10px; border-radius: 6px; font-size: .88rem; white-space: nowrap; transition: background .15s, color .15s; }
.actions a:hover { background: var(--accent); color: #fff; }
.link.danger { color: var(--error); cursor: pointer; border-color: var(--error); }
.link.danger:hover { background: var(--error); color: #fff; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.alert-success { background: #dcf7e8; color: #175c3f; border: 1px solid #b5e8cd; }
.alert-error { background: #ffe6e3; color: #8d1f18; border: 1px solid #f8c5bf; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.badge { background: var(--accent-soft); color: #17583a; border-radius: 999px; padding: 3px 9px; font-size: .82rem; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.split-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.checkbox-line { display: flex !important; align-items: center; gap: 8px; }
.checkbox-line input { width: auto; }
.demo-box { margin-top: 14px; padding: 10px; background: #eef4ff; border-radius: 8px; }
.flow-svg { width: 100%; border: 1px dashed var(--border); border-radius: 10px; background: #f5fcf8; }
.flow-svg rect { fill: #e8f8ef; stroke: #1e8a5a; stroke-width: 1.2px; }
.flow-svg text { fill: #1b6543; font-family: Arial, sans-serif; font-size: 14px; text-anchor: middle; dominant-baseline: middle; }
.flow-svg .legend { text-anchor: start; dominant-baseline: auto; font-size: 14px; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 51, 34, .5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal-overlay.is-open { display: flex; }
.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 20px 40px rgba(17, 64, 42, .24);
}
.modal-card h3 { margin-top: 0; }
.quick-access { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-access-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--accent-soft); border: 1.5px solid var(--accent); border-radius: 10px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: .95rem; transition: background .15s, color .15s; }
.quick-access-btn:hover { background: var(--accent); color: #fff; }
.quick-access-emoji { font-size: 1.2rem; }
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pagination-link { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--accent); text-decoration: none; padding: 0 8px; font-weight: 600; }
.pagination-link:hover { background: var(--accent-soft); }
.pagination-link.is-current { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 980px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .dashboard-head { align-items: center; }
  .dashboard-welcome { text-align: left; }
}
