@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --green: #116622;
  --green-dark: #0d5119;
  --green-soft: #eef5f0;
  --ink: #16201a;
  --muted: #6d766f;
  --border: #e5e9e4;
  --bg: #f4f6f4;
  --sidebar-bg: #0f2d18;
  --sidebar-text: #cfe3d5;
  --sidebar-active: #163d20;
  --danger: #b3423a;
  --danger-soft: #fdecec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 30, 20, 0.06), 0 1px 12px rgba(15, 30, 20, 0.05);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 20px 10px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}
.sidebar-brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.client-switcher { margin-bottom: 18px; }
.client-switcher select {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
}
.client-switcher select option { color: #16201a; }

.nav-group { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-link .ic { font-size: 15px; width: 18px; text-align: center; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active { background: var(--sidebar-active); color: #fff; }
.nav-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.1); }

.main-col { flex: 1; min-width: 0; display: flex; justify-content: center; }
.content-wrap { width: 100%; max-width: 760px; padding: 36px 32px 60px 32px; }
main.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 36px;
}

/* ---------- Typography ---------- */
h1 { font-size: 21px; font-weight: 700; margin: 0 0 6px 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 28px 0 4px 0; }
p.sub { color: var(--muted); font-size: 14px; margin: 0 0 22px 0; line-height: 1.5; }

/* ---------- Forms ---------- */
label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--muted); margin: 18px 0 6px 0;
}
input[type=text], input[type=password], input[type=url], input[type=number], textarea, select {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 9px; font-size: 14px; font-family: inherit;
  background: #fff; color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(17, 102, 34, 0.12);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input[type=file] { font-size: 13px; padding: 8px 0; }

/* ---------- Buttons ---------- */
button, .btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  border: none; border-radius: 9px; font-size: 14px; font-weight: 600;
  padding: 10px 18px; font-family: inherit; transition: background 0.12s ease, transform 0.05s ease;
}
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--green); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--green-dark); }
button.secondary, .btn.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }
button.secondary:hover, .btn.secondary:hover { background: var(--green-soft); }
button.danger {
  background: none; border: 1px solid #e6c3bf; color: var(--danger);
  padding: 6px 12px; font-size: 13px;
}
button.danger:hover { background: var(--danger-soft); }

/* ---------- Feedback ---------- */
.message, .error, .notice {
  padding: 12px 16px; border-radius: 9px; font-size: 14px; margin-bottom: 20px; line-height: 1.5;
}
.message { background: var(--green-soft); border: 1px solid #d3e8da; color: var(--green); }
.error { background: var(--danger-soft); border: 1px solid #e6c3bf; color: var(--danger); }
.notice { background: #fef8e8; border: 1px solid #f0dfa8; color: #8a6d1f; }

.original {
  background: #fafbfa; border: 1px solid var(--border); border-radius: 9px;
  padding: 14px 16px; font-size: 13px; color: #3b453e; margin-bottom: 20px;
  white-space: pre-wrap; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  line-height: 1.6;
}
.original div { padding: 1px 0; }

/* ---------- Tables / lists ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
td { padding: 11px 4px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.muted { color: var(--muted); font-size: 13px; }
hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.actions { display: flex; gap: 10px; margin-top: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 12px; }
.logo-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  text-align: center; background: #fafbfa;
}
.logo-card img { max-width: 100%; max-height: 56px; display: block; margin: 0 auto 8px auto; }
code.key {
  background: #f0f2f0; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; font-size: 12.5px; font-family: Consolas, Menlo, monospace;
}

/* ---------- Stat pills (dashboard) ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-soft); color: var(--green);
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
}
