:root {
  --navy: #0d1e33;
  --purple: #59527b;
  --purple-hover: #4a4468;
  --purple-light: #f1f0f8;
  --purple-mid: #c7c3da;
  --bg: #edf1f5;
  --surface: #f7f9fc;
  --surface2: #eef2f7;
  --panel: rgba(247, 249, 252, 0.96);
  --panel-strong: #ffffff;
  --header-bg: #59527b;
  --header-border: #746d9a;
  --border: #d8e0ea;
  --border2: #c7d2e0;
  --text: #1a2735;
  --muted: #4c6275;
  --muted2: #7f93a8;
  --green: #0e7a5a;
  --green-light: #edfaf4;
  --green-border: #9ee1c8;
  --red: #c52a2a;
  --red-light: #fef2f2;
  --red-border: #f5baba;
  --radius: 6px;
  --max: 1140px;
  --shadow: 0 6px 20px rgba(30, 41, 59, 0.06), 0 1px 4px rgba(30, 41, 59, 0.04);
  --shadow-sm: 0 2px 10px rgba(30, 41, 59, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", "Trebuchet MS", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--purple);
  text-decoration: none;
}

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

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 52px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 10px 22px;
  background: var(--header-bg);
  margin: 12px 0 20px;
  min-height: 72px;
  position: sticky;
  top: 12px;
  z-index: 100;
  border-radius: 8px;
  border: 1px solid var(--header-border);
  box-shadow: 0 5px 18px rgba(32, 41, 58, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.brand img {
  height: 48px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.92;
  flex-shrink: 0;
}

.hero-card,
.card {
  margin-top: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.inner,
.card-body {
  padding: 18px 20px;
}

.card-header {
  padding: 14px 18px 12px;
  border-bottom: 2px solid var(--border2);
  background: #dde4ee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-header h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}

.card-header p {
  font-size: 11px;
  color: var(--muted);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: start;
}

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

.title h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.title small {
  color: var(--muted2);
  font-size: 11px;
}

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

.space-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s, transform 0.12s;
}

.space-card:hover {
  background: var(--surface2);
  border-color: var(--purple-mid);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.li {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid;
}

.li svg {
  width: 17px;
  height: 17px;
}

.li-accent {
  background: var(--purple-light);
  border-color: var(--purple-mid);
  color: var(--purple);
}

.lt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.section-intro {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.ld {
  font-size: 11px;
  color: var(--muted2);
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: start;
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  appearance: none;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-light);
}

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

.form-actions,
.dev-toolbar,
.status-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  flex-wrap: wrap;
}

.form-note {
  font-size: 11px;
  color: var(--muted2);
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  padding: 0 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  min-height: 36px;
  text-decoration: none;
}

.btn-light {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-light:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--purple-mid);
}

.btn-primary {
  background: var(--purple);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(91, 75, 181, 0.25);
}

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

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 14px;
  border: 1px solid;
}

.alert-info {
  background: var(--purple-light);
  border-color: var(--purple-mid);
  color: var(--purple);
}

.alert-success {
  background: var(--green-light);
  border-color: var(--green-border);
  color: var(--green);
}

.alert-danger {
  background: var(--red-light);
  border-color: var(--red-border);
  color: var(--red);
}

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

.permit-card {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.permit-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.permit-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--border2);
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.status-badge.submitted,
.status-badge.reviewing {
  color: #9a6200;
  border-color: #efc989;
  background: #fff7ed;
}

.status-badge.approved,
.status-badge.complete {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-light);
}

.status-badge.declined {
  color: var(--red);
  border-color: var(--red-border);
  background: var(--red-light);
}

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  font-size: 12px;
}

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

.kv strong,
.ld strong {
  color: var(--text);
}

.table-empty {
  padding: 18px 14px;
  text-align: center;
  color: var(--muted2);
  font-size: 13px;
  border: 1px dashed var(--border2);
  border-radius: 6px;
  background: var(--surface);
}

.status-note {
  margin-top: 12px;
}

footer {
  margin-top: 32px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted2);
  gap: 12px;
}

@media (max-width: 960px) {
  .page-grid,
  .form-grid,
  .kv {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .wrap {
    padding: 0 14px 36px;
  }

  .site-header {
    min-height: 54px;
    padding: 8px 14px;
  }

  .brand img {
    height: 38px;
  }

  .inner,
  .card-body {
    padding: 14px 16px;
  }

  .card-header {
    padding: 10px 16px 9px;
  }

  footer {
    justify-content: center;
    text-align: center;
  }
}
