/* CMAMS dashboard theme: sidebar layout, loaded after style.css */
:root {
  --g900: #14401f;
  --g800: #1d5a2e;
  --g700: #256b38;
  --g100: #e4efe0;
  --g50: #f2f7ef;
  --card-r: 14px
}

body {
  background: var(--g50);
  font-family: "Segoe UI", system-ui, sans-serif
}

.ico {
  width: 20px;
  height: 20px;
  flex: none
}

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

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column
}

.page-wrapper {
  max-width: 1180px;
  margin: 20px auto;
  padding: 0 24px;
  width: 100%
}

/* Sidebar */
.sidebar {
  width: 262px;
  flex: none;
  background: linear-gradient(180deg, var(--g800), var(--g900));
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto
}

.sb-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #fff;
  text-decoration: none;
  padding: 4px 6px 18px
}

.sb-brand strong {
  display: block;
  font-size: 1.05rem
}

.sb-brand small {
  display: block;
  font-size: .72rem;
  line-height: 1.3;
  opacity: .8
}

.sb-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex: none
}

.sb-logo-fb {
  display: grid;
  place-items: center;
  color: var(--g800);
  font-weight: 700
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.sb-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, .2);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #e6f2e6;
  font-weight: 500;
  border: 0;
  background: none;
  text-decoration: none
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff
}

.sidebar .nav-link.active {
  background: #4f8f5f;
  color: #fff;
  font-weight: 600
}

.sidebar .nav-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  margin: 14px 24px 0;
  padding: 10px 18px;
  border-radius: var(--card-r);
  box-shadow: var(--shadow-card)
}

.menu-btn {
  display: none;
  background: none;
  border: 0;
  color: var(--g800);
  cursor: pointer;
  padding: 4px
}

.topbar:has(.menu-btn) {
  gap: 12px
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto
}

.topbar-user small {
  display: block;
  font-size: .75rem;
  color: var(--text-muted)
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--g800);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700
}

/* Welcome banner */
.welcome-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 26px 28px;
  margin-bottom: 22px;
  border-radius: var(--card-r);
  background: linear-gradient(100deg, #d9e9d3, #eef5ea 70%);
  border: 1px solid #cfe2c8
}

.welcome-banner h1 {
  font-size: 2rem;
  color: var(--g900);
  margin: 0 0 4px
}

.welcome-banner p {
  margin: 0;
  color: var(--text-secondary)
}

/* Cards */
.card,
.metric-card,
.chart-box {
  border-radius: var(--card-r);
  border: 1px solid #e1ebdc;
  box-shadow: var(--shadow-card)
}

.card-header {
  border-radius: var(--card-r) var(--card-r) 0 0
}

.metrics-grid {
  gap: 16px
}

.metric-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 14px;
  align-items: center;
  background: #fff;
  border-left-width: 1px
}

.metric-card .metric-ico {
  grid-row: 1/4;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--g800);
  color: #fff;
  display: grid;
  place-items: center
}

.metric-card .metric-ico .ico {
  width: 26px;
  height: 26px
}

.metric-card .metric-value {
  order: -1;
  color: var(--g900)
}

.metric-card .metric-label {
  order: 0
}

.metric-card.accent-gold,
.metric-card.accent-forest {
  border-left-color: #e1ebdc
}

.btn {
  border-radius: 10px
}

.btn-primary {
  background: var(--g800);
  border-color: var(--g800)
}

.btn-primary:hover {
  background: var(--g900);
  border-color: var(--g900)
}

.institutional-footer {
  padding: 16px 24px;
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  background: none;
  border: 0
}

/* ===== LOGIN: ERA-style Sign In modal (448px) ===== */
.auth-main {
  min-height: 100vh;
}

.sg-bg {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #0f3d1c;
  overflow: hidden;
}

.sg-bg::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: url("../img/campus.jpg") center / cover no-repeat;
  filter: blur(8px);
}

