/* Theme and layout CSS for the application */
:root {
  --forest: #f9c74f; /* primary yellow */
  --forest-deep: #c5a135; /* darker yellow */
  --forest-soft: #f9d977; /* lighter yellow */
  --green: #176b45;
  --green-hover: #105437;
  --cream: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --ink: #16271f;
  --muted: #5f7067;
  --line: #dce5df;
  --accent: #b96f24;
  --accent-strong: #9a571a;
  --accent-bright: #edbd72;
  --accent-soft: #fff4e3;
  --danger: #a73737;
  --danger-soft: #fff0ee;
  --info: #245f83;
  --info-soft: #eaf4fb;
  --shadow-sm: 0 5px 18px rgba(18, 61, 43, 0.05);
  --shadow-md: 0 16px 42px rgba(18, 61, 43, 0.09);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-width: 260px;
  --mobile-nav-height: 76px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  color-scheme: light;
}

/* Global resets */
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(circle at 92% 4%, rgba(237, 189, 114, 0.09), transparent 24rem), var(--cream); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.app-body, body.admin-body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); text-underline-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-hover); }
img, svg { max-width: 100%; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 5vw, 2.1rem); letter-spacing: -0.045em; }
h2 { font-size: 1.08rem; letter-spacing: -0.02em; }
h3 { font-size: 0.98rem; }
p { color: var(--muted); }
code { padding: 0.15rem 0.38rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--forest); font-size: 0.86em; overflow-wrap: anywhere; }
hr { height: 1px; margin: 24px 0; border: 0; background: var(--line); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 3px; }
.sidebar :focus-visible, .mobile-nav :focus-visible, .hero-proof :focus-visible, .auth-intro :focus-visible { outline-color: var(--accent-bright) !important; }
.mobile-nav :focus-visible { outline-offset: -3px; }
.skip-link { position: fixed; top: calc(10px + var(--safe-top)); left: max(12px, var(--safe-left)); z-index: 100; padding: 11px 16px; border-radius: 9px; background: var(--surface); color: var(--forest); font-weight: 750; box-shadow: var(--shadow-md); transform: translateY(-160%); transition: transform 160ms ease; }
.skip-link:focus { transform: translateY(0); }

/* Responsive layout: show sidebar on desktop, hide mobile nav */
@media (min-width: 900px) {
  .sidebar { display: flex !important; }
  .mobile-nav { display: none !important; }
}
/* Ensure sidebar hidden on small screens */
@media (max-width: 899px) {
  .sidebar { display: none !important; }
  .mobile-nav { display: grid !important; }
}

