:root {
  --bw-bg: #eaf6ee;
  --bw-panel: #f5fbf6;
  --bw-line: #d4e8d9;
  --bw-text: #173524;
  --bw-muted: #647d6c;
  --bw-sidebar-top: #123524;
  --bw-sidebar-bottom: #1d4d37;
  --bw-green: #2f8543;
  --bw-green-soft: #59c676;
  --bw-link: #145b36;
  --bw-danger: #a12424;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font: 15px "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg,#edf8f0,#e4f3e8);
  color: var(--bw-text);
}

a { color: var(--bw-link); }

.bw-app {
  display: flex;
  min-height: 100vh;
}

.bw-sidebar {
  width: 190px;
  flex: 0 0 190px;
  background: linear-gradient(180deg, var(--bw-sidebar-top), var(--bw-sidebar-bottom));
  color: #fff;
  padding: 20px 16px;
  box-shadow: 4px 0 20px rgba(0,0,0,.08);
}

.bw-sidebar-brand {
  padding: 10px 6px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 20px;
}

.bw-sidebar-brand img {
  width: 150%;
  max-width: 185px;
  height: auto;
  display: block;
  margin: 0 auto 5px;
  transform: translateX(-15px);
}

.bw-sidebar-brand small {
  display: block;
  color: #b8d8c2;
  font-size: 12px;
  letter-spacing: .5px;
  line-height: 1.35;
}

.bw-menu-heading {
  font-size: 11px;
  color: #9fcaaa;
  letter-spacing: 1.5px;
  margin: 8px 14px 12px;
}

.bw-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bw-side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 13px;
  text-decoration: none;
  color: #d9efe0;
  font-weight: 600;
  font-size: 14px;
  transition: .2s;
}

.bw-side-link:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
}

.bw-side-link.active {
  background: linear-gradient(90deg,#3fa45b,#59c676);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
}

.bw-menu-icon {
  width: 23px;
  text-align: center;
  font-size: 19px;
}

.bw-sidebar-footer {
  margin-top: 28px;
  padding: 14px;
  font-size: 12px;
  color: #9fcaaa;
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,.12);
}

.logout-form { margin-top: 14px; }

.bw-main {
  flex: 1;
  min-width: 0;
  padding: 24px;
}

.bw-page-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.bw-page-top h1 {
  margin: 0;
  color: #163b26;
  font-size: 28px;
  font-weight: 750;
}

.bw-page-top p {
  margin: 6px 0 0;
  color: var(--bw-muted);
}

.panel {
  background: linear-gradient(180deg,#f5fbf6,#edf8f0);
  border: 1px solid var(--bw-line);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 5px 18px rgba(22,75,38,.05);
}

.panel h2, .panel h3 {
  margin-top: 0;
  color: #1a462c;
}

.login {
  max-width: 470px;
  margin: 8vh auto;
}

label {
  display: block;
  margin: 12px 0 5px;
  font-weight: 600;
}

input {
  border: 1px solid #b9d4c1;
  background: #fafffb;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  width: 100%;
  color: #223d2b;
}

input:focus {
  outline: 2px solid #9bd8ab;
  outline-offset: 1px;
}

button, .button {
  display: inline-block;
  margin: 10px 8px 0 0;
  background: linear-gradient(90deg,#2f8543,#4cb765);
  color: white;
  text-decoration: none;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover, .button:hover { filter: brightness(.97); }

.ghost {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.06);
  width: 100%;
  text-align: center;
}

.alert {
  color: var(--bw-danger);
  margin-top: 0;
}

.stats {
  font-size: 30px;
  font-weight: 800;
}

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e3ebe5;
}

th {
  background: #e9f4ec;
  color: #173524;
}

tbody tr:hover { background: rgba(217, 239, 224, .45); }

th:last-child, td:last-child { text-align: right; }

.filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.filters > div {
  flex: 1;
  min-width: 170px;
}

.muted {
  color: var(--bw-muted);
}

@media (max-width: 900px) {
  .bw-app { display: block; }
  .bw-sidebar {
    width: 100%;
    min-height: auto;
    padding: 12px;
  }
  .bw-sidebar-brand {
    padding: 6px;
    margin-bottom: 10px;
  }
  .bw-sidebar-brand img { max-width: 170px; }
  .bw-sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
  }
  .bw-side-link {
    white-space: nowrap;
    padding: 11px;
  }
  .bw-menu-heading, .bw-sidebar-footer { display: none; }
  .bw-main { padding: 15px; }
  .login { margin: 4vh auto; }
}
