:root {
  --green: #176b4d;
  --dark: #104c38;
  --bg: #f4f7f5;
  --line: #dfe8e3;
  --muted: #66736d;
  --danger: #c43d3d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Segoe UI,
    Arial,
    sans-serif;
  background: var(--bg);
  color: #17211d;
}
a {
  text-decoration: none;
  color: inherit;
}
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, var(--dark), var(--green));
  color: #fff;
  padding: 24px 16px;
  position: fixed;
  inset: 0 auto 0 0;
}
.brand {
  font-size: 21px;
  font-weight: 800;
  padding: 8px 12px 24px;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 5px;
}
.nav a {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  margin: 3px 0;
  color: #e9fff5;
}
.nav a:hover,
.nav a.active {
  background: #ffffff24;
}
.content {
  margin-left: 250px;
  width: calc(100% - 250px);
}
.topbar {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
}
.main {
  padding: 26px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat b {
  display: block;
  font-size: 30px;
  color: var(--green);
  margin-top: 8px;
}
.muted {
  color: var(--muted);
}
.btn {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  cursor: pointer;
  background: var(--green);
  color: #fff;
  font-weight: 600;
}
.btn.secondary {
  background: #edf4f0;
  color: var(--green);
}
.btn.danger {
  background: #fff0f0;
  color: var(--danger);
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
.field {
  margin-bottom: 15px;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.input,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfdad4;
  border-radius: 9px;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #e8eeeb;
  font-size: 14px;
}
th {
  color: var(--muted);
  background: #f8faf9;
}
.badge {
  padding: 5px 9px;
  border-radius: 99px;
  background: #e6f5ed;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
.alert {
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  background: #e9f7ef;
  color: #176b4d;
}
.alert.error {
  background: #fff0f0;
  color: var(--danger);
}
.actions {
  display: flex;
  gap: 6px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--dark), var(--green));
}
.login-card {
  width: min(420px, 92%);
  background: #fff;
  border-radius: 20px;
  padding: 32px;
}
.logo {
  text-align: center;
  font-size: 50px;
}
.photo {
  max-width: 100%;
  max-height: 430px;
  border-radius: 14px;
}
.detail {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 900px) {
  .sidebar {
    width: 76px;
  }
  .brand small,
  .brand span,
  .nav span {
    display: none;
  }
  .content {
    margin-left: 76px;
    width: calc(100% - 76px);
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 14px;
  }
  .topbar {
    padding: 0 15px;
  }
  .card {
    overflow-x: auto;
  }
}
/* Logo Pondok Pesantren Attholibiyah */
.logo {
  text-align: center;
  margin-bottom: 18px;
}

.logo img {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: contain;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 24px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text span {
  font-size: 19px;
  font-weight: 800;
}

.brand-text small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  opacity: 0.8;
}

@media (max-width: 900px) {
  .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-text {
    display: none;
  }
}