.sg-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 40, 18, .78);
}

.sg-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 448px;
}

.sg-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  border-top: 8px solid #0b6a1a;
  padding: 32px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .45);
}

.sg-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 30px;
  line-height: 1;
  color: #6b7785;
  text-decoration: none;
}

.sg-close:hover {
  color: #111;
}

.sg-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #e9f8ee;
  display: grid;
  place-items: center;
}

.sg-logo img {
  width: 72%;
  height: 72%;
  border-radius: 50%;
  object-fit: cover;
}

.sg-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  color: #111;
  margin: 0 0 6px;
}

.sg-sub {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 22px;
}

.sg-card form {
  text-align: left;
}

.sg-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #3f4b5a;
  margin: 0 0 6px;
}

.sg-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px;
  margin-bottom: 16px;
  background: #f8f9fb;
  border: 1px solid #dcdfe6;
  border-radius: 10px;
}

.sg-field:focus-within {
  border-color: #0b6a1a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 106, 26, .15);
}

.sg-field svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.sg-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  padding: 0 !important;
  min-height: 0 !important;
  font-size: 15px;
  border-radius: 0;
}

.sg-field input::placeholder {
  color: #9aa5b1;
}

.sg-eye {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px;
  display: grid;
  color: #8a96a3;
}

.sg-eye svg {
  color: inherit;
}

.sg-eye:hover {
  color: #0b6a1a;
}

.sg-captcha {
  background: #f8f9fb;
  border: 1px solid #dcdfe6;
  border-radius: 10px;
  padding: 14px 12px;
  margin-bottom: 20px;
}

.sg-cap-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sg-cap-row img {
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  flex: none;
  background: #fff;
}

.sg-cap-row input {
  flex: 1;
  min-width: 0;
  height: 54px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid #dcdfe6;
  border-radius: 10px;
  background: #fff;
  padding: 0 8px;
}

.sg-cap-row input::placeholder {
  letter-spacing: .05em;
  font-weight: 400;
  color: #a9b3be;
}

.sg-refresh {
  background: none;
  border: 0;
  cursor: pointer;
  color: #64748b;
  padding: 6px;
  display: grid;
}

.sg-refresh svg {
  width: 20px;
  height: 20px;
}

.sg-refresh:hover {
  color: #0b6a1a;
}

.sg-btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: #0b6a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(11, 106, 26, .3);
}

.sg-btn:hover {
  background: #085414;
}

.sg-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.sg-below {
  text-align: center;
  color: #e6f2e6;
  font-size: 14px;
  margin-top: 14px;
}

.sg-below a {
  color: #fff;
  font-weight: 700;
}

.sg-test {
  margin: 10px auto 0;
  max-width: 360px;
  font-size: 12px;
  text-align: left;
  color: #e6f2e6;
}

.sg-test summary {
  cursor: pointer;
  text-align: center;
}

.sg-test ul {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.6;
}

.sg-test code {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
}

/* Responsive / print */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 50;
    left: 0;
    transform: translateX(-100%);
    transition: transform .2s;
  }

  .sb-open .sidebar {
    transform: none;
  }

  .menu-btn {
    display: block;
  }
}

@media (max-width: 480px) {
  .sg-card {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

@media print {

  .sidebar,
  .topbar {
    display: none;
  }

  .app-shell {
    display: block;
  }
}

/* ===== CMAMS left sidebar layout, matcha theme (overrides above) ===== */
:root {
  --g900: #3a5a22;
  --g800: #4c722e;
  --g700: #5e8c3a;
  --g100: #e4edd3;
  --g50: #f3f7ec
}

body {
  background: var(--g50)
}

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

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column
}

.page-wrapper {
  max-width: 1240px;
  margin: 24px auto;
  padding: 0 32px;
  width: 100%
}

/* Sidebar */
.sidebar {
  width: 250px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #fff;
  color: var(--text-primary);
  border-right: 1px solid #d6e3c0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--g900);
  padding: 0 8px 20px
}

.sb-brand strong {
  font-size: 1.15rem;
  letter-spacing: .02em;
  color: var(--g900)
}

.sb-brand small {
  display: block;
  font-size: .74rem;
  opacity: 1;
  color: var(--text-muted)
}

.sb-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: none
}

