:root {
  --topbar-height: 72px;
  --footer-height: 58px;
  --sidebar-width: 310px;
  --surface: rgba(18, 34, 23, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.16);
  --text: #f7fbf8;
  --muted: #b8c8be;
  --green: #5fba63;
  --green-bright: #8edb6f;
  --dark: #101913;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  padding: 0 0 var(--footer-height);
  color: var(--text);
  background: #0d1710;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body.sidebar-open { overflow: hidden; }

.video-bg,
.page-background-shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
.video-bg { object-fit: cover; z-index: -3; }
.page-background-shade {
  z-index: -2;
  background:
    radial-gradient(circle at 15% 12%, rgba(89, 194, 97, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(8, 18, 11, 0.88), rgba(13, 29, 18, 0.73));
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  min-height: var(--topbar-height);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(14, 23, 17, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}
.topbar-brand:hover { color: #fff; }
.topbar-brand img { width: 48px; height: 48px; object-fit: contain; }
.topbar-brand span { display: flex; flex-direction: column; min-width: 0; }
.topbar-brand strong { font-size: 18px; line-height: 1.1; }
.topbar-brand small { color: var(--green-bright); font-size: 11px; white-space: nowrap; }

.menu-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}
.menu-toggle:hover { background: rgba(255,255,255,.12); }
.menu-toggle span { width: 21px; height: 2px; border-radius: 2px; background: #fff; }
.topbar-user { display: flex; flex-direction: column; text-align: right; min-width: 0; }
.topbar-user-name { font-weight: 700; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-role { color: var(--green-bright); font-size: 12px; }
.public-header-actions { display: flex; gap: 10px; }

.app-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1060;
  width: min(var(--sidebar-width), 88vw);
  display: flex;
  flex-direction: column;
  background: #101b13;
  border-right: 1px solid var(--border);
  box-shadow: 18px 0 55px rgba(0,0,0,.38);
  transform: translateX(-104%);
  transition: transform .25s ease;
}
.app-sidebar.open { transform: translateX(0); }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(3px);
}
.sidebar-header {
  min-height: 92px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-user-name { font-size: 17px; font-weight: 800; }
.sidebar-user-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.sidebar-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,.06);
  font-size: 27px;
  line-height: 1;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px; }
.sidebar-section-label {
  padding: 13px 12px 7px;
  color: #809488;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sidebar-link {
  min-height: 46px;
  margin: 4px 0;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #dbe6de;
  text-decoration: none;
  transition: .16s ease;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(78, 166, 85, .38), rgba(78, 166, 85, .13));
  border-color: rgba(126, 219, 112, .25);
}
.sidebar-icon { width: 23px; text-align: center; color: var(--green-bright); font-size: 18px; }
.sidebar-footer { padding: 12px 14px 18px; border-top: 1px solid var(--border); }
.sidebar-logout { color: #ffb4b4; }
.sidebar-logout .sidebar-icon { color: #ff9b9b; }

.app-main,
.public-main {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 22px 40px;
}
.flash-stack { position: relative; z-index: 5; margin-bottom: 14px; }

.card {
  color: #fff;
  background: rgba(76, 112, 57, 0.30);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
}
.table { width: 100%; color: #fff; }
.table thead { background: rgba(31, 53, 36, .93); }
.table tbody tr { background: rgba(71, 100, 55, .50); }
.table tbody tr:hover { background: rgba(73, 111, 60, .75); }
.form-control,
.form-select {
  color: #102014;
  background: rgba(239, 250, 240, .94);
  border: 1px solid rgba(255,255,255,.34);
}
.form-control:focus,
.form-select:focus { border-color: var(--green); box-shadow: 0 0 0 .2rem rgba(95,186,99,.18); }
select option { color: #102014; }
.modal-content { color: #17251b; background: rgba(245,248,245,.97); }
.table-warning { background-color: rgba(255,193,7,.18) !important; }

.page-nav-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,10,12,.68);
  backdrop-filter: blur(4px);
}
.page-nav-loader-box {
  display: inline-flex;
  align-items: center;
  padding: 13px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,.84);
}
.page-nav-loader.d-none { display: none !important; }

.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  min-height: var(--footer-height);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(7, 13, 9, .90);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  color: #cbd6ce;
  font-size: 12px;
}
.footer-left span { color: #d7bd68; font-weight: 700; }
.footer-right { display: flex; flex-wrap: wrap; gap: 7px; }
.footer-right a {
  padding: 4px 8px;
  color: #a8e8d9;
  border: 1px solid rgba(168,232,217,.25);
  border-radius: 5px;
  text-decoration: none;
}
.footer-right a:hover { color: #fff; background: rgba(168,232,217,.12); }

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--green-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}
.landing-hero {
  min-height: calc(100vh - var(--topbar-height) - var(--footer-height) - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  align-items: center;
  gap: clamp(30px, 6vw, 90px);
  padding: clamp(38px, 8vh, 92px) clamp(0px, 3vw, 40px);
}
.landing-copy h1 { max-width: 820px; margin: 0; font-size: clamp(42px, 6vw, 78px); line-height: .99; letter-spacing: -.045em; }
.landing-copy p { max-width: 700px; margin: 25px 0 0; color: #c6d4ca; font-size: clamp(17px, 2vw, 21px); line-height: 1.65; }
.landing-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.landing-preview {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(17, 32, 21, .72);
  box-shadow: 0 28px 80px rgba(0,0,0,.30);
  backdrop-filter: blur(16px);
}
.preview-topline { display: flex; justify-content: space-between; color: #dfe9e1; font-weight: 700; }
.status-dot { color: #9ae98b; font-size: 12px; }
.preview-grid { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-grid div { min-height: 125px; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid rgba(255,255,255,.11); border-radius: 16px; background: rgba(255,255,255,.055); }
.preview-grid strong { font-size: 17px; }
.preview-grid small { margin-top: 7px; color: var(--muted); line-height: 1.45; }
.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 25px 0 90px; }
.landing-features article { padding: 27px; border: 1px solid var(--border); border-radius: 18px; background: rgba(17, 31, 20, .68); }
.landing-features article > span { color: var(--green-bright); font-weight: 800; }
.landing-features h2 { margin: 25px 0 10px; font-size: 22px; }
.landing-features p { margin: 0; color: var(--muted); line-height: 1.6; }

.auth-shell {
  min-height: calc(100vh - var(--topbar-height) - var(--footer-height) - 48px);
  display: grid;
  grid-template-columns: 1fr minmax(340px, 500px);
  align-items: center;
  gap: clamp(30px, 8vw, 120px);
  max-width: 1200px;
  margin: 0 auto;
}
.auth-intro h1 { margin: 0; font-size: clamp(48px, 6vw, 76px); letter-spacing: -.04em; }
.auth-intro p { max-width: 600px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.auth-card { padding: clamp(24px, 4vw, 40px); border: 1px solid var(--border); border-radius: 22px; background: rgba(14, 29, 18, .86); backdrop-filter: blur(16px); box-shadow: 0 30px 80px rgba(0,0,0,.30); }
.auth-card-header { margin-bottom: 30px; display: flex; align-items: center; gap: 15px; }
.auth-card-header img { width: 62px; height: 62px; object-fit: contain; }
.auth-card-header h2 { margin: 0; }
.auth-card-header p { margin: 4px 0 0; color: var(--muted); }
.auth-card .form-label { color: #dce7de; font-weight: 600; }

.home-welcome {
  margin-bottom: 22px;
  padding: clamp(25px, 5vw, 48px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(17, 46, 25, .89), rgba(28, 61, 34, .57));
  backdrop-filter: blur(15px);
}
.home-welcome h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.035em; }
.home-welcome p { max-width: 780px; margin: 14px 0 0; color: #c6d4ca; font-size: 17px; }
.home-stat-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; }
.home-stat-card { min-height: 155px; padding: 20px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; background: rgba(21, 40, 25, .75); }
.home-stat-card span { color: #b7c8bb; font-size: 13px; }
.home-stat-card strong { margin: auto 0 7px; font-size: 40px; line-height: 1; }
.home-stat-card small { color: #93a699; line-height: 1.35; }
.home-section { margin-top: 36px; padding-bottom: 25px; }
.section-heading { margin-bottom: 17px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 0; font-size: 30px; }
.section-heading p { margin: 0; color: var(--muted); }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 13px; }
.module-card { min-height: 135px; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.065); text-decoration: none; transition: .18s ease; }
.module-card:hover { color: #fff; border-color: rgba(142,219,111,.55); background: rgba(92, 168, 80, .18); transform: translateY(-3px); }
.module-card strong { font-size: 18px; }
.module-card span { margin-top: 8px; color: var(--muted); line-height: 1.45; }
.admin-module { background: rgba(85, 133, 174, .12); }

@media (max-width: 1100px) {
  .home-stat-grid { grid-template-columns: repeat(3, 1fr); }
  .module-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  :root { --footer-height: 78px; }
  .landing-hero, .auth-shell { grid-template-columns: 1fr; }
  .landing-hero { padding-top: 50px; }
  .auth-intro { display: none; }
  .auth-card { max-width: 540px; width: 100%; margin: 0 auto; }
  .landing-features { grid-template-columns: 1fr; }
  .home-welcome { align-items: flex-start; flex-direction: column; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .app-footer { align-items: flex-start; }
}
@media (max-width: 640px) {
  :root { --topbar-height: 66px; --footer-height: 92px; }
  .app-topbar { padding: 8px 12px; }
  .topbar-brand img { width: 40px; height: 40px; }
  .topbar-brand strong { font-size: 15px; }
  .topbar-brand small { font-size: 9px; }
  .topbar-user { display: none; }
  .public-header-actions .btn { padding: 6px 10px; font-size: 13px; }
  .app-main, .public-main { padding: 17px 12px 30px; }
  .landing-copy h1 { font-size: 42px; }
  .preview-grid { grid-template-columns: 1fr; }
  .home-stat-grid, .module-grid { grid-template-columns: 1fr 1fr; }
  .home-stat-card { min-height: 135px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .app-footer { padding: 8px 12px; font-size: 10px; }
}
@media (max-width: 430px) {
  .home-stat-grid, .module-grid { grid-template-columns: 1fr; }
  .landing-actions .btn { width: 100%; }
}
.app-version{display:inline-flex;align-items:center;padding:4px 8px;color:#9fb0a4;border:1px solid rgba(255,255,255,.12);border-radius:5px}
