:root {
  --bg: #f4efe4;
  --surface: rgba(255, 253, 248, 0.92);
  --surface-strong: #fffdf8;
  --ink: #163126;
  --muted: #647067;
  --line: #d8e1d7;
  --accent: #1f7a45;
  --accent-dark: #0f6d5c;
  --hero: #143b2f;
  --shadow: 0 22px 55px rgba(20, 59, 47, 0.12);
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 122, 69, 0.15), transparent 28%),
    radial-gradient(circle at bottom right, rgba(15, 109, 92, 0.18), transparent 24%),
    linear-gradient(180deg, #f8f4eb 0%, #eef4ee 100%);
}

a {
  color: var(--accent-dark);
}

a:hover {
  color: var(--accent);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.18rem rgba(31, 122, 69, 0.2);
}

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

.site-header {
  background: linear-gradient(135deg, #173528 0%, #0f6d5c 100%);
}

.navbar {
  padding: 1rem 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-logo {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.35rem;
  object-fit: cover;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy span {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 0.25rem;
}

.profile-nav-link {
  display: inline-flex;
  align-items: center;
}

.profile-menu {
  border: 1px solid rgba(20, 59, 47, 0.08);
  border-radius: 18px;
  padding: 0.55rem;
  min-width: 13rem;
  box-shadow: 0 16px 38px rgba(20, 59, 47, 0.16);
}

.profile-menu .dropdown-item {
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
}

.profile-menu .dropdown-item:hover,
.profile-menu .dropdown-item:focus {
  background: rgba(31, 122, 69, 0.08);
  color: var(--accent-dark);
}

.nav-link {
  color: rgba(255, 255, 255, 0.78) !important;
  border-radius: 999px;
  padding: 0.55rem 0.95rem !important;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12);
}

.main-content {
  flex: 1;
}

.site-footer {
  background: rgba(18, 49, 38, 0.94);
  color: rgba(255, 255, 255, 0.8);
  padding: 1.4rem 0;
  margin-top: 2rem;
}

.hero-panel {
  background: linear-gradient(135deg, rgba(20, 59, 47, 0.96), rgba(15, 109, 92, 0.82));
  color: #fff;
  border-radius: 28px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.9rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.metric-card,
.content-card,
.summary-strip {
  background: var(--surface);
  border: 1px solid rgba(216, 225, 215, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.metric-card {
  padding: 1.25rem;
  height: 100%;
}

.accent-card {
  background: linear-gradient(135deg, rgba(31, 122, 69, 0.12), rgba(15, 109, 92, 0.08)), var(--surface);
}

.metric-label {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  margin-bottom: 0.5rem;
}

.metric-card strong {
  font-size: 1.55rem;
  font-weight: 700;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
}

.page-header p {
  margin: 0;
  max-width: 52rem;
  color: var(--muted);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.summary-strip div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.summary-strip span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.summary-strip strong {
  font-size: 1.05rem;
}

.salary-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-card {
  padding: 1.35rem;
}

.form-card {
  padding: 1.6rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.18rem;
}

.app-table {
  margin-bottom: 0;
}

.app-table thead th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: rgba(22, 49, 38, 0.04);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.app-table td,
.app-table th {
  padding: 0.95rem 0.75rem;
}

.app-table tbody tr:hover {
  background: rgba(31, 122, 69, 0.04);
}

.table-note {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  border-radius: 999px;
  padding: 0.36rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pill-success {
  color: #0f6d5c;
  background: rgba(31, 122, 69, 0.14);
  border: 1px solid rgba(31, 122, 69, 0.18);
}

.status-pill-warning {
  color: #8a4a29;
  background: rgba(216, 144, 54, 0.16);
  border: 1px solid rgba(216, 144, 54, 0.2);
}

.material-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 14rem;
}

.material-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.38rem 0.58rem;
  border: 1px solid rgba(31, 122, 69, 0.16);
  border-radius: 10px;
  background: rgba(31, 122, 69, 0.07);
  line-height: 1.15;
}

.material-chip-name {
  font-weight: 700;
  color: var(--ink);
}

.material-chip-weight {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.action-group {
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.form-control,
.form-select,
textarea {
  border-radius: 14px;
  border: 1px solid #cfd8cf;
  padding: 0.8rem 0.95rem;
  background: rgba(255, 255, 255, 0.94);
}

.form-label {
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.entry-list-heading {
  margin-top: 2rem;
}

.entry-list {
  display: grid;
  gap: 1rem;
}

.entry-list-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.entry-row-card {
  padding: 1.1rem 1.15rem;
  border-radius: 22px;
  border: 1px solid rgba(31, 122, 69, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

.entry-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.entry-item-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: rgba(31, 122, 69, 0.12);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.entry-remove-col {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.entry-remove-col .btn {
  min-width: 6.25rem;
}

.login-shell {
  min-height: calc(100vh - 16rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card-wrap {
  width: 100%;
  max-width: 28rem;
}

.login-card {
  padding: 1.5rem;
}

.login-title {
  margin: 0 0 0.5rem;
  font-size: 1.85rem;
}

.login-subtitle {
  margin: 0;
  color: var(--muted);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-brand-inline {
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.auth-brand-inline div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.auth-brand-inline span {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-brand-logo {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(20, 59, 47, 0.14));
}

.permission-card {
  padding: 1.1rem 1.15rem;
  border-radius: 20px;
  background: rgba(20, 59, 47, 0.04);
}

.permission-list {
  display: grid;
  gap: 0.75rem;
}

.permission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 122, 69, 0.1);
}

.permission-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.permission-status {
  min-width: 3rem;
  text-align: center;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.permission-status.is-on {
  color: #0f6d5c;
  background: rgba(31, 122, 69, 0.14);
}

.permission-status.is-off {
  color: #8a4a29;
  background: rgba(173, 93, 47, 0.12);
}

.permission-toggle {
  width: 3.2rem !important;
  height: 1.6rem;
}

.permission-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.permission-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: rgba(31, 122, 69, 0.12);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 600;
}

.recaptcha-panel {
  display: flex;
  justify-content: center;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(31, 122, 69, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 242, 0.96));
}

.detail-grid {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.detail-grid div {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(20, 59, 47, 0.05);
}

.detail-grid dt {
  margin-bottom: 0.35rem;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
}

.detail-grid dd {
  margin: 0;
  font-weight: 600;
}

.btn {
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
}

.alert {
  border-radius: 18px;
}

@media (max-width: 991px) {
  .hero-panel,
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  html {
    font-size: 14px;
  }

  .hero-panel,
  .metric-card,
  .content-card,
  .form-card {
    border-radius: 20px;
  }

  .entry-remove-col {
    justify-content: stretch;
  }

  .entry-remove-col .btn {
    width: 100%;
  }

  .app-table td,
  .app-table th {
    white-space: nowrap;
  }

  .login-shell {
    min-height: auto;
  }

  .login-card-wrap {
    max-width: 100%;
  }

  .permission-row {
    flex-direction: column;
    align-items: stretch;
  }

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