:root {
  color-scheme: light;
  --font-sans: "Plus Jakarta Sans", Inter, "SF Pro Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #eef5f1;
  --surface: #ffffff;
  --surface-soft: #f7fbf8;
  --line: #d9e7df;
  --text: #12342a;
  --muted: #668176;
  --primary: #0b8a61;
  --primary-dark: #086747;
  --primary-soft: #e3f6ee;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --warning: #a56700;
  --warning-soft: #fff6db;
  --shadow: 0 18px 40px rgba(18, 52, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(7, 113, 78, 0.92), rgba(7, 142, 94, 0.88) 48%, transparent 48%),
    var(--bg);
}

.login-brand {
  text-align: center;
  color: #fff;
}

.brand-mark {
  width: 82px;
  height: 82px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  color: #0a5c42;
  background: linear-gradient(135deg, #b8f4c8, #10b875);
  font-weight: 900;
  font-size: 42px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 24px;
  box-shadow: none;
}

.login-brand h1 {
  margin: 18px 0 6px;
  font-size: 32px;
}

.login-brand p,
.login-heading p,
.side-brand span,
.topbar p {
  margin: 0;
  color: var(--muted);
}

.login-brand p {
  color: rgba(255, 255, 255, 0.78);
}

.login-card {
  width: min(560px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.icon-box {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 24px;
  font-weight: 700;
}

.login-heading h2,
.panel h2,
.drawer h2 {
  margin: 0;
  font-size: 22px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 0 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 138, 97, 0.12);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.plain-btn {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  font-weight: 700;
}

.primary-btn {
  color: #fff;
  background: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.ghost-btn {
  color: var(--primary);
  background: var(--primary-soft);
}

.danger-btn {
  color: var(--danger);
  background: var(--danger-soft);
}

.plain-btn {
  color: var(--text);
  background: #f0f6f2;
}

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #0d3329;
  color: #fff;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.side-brand span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list button {
  height: 42px;
  border: 0;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  text-align: left;
  padding: 0 12px;
  font-weight: 700;
}

.nav-list button.active,
.nav-list button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 26px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-chip,
.count-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card,
.panel,
.toolbar {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.content-grid {
  display: grid;
  gap: 16px;
}

.content-grid.two {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.panel {
  padding: 16px;
  box-shadow: 0 10px 22px rgba(18, 52, 42, 0.04);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  padding: 12px;
}

.item-main {
  min-width: 0;
}

.item-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 900;
}

.item-title small,
.meta-line,
.muted {
  color: var(--muted);
}

.meta-line {
  font-size: 12px;
  line-height: 1.45;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill.warn {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

.status-grid {
  display: grid;
  gap: 8px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-size: 13px;
}

.settings-list {
  display: grid;
  gap: 18px;
}

.settings-group h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 150px minmax(240px, 1fr);
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.setting-row strong {
  display: block;
  font-size: 13px;
}

.setting-row small {
  color: var(--muted);
  font-size: 12px;
}

.area-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.alert {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 12px 14px;
  font-weight: 800;
}

.alert.error {
  color: var(--danger);
  border-color: #f2c7c1;
  background: #fff8f7;
}

.alert.success {
  color: var(--primary-dark);
  border-color: #bfe6d5;
  background: #f4fff9;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  justify-items: end;
  background: rgba(7, 27, 21, 0.42);
}

.drawer-panel {
  width: min(640px, 100%);
  height: 100vh;
  overflow: auto;
  background: var(--surface);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.16);
  padding: 20px;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.photo-grid a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1.3;
  object-fit: cover;
}

.code-box {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #10251f;
  color: #e6fff4;
  padding: 14px;
  font-size: 12px;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

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

  .nav-list button {
    text-align: center;
  }

  .content-grid.two,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar,
  .area-form,
  .setting-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .top-actions,
  .item-row {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .nav-list,
  .content-grid.two,
  .stat-grid,
  .toolbar,
  .area-form,
  .setting-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .login-card {
    padding: 22px;
  }
}
