@import url("../montserrat.css");

:root {
  --green: #008000;
  --deep: #074c34;
  --ink: #18352a;
  --muted: #63766c;
  --line: #e1e9e3;
  --bg: #f5f8f5;
  --pale: #eaf5ea;
  --white: #fff;
  --amber: #956113;
  --red: #b23b3b;
  font-family: Montserrat, Arial, sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button {
  border: 0;
  background: none;
  color: inherit;
}

a {
  color: var(--green);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -1px;
  font-weight: 700;
}

h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
}

h3 {
  font-size: 16px;
}

small,
.small {
  font-size: 12px;
}

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

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

#app .row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.between {
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 18px;
}

.button {
  padding: 12px 20px;
  border-radius: 26px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.button:hover {
  background: #006c00;
}

.button.secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.subtle {
  background: var(--pale);
  color: var(--green);
}

.button.danger {
  background: #fff0f0;
  color: var(--red);
}

.button.small {
  padding: 8px 13px;
  font-size: 12px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: white;
  border-right: 1px solid var(--line);
  padding: 32px 22px 20px;
  position: fixed;
  width: 250px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand {
  width: 192px;
  display: block;
  margin: 0 auto;
}

.brand-divider {
  border-top: 1px solid var(--line);
  margin: 27px 0 26px;
}

.portal-label {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--muted);
}

.nav-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1.6px;
  font-weight: 700;
  margin: 0 14px 12px;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  text-align: left;
  border-radius: 9px;
  color: var(--muted);
  margin: 4px 0;
  font-weight: 500;
}

.nav-button:hover {
  background: #f5f8f5;
}

.nav-button.active {
  background: var(--pale);
  color: var(--green);
  font-weight: 700;
}

.nav-button .count {
  margin-left: auto;
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  min-width: 22px;
  text-align: center;
  font-size: 11px;
}

.sidebar-bottom {
  margin-top: auto;
}

.help-box {
  padding: 17px;
  background: #f5f8f5;
  border-radius: 12px;
  margin: 30px 0 20px;
}

.help-box p {
  margin-top: 7px;
  font-size: 12px;
}

.person {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #e8efdb;
  color: #476332;
  flex: none;
  object-fit: cover;
}

.person.large {
  width: 72px;
  height: 72px;
  font-size: 25px;
}

.account {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  gap: 10px;
}

.account strong {
  font-size: 12px;
}

.account small {
  display: block;
  font-size: 10px;
}

.workspace {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  height: 83px;
  background: #ffffffd9;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  gap: 15px;
}

.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}

.breadcrumb span {
  margin: 0 12px;
  color: #b3bfb6;
}

.topbar select {
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  max-width: 240px;
}

.prototype {
  font-size: 10px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 5px;
  background: #fff3d9;
  color: #88651e;
  letter-spacing: 0.8px;
}

.content {
  max-width: 1540px;
  margin: auto;
  padding: 32px 38px;
}

.welcome {
  margin-bottom: 28px;
}

.welcome p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.date {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.section-heading {
  margin-bottom: 17px;
}

.section-heading .muted {
  font-size: 12px;
}

.credits {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 13px;
}

.credit {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px 17px;
  position: relative;
  overflow: hidden;
}

.credit:first-child {
  border-color: #b6d9b6;
}

.credit-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.credit-top .icon {
  width: 18px;
  color: var(--green);
}

.credit-label {
  font-size: 12px;
  font-weight: 600;
}

.credit-number {
  font-size: 33px;
  line-height: 1.2;
  margin: 18px 0 15px;
  font-weight: 700;
  letter-spacing: -1px;
}

.credit-number span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}

.meter {
  height: 5px;
  background: #edf2ec;
  border-radius: 5px;
  overflow: hidden;
}

.meter span {
  display: block;
  background: var(--green);
  height: 100%;
  border-radius: 5px;
}

.credit-foot {
  font-size: 10px;
  color: var(--muted);
  margin-top: 10px;
}

.credits-note {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.credits-note .icon {
  width: 14px;
  height: 14px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  overflow: hidden;
}

.panel-head {
  padding: 23px 23px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.panel-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.text-button {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  padding: 6px;
  white-space: nowrap;
}

.tabs {
  display: flex;
  padding: 0 22px;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 9px 0 13px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--green);
  font-weight: 700;
  border-color: var(--green);
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
}

th {
  color: var(--muted);
  font-weight: 500;
  background: #fafcf9;
  padding: 13px 21px;
  font-size: 10px;
  white-space: nowrap;
}

td {
  padding: 18px 21px;
  border-bottom: 1px solid #edf1ec;
}

tr:last-child td {
  border: 0;
}

td strong {
  font-weight: 600;
  display: block;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

#app .badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

#app .badge.Approved {
  color: #227446;
  background: #eaf5ed;
}

#app .badge.Pending {
  color: #956113;
  background: #fff3db;
}