.sb-logo-fb {
  display: grid;
  place-items: center;
  background: var(--g800);
  color: #fff;
  font-weight: 700
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 3px
}

.sidebar .nav-link {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  color: #46564a;
  text-decoration: none;
  background: none
}

.sidebar .nav-link:hover {
  background: var(--g50);
  color: var(--g900)
}

.sidebar .nav-link.active {
  background: var(--g100);
  color: var(--g900);
  font-weight: 700
}

.sidebar .nav-link:focus-visible,
.sb-profile:focus-visible,
.sb-logout:focus-visible {
  outline: 2px solid var(--g700);
  outline-offset: 2px
}

/* Profile and logout at the bottom */
.sb-foot {
  margin-top: auto;
  border-top: 1px solid #e3ecd3;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.sb-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary)
}

.sb-profile:hover {
  background: var(--g50)
}

.sb-profile .avatar {
  width: 38px;
  height: 38px;
  background: var(--g800);
  flex: none
}

.sb-pname {
  line-height: 1.25;
  font-size: .85rem;
  min-width: 0
}

.sb-pname strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.sb-pname small {
  display: block;
  font-size: .74rem;
  color: var(--text-muted)
}

.sb-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #c9d9b0;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--g800);
  text-decoration: none;
  background: #fff
}

.sb-logout:hover {
  background: var(--g100)
}

.sb-logout .ico {
  width: 18px;
  height: 18px
}

/* Mobile */
.menu-btn {
  display: none
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 60;
    left: 0;
    transform: translateX(-100%);
    transition: transform .2s;
    box-shadow: 4px 0 16px rgba(0, 0, 0, .15)
  }

  .sb-open .sidebar {
    transform: none
  }

  .menu-btn {
    display: grid;
    place-items: center;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 55;
    width: 42px;
    height: 42px;
    border: 1px solid #d6e3c0;
    border-radius: 10px;
    background: #fff;
    color: var(--g800);
    cursor: pointer
  }

  .page-wrapper {
    padding: 0 16px;
    margin-top: 64px
  }
}

/* Dashboard header and metrics, compact style */
.welcome-banner {
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 20px
}

.welcome-banner h1 {
  font-size: 1.6rem
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #fff;
  border: 1px solid #d6e3c0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px
}

.metrics-grid .metric-card {
  display: block;
  border: 0;
  border-right: 1px solid #e3ecd3;
  border-radius: 0;
  box-shadow: none;
  padding: 20px 24px
}

.metrics-grid .metric-card:last-child {
  border-right: 0
}

.metric-card .metric-ico {
  display: none
}

.metric-card .metric-value {
  color: var(--g800);
  font-size: 2rem;
  font-weight: 600
}

.metric-card .metric-label {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem
}

.card,
.chart-box {
  border-radius: 10px;
  border-color: #d6e3c0
}

.card-header {
  border-radius: 10px 10px 0 0
}

.btn {
  border-radius: 6px
}

.btn-primary {
  background: var(--g800);
  border-color: var(--g800)
}

.btn-primary:hover {
  background: var(--g900);
  border-color: var(--g900)
}

@media (max-width: 1100px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr
  }

  .metrics-grid .metric-card:nth-child(2) {
    border-right: 0
  }

  .metrics-grid .metric-card:nth-child(-n+2) {
    border-bottom: 1px solid #e3ecd3
  }
}

@media print {

  .sidebar,
  .menu-btn {
    display: none
  }

  .app-shell {
    display: block
  }
}