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

:root {
  font-family: "Public Sans", Inter, system-ui, -apple-system, sans-serif;
  color: #20252d;
  background: #f8fafc;
  line-height: 1.45;
  --primary: #00c16a;
  --primary-dark: #009a55;
  --primary-soft: #dcf8eb;
  --text: #20252d;
  --muted: #697586;
  --border: #e3e8ef;
  --surface: #ffffff;
  --sidebar: #fbfcfd;
  --danger: #d92d20;
  --warning: #b54708;
  --shadow: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f8fafc; }
a { color: var(--primary-dark); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: 256px;
  display: flex; flex-direction: column; border-right: 1px solid var(--border);
  background: rgba(251, 252, 253, .96);
}
.sidebar-brand {
  height: 65px; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 12px; background: var(--primary); color: #fff; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 161, 85, .22);
}
.brand-name { display: block; font-weight: 700; line-height: 1.2; }
.brand-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.sidebar-nav { display: grid; gap: 4px; padding: 14px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 9px; color: var(--muted); font-size: 14px; transition: .15s ease;
}
.nav-item:hover { background: #f0f3f6; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; color: #71829d; }
.nav-item.active .nav-icon { color: var(--primary); }
.sidebar-user {
  margin: auto 12px 12px; padding: 12px; border: 1px solid var(--border);
  border-radius: 13px; background: var(--surface);
}
.user-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 50%; background: #edf1f5; color: #475467; font-size: 13px; font-weight: 700;
}
.user-meta { min-width: 0; }
.user-name { display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-role { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.logout-form { margin: 0; }
.logout-button {
  width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: #475467; font-weight: 600; cursor: pointer;
}
.logout-button:hover { background: #f2f4f7; }

.app-main { min-height: 100vh; margin-left: 256px; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: 65px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
}
.topbar-kicker { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.topbar-title { margin-top: 1px; font-weight: 650; }
.menu-toggle { display: none; }
.mobile-menu-button { display: none; }
.content { width: 100%; max-width: 1024px; margin: 0 auto; padding: 32px 32px 48px; }
.theme-button { width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: #475467; }
.theme-button:hover { background: #f2f4f7; color: #101828; }
.theme-button svg { width: 19px; height: 19px; }

h1 { margin: 0; color: var(--text); font-size: 25px; line-height: 1.25; font-weight: 650; }
h2 { margin: 0; color: var(--text); font-size: 17px; font-weight: 650; }
p { margin-top: 8px; }
.page-header { margin-bottom: 24px; }
.page-header p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.section-heading { margin: 30px 0 12px; }
.card {
  margin: 16px 0; padding: 24px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow);
}
.card-header { margin: -24px -24px 20px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 12% 8%, rgba(0,161,85,.12), transparent 34%), #f8fafc;
}
.auth { width: 100%; max-width: 450px; margin: 0; padding: 24px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 27px; }
.auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 15px; font-size: 17px; }
.auth-brand h1 { font-size: 21px; }
.auth-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.auth-footnote { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.stack { display: grid; gap: 16px; }
.row-form { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
label { display: grid; gap: 6px; color: #344054; font-size: 13px; font-weight: 600; }
input, select, textarea {
  min-width: 180px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 6px;
  outline: none; background: #fff; color: var(--text); transition: .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,161,85,.11); }
textarea { min-width: 420px; min-height: 82px; resize: vertical; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 7px 13px; border: 1px solid transparent; border-radius: 6px;
  background: var(--primary); color: #fff; font-weight: 650; cursor: pointer; transition: .15s ease;
}
button:hover, .button:hover { background: var(--primary-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
.secondary { border-color: var(--border); background: #fff; color: #344054; }
.secondary:hover { background: #f8fafc; color: var(--text); }
.link { padding: 0; border: 0; background: none; color: #475467; }
.danger { background: var(--danger); }
.danger-text { color: var(--danger); }
.notice, .error-box {
  margin: 14px 0; padding: 13px 15px; border: 1px solid #a6f4c5; border-radius: 9px;
  background: #ecfdf3; color: #027a48; font-size: 14px;
}
.error-box { border-color: #fecdca; background: #fef3f2; color: #b42318; }
.error-box strong { display: block; color: #912018; }
.error-box p { margin: 4px 0 0; }
.error { color: #b42318; }
.muted { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-bottom: 1px solid #edf0f3; text-align: left; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { background: #fbfcfd; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: 14px; }
td a { font-weight: 600; }
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.title-row p { color: var(--muted); font-size: 14px; }
.badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 650; }
.comment { padding: 15px 0; border-bottom: 1px solid var(--border); }
.inline-edit { display: flex; gap: 8px; margin: 9px 0; }
.inline-edit input { flex: 1; }
.top-gap { margin-top: 14px; }
.empty-state { padding: 44px 20px; color: var(--muted); text-align: center; }
.empty-icon { margin-bottom: 10px; color: var(--primary); font-size: 30px; }
.form-grow { flex: 1 1 220px; }
.form-grow input { width: 100%; }
.manager-form { display: grid; grid-template-columns: 1.1fr 1.1fr .65fr 1.1fr auto; gap: 14px; align-items: end; }
.check-field { align-content: end; justify-items: center; min-height: 53px; }
.check-field input { width: 16px; min-width: 16px; height: 16px; margin: 7px 0; }

[data-theme="dark"] { color-scheme: dark; --text: #f1f5f9; --muted: #94a3b8; --border: #273449; --surface: #111827; --sidebar: #0f172a; background: #0b1120; }
[data-theme="dark"] body, [data-theme="dark"] .app-main { background: #0b1120; color: #e5e7eb; }
[data-theme="dark"] .sidebar { background: #0f172a; }
[data-theme="dark"] .topbar { background: rgba(15,23,42,.9); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { border-color: #334155; background: #111827; color: #f1f5f9; }
[data-theme="dark"] .nav-item:hover, [data-theme="dark"] .logout-button:hover, [data-theme="dark"] .theme-button:hover { background: #1e293b; color: #f1f5f9; }
[data-theme="dark"] .sidebar-user, [data-theme="dark"] .secondary { background: #111827; }

@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .menu-toggle:checked ~ .sidebar { transform: translateX(0); }
  .menu-toggle:checked ~ .menu-overlay { display: block; }
  .menu-overlay { position: fixed; inset: 0; z-index: 20; display: none; background: rgba(16,24,40,.45); }
  .app-main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .mobile-menu-button { display: grid; width: 36px; height: 36px; margin-right: 10px; place-items: center; border-radius: 8px; cursor: pointer; }
  .content { padding: 24px 16px 40px; }
  .row-form > * { width: 100%; }
  input, select, textarea { width: 100%; min-width: 0; }
  .title-row { display: block; }
  .title-row .button { margin-top: 12px; }
  .manager-form { display: flex; }
}