#app .badge.Rejected {
  color: #ac4747;
  background: #ffeded;
}

#app .badge.Cancelled {
  color: #63766c;
  background: #eff2ef;
}

.table-footer {
  padding: 16px 23px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.side-card {
  padding: 22px;
}

.side-card h3 {
  margin-bottom: 17px;
}

.side-card .icon {
  color: var(--green);
}

.upcoming-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.upcoming-item:last-child {
  border: 0;
  padding-bottom: 0;
}

.date-tile {
  background: #f1f6ee;
  border: 1px solid #e2ebdd;
  border-radius: 8px;
  text-align: center;
  width: 44px;
  padding: 6px;
  flex: none;
}

.date-tile b {
  font-size: 19px;
  display: block;
  line-height: 1.1;
}

.date-tile small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upcoming-item strong {
  font-size: 12px;
  display: block;
}

.upcoming-item p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.green-card {
  background: var(--deep);
  color: white;
  border-radius: 14px;
  padding: 23px;
}

.green-card .eyebrow {
  color: #a7cfb6;
  font-size: 10px;
}

.green-card h3 {
  font-size: 19px;
  line-height: 1.5;
  margin: 9px 0;
}

.green-card p {
  font-size: 12px;
  color: #c6ddcd;
}

.green-card button {
  margin-top: 15px;
  color: white;
  padding: 0;
  text-decoration: underline;
  font-size: 12px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 0 25px;
}

.stat {
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.stat b {
  display: block;
  font-size: 29px;
  margin: 5px 0;
}

.stat p {
  font-size: 12px;
  color: var(--muted);
}

.empty {
  padding: 45px 22px;
  text-align: center;
  color: var(--muted);
}

.empty h3 {
  color: var(--ink);
  margin-bottom: 6px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.toolbar input {
  max-width: 330px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-weight: 600;
  font-size: 12px;
}

:where(#app, #dialog) :where(input, select, textarea) {
  width: 100%;
  border: 1px solid #cfdcd1;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: white;
  min-width: 0;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.field small {
  color: var(--muted);
  font-size: 11px;
}

.full {
  grid-column: 1/-1;
}

.form-panel {
  padding: 27px;
  max-width: 870px;
}

.form-panel h2 {
  margin-bottom: 22px;
}

.note {
  padding: 15px;
  background: #f0f6ee;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.7;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 23px;
}

.error {
  color: var(--red);
  font-size: 12px;
  margin-top: 12px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
}

.profile-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.profile-photo input {
  font-size: 11px;
}

.audit-item {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.audit-item small {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}

dialog {
  width: min(600px, calc(100% - 30px));
  border: 0;
  border-radius: 18px;
  padding: 28px;
  color: var(--ink);
  box-shadow: 0 20px 90px #05261244;
}

dialog::backdrop {
  background: #082d2566;
  backdrop-filter: blur(3px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close {
  font-size: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px;
  margin-bottom: 20px;
}

.detail-grid small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}

#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--deep);
  color: white;
  border-radius: 12px;
  padding: 14px 23px;
  box-shadow: 0 8px 30px #173d2833;
  z-index: 50;
  max-width: 90%;
  display: none;
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: white;
}

.login-brand {
  background: var(--deep);
  padding: 60px;
  display: flex;
  flex-direction: column;
  color: white;
  position: relative;
  overflow: hidden;
}

.login-brand .logo-box {
  background: white;
  border-radius: 12px;
  width: 265px;
  padding: 15px;
}

.login-brand .logo-box img {
  width: 100%;
}

.login-brand .intro {
  margin: auto 0;
  max-width: 480px;
  padding: 60px 0;
}

.login-brand h1 {
  font-size: 53px;
  line-height: 1.18;
  letter-spacing: -2px;
  margin: 23px 0;
}

.login-brand h1 span {
  color: #afdb7e;
}

.login-brand p {
  font-size: 16px;
  color: #d0dfd5;
  max-width: 400px;
  line-height: 1.8;
}

.login-brand footer {
  font-size: 11px;
  color: #b9d2c4;
}

.login-points {
  display: flex;
  gap: 30px;
  margin-top: 40px;
}

.login-points div {
  border-top: 1px solid #44765e;
  padding-top: 15px;
}

.login-points b {
  font-size: 26px;
  display: block;
}

.login-points small {
  font-size: 10px;
  color: #c8decf;
}

.login-form-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 45px;
}

.login-form {
  width: 100%;
  max-width: 390px;
}

.login-form h2 {
  font-size: 29px;
  margin: 14px 0 10px;
}

.login-form p {
  color: var(--muted);
  margin-bottom: 26px;
}

.google {
  width: 100%;
  border: 1px solid #ccd8ce;
  border-radius: 9px;
  padding: 13px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  gap: 15px;
  align-items: center;
}

.google b {
  font-size: 21px;
  color: #4285f4;
}

.login-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #87968d;
  font-size: 11px;
  margin: 25px 0;
}

.login-separator:before,
.login-separator:after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

.demo-entry {
  padding: 20px;
  background: #f5f8f4;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.demo-entry .button {
  width: 100%;
  margin-top: 12px;
}

.demo-entry p {
  font-size: 11px;
  margin: 9px 0 0;
}

.login-foot {
  font-size: 10px;
  color: var(--muted);
  margin-top: 25px;
  text-align: center;
}

.menu {
  display: none;
}

.footer-note {
  margin-top: 24px;
  font-size: 10px;
  color: #7a8a7f;
  text-align: center;
}

.mobile-label {
  display: none;
}

@media (min-width: 1550px) {
  .content {
    padding: 42px 50px;
  }

  .topbar {
    padding: 0 50px;
  }

  .credit {
    padding: 25px;
  }

  .credit-label {
    font-size: 14px;
  }
}

@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 215px 1fr;
  }

  .sidebar {
    width: 215px;
    padding: 25px 16px;
  }

  .brand {
    width: 175px;
  }

  .content {
    padding: 28px 24px;
  }

  .topbar {
    padding: 0 24px;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .side-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .credit {
    padding: 16px 12px;
  }

  .credit-top .icon {
    display: none;
  }

  .credit-label {
    font-size: 11px;
  }

  .credit-number {
    font-size: 28px;
  }
}

@media (max-width: 800px) {
  .shell {
    display: block;
  }

  .sidebar {
    display: none;
    width: 250px;
    box-shadow: 12px 0 70px #13362233;
  }

  .sidebar.open {
    display: flex;
  }

  .workspace {
    width: 100%;
  }

  .topbar {
    height: auto;
    min-height: 72px;
    padding: 14px 18px;
    flex-wrap: wrap;
  }

  .menu {
    display: block;
    padding: 6px;
  }

  .breadcrumb {
    display: none;
  }

  .topbar .row {
    gap: 8px;
  }

  .topbar select {
    max-width: 190px;
    font-size: 11px;
  }

  .content {
    padding: 24px 18px;
  }

  .welcome {
    align-items: flex-start;
    gap: 18px;
  }

  .welcome h1 {
    font-size: 24px;
  }

  .welcome p {
    font-size: 12px;
  }

  .welcome .button {
    padding: 11px 15px;
    font-size: 12px;
  }

  .credits {
    grid-template-columns: repeat(2, 1fr);
  }

  .credit:last-child {
    grid-column: 1/-1;
  }

  .credit-top .icon {
    display: block;
  }

  .credit-label {
    font-size: 12px;
  }

  .credit-number {
    margin: 12px 0;
  }

  .credits-note {
    align-items: flex-start;
    font-size: 10px;
  }

  .section-heading .muted {
    max-width: 150px;
    text-align: right;
    font-size: 10px;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }

  .quick-stats {
    gap: 9px;
  }

  .stat {
    padding: 15px 10px;
  }

  .stat p {
    font-size: 10px;
  }

  .stat b {
    font-size: 23px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: auto;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .login {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 25px;
  }

  .login-brand .intro {
    padding: 28px 0;
  }

  .login-brand h1 {
    font-size: 34px;
    margin: 12px 0;
  }

  .login-brand .intro p {
    font-size: 13px;
  }

  .login-brand .logo-box {
    width: 190px;
  }

  .login-points,
  .login-brand footer {
    display: none;
  }

  .login-form-area {
    padding: 30px 24px;
  }

  .login-form h2 {
    font-size: 25px;
  }

  .panel-head {
    padding: 18px;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar .button {
    font-size: 12px;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-photo input {
    max-width: 250px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .content {
    animation: appear 0.2s ease-out;
  }

  @keyframes appear {
    from {
      opacity: 0.6;
      transform: translateY(4px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Keep common controls readable while retaining compact secondary metadata. */
.nav-button,
.credit-label,
.tab,
.text-button,
.field label,
table,
.badge {
  font-size: 14px;
}

th,
.credit-foot,
.table-footer,
.credit-number span,
.credits-note,
.upcoming-item p {
  font-size: 12px;
}

.welcome p,
.login-form > p {
  font-size: 16px;
}

@media (max-width: 1200px) {
  .credits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .credit-label {
    font-size: 14px;
  }
}

@media (max-width: 800px) {
  .credits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .credit:last-child {
    grid-column: 1/-1;
  }

  .welcome p {
    font-size: 14px;
  }

  .tabs {
    gap: 15px;
  }

  .tab {
    font-size: 13px;
  }

  .topbar select {
    font-size: 12px;
  }

  .credit-foot {
    font-size: 12px;
  }
}

/* Firebase identity test status */
.auth-status {
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}

.auth-account-name {
  margin-top: 20px;
  font-weight: 600;
}

.auth-account-note {
  margin-top: 20px;
}

#google-account-dialog {
  overflow-wrap: anywhere;
}

/* Live Firebase Admin workspace */