/* Sidebar styling */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: none;
  width: var(--sidebar-width);
  min-height: 100vh;
  padding: calc(22px + var(--safe-top)) 16px calc(18px + var(--safe-bottom)) max(16px, var(--safe-left));
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 20% 0%, rgba(237, 189, 114, 0.11), transparent 18rem), linear-gradient(165deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: #d7e7dd;
  box-shadow: 10px 0 34px rgba(11, 43, 30, 0.08);
}
.brand { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 0 8px 26px; color: #ffffff; text-decoration: none; }
.brand:hover { color: #ffffff; }
.brand-mark { display: inline-grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 13px; background: linear-gradient(145deg, #2b7652, #174b34); color: #ffffff; font-size: 0.82rem; font-weight: 850; letter-spacing: -0.03em; box-shadow: 0 9px 22px rgba(0, 0, 0, 0.18); }
.brand b, .brand small { display: block; }
.brand b { color: #ffffff; font-size: 0.83rem; font-weight: 850; letter-spacing: 0.07em; }
.brand small { margin-top: 3px; color: #b7cec0; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.13em; }
.side-label { padding: 10px 11px 7px; color: #a8c0b2; font-size: 0.61rem; font-weight: 800; letter-spacing: 0.14em; }
.side-nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 4px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #42634f transparent; }
.nav-item { display: flex; min-height: 43px; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid transparent; border-radius: 11px; color: #c9dccf; font-size: 0.8rem; font-weight: 650; text-decoration: none; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; transform: translateX(2px); }
.nav-item.active, .nav-item[aria-current="page"] { border-color: rgba(255, 255, 255, 0.08); background: var(--forest-soft); color: #ffffff; box-shadow: inset 3px 0 var(--accent-bright); }
.nav-text { min-width: 0; }
.nav-count { min-width: 21px; margin-left: auto; padding: 1px 6px; border-radius: 999px; background: var(--accent-bright); color: var(--forest-deep); font-size: 0.64rem; font-weight: 850; text-align: center; }
.side-account, .admin-mini { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 15px 8px 10px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.side-account > div:last-child, .admin-mini > div:last-child { min-width: 0; }
.side-account b, .side-account small, .admin-mini b, .admin-mini small { display: block; }
.side-account b, .admin-mini b { overflow: hidden; color: #ffffff; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.side-account small, .admin-mini small { margin-top: 2px; color: #b7cec0; font-size: 0.65rem; text-transform: capitalize; }
.avatar { display: inline-grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid #c9dfd0; border-radius: 50%; background: #e4f2e9; color: var(--forest); font-size: 0.8rem; font-weight: 850; }
.avatar.small { width: 31px; height: 31px; flex-basis: 31px; font-size: 0.7rem; }
.avatar.large { width: 50px; height: 50px; flex-basis: 50px; font-size: 1rem; }
.avatar.xlarge { width: 82px; height: 82px; flex-basis: 82px; font-size: 1.65rem; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.logout-btn { display: flex; width: 100%; min-height: 40px; align-items: center; gap: 9px; padding: 9px 11px; border: 0; border-radius: 9px; background: transparent; color: #d7e7dd; font-size: 0.75rem; font-weight: 650; text-align: left; cursor: pointer; }
.logout-btn:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.sidebar-foot { padding: 12px 10px 0; color: #a8c0b2; font-size: 0.61rem; }
.admin-main { min-height: 100vh; margin-left: 0; padding-bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 18px); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; min-height: calc(59px + var(--safe-top)); align-items: center; justify-content: space-between; gap: 14px; padding: var(--safe-top) max(15px, var(--safe-right)) 0 max(15px, var(--safe-left)); border-bottom: 1px solid rgba(220, 229, 223, 0.9); background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 18px rgba(18, 61, 43, 0.025); backdrop-filter: blur(16px); }
.topbar-title { display: flex; min-width: 0; align-items: center; gap: 9px; color: var(--forest); font-size: 0.82rem; font-weight: 780; text-decoration: none; }
.topbar-title:hover { color: var(--forest); }
.topbar-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title .icon { color: var(--green); }
.topbar-actions, .topbar-user { display: flex; align-items: center; }
.topbar-actions { gap: 13px; }
.topbar-user { min-width: 0; gap: 8px; color: var(--ink); font-size: 0.75rem; font-weight: 700; }
.topbar-user > span:last-child { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user i { width: 8px; height: 8px; border-radius: 50%; background: #2a8a59; box-shadow: 0 0 0 4px #e1f1e7; }
.icon-button { display: inline-grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--forest); text-decoration: none; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.icon-button:hover { border-color: #b9cfc0; background: var(--surface-soft); color: var(--forest); transform: translateY(-1px); }
.notification-button { position: relative; }
.notification-button > span { position: absolute; top: -5px; right: -5px; display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 4px; border: 2px solid var(--surface); border-radius: 999px; background: var(--accent); color: #ffffff; font-size: 0.58rem; font-weight: 850; }
.mobile-nav { position: fixed; inset: auto 0 0; z-index: 45; display: grid; min-height: calc(var(--mobile-nav-height) + var(--safe-bottom)); grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 7px max(7px, var(--safe-right)) calc(7px + var(--safe-bottom)) max(7px, var(--safe-left)); border-top: 1px solid rgba(255, 255, 255, 0.1); border-radius: 19px 19px 0 0; background: rgba(11, 43, 30, 0.98); box-shadow: 0 -10px 32px rgba(11, 43, 30, 0.16); backdrop-filter: blur(16px); }
.mobile-nav-item { display: flex; min-width: 0; min-height: 59px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 5px 3px; border-radius: 12px; color: #c9dccf; font-size: 0.61rem; font-weight: 650; line-height: 1.2; text-align: center; text-decoration: none; }
.mobile-nav-item .icon { width: 21px; height: 21px; }
.mobile-nav-item span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-nav-item:hover, .mobile-nav-item.active, .mobile-nav-item[aria-current="page"] { background: var(--forest-soft); color: #ffffff; }
.mobile-nav-item.active .icon, .mobile-nav-item[aria-current="page"] .icon { color: var(--accent-bright); }
.role-admin .mobile-nav { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; scroll-padding-inline: max(7px, var(--safe-left)) max(7px, var(--safe-right)); scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #6f927d transparent; }
.role-admin .mobile-nav-item { flex: 0 0 86px; scroll-snap-align: start; }
.main-inner { width: 100%; max-width: 1480px; margin: 0 auto; padding: 20px max(14px, var(--safe-right)) 28px max(14px, var(--safe-left)); scroll-margin-top: 80px; }
/* Additional component styles omitted for brevity */
