:root {
  --bg: #eef4f2;
  --bg-deep: #0b3d3a;
  --bg-mid: #12524d;
  --surface: #ffffff;
  --ink: #13201e;
  --muted: #5d726c;
  --line: #d4e2dd;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --warn: #b45309;
  --ok: #047857;
  --bad: #b91c1c;
  --info: #0369a1;
  --shadow: 0 10px 30px rgba(11, 61, 58, 0.08);
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 40% at 0% 0%, rgba(20,184,166,.16), transparent 55%),
    radial-gradient(ellipse 50% 30% at 100% 0%, rgba(11,61,58,.1), transparent 50%),
    var(--bg);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--bg-deep), var(--bg-mid));
  color: #e8f6f3;
  padding: 1.25rem 1rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: .4rem .5rem 1.2rem; }
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--display); font-size: 1.05rem; letter-spacing: -.02em; }
.brand-text span { font-size: .72rem; opacity: .75; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: .25rem; margin-top: .5rem; }
.nav a {
  color: rgba(232,246,243,.88);
  text-decoration: none;
  padding: .7rem .85rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: .95rem;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.sidebar-foot { margin-top: auto; padding: 1rem .5rem 0; font-size: .8rem; opacity: .7; }

.content { padding: 1.25rem 1.5rem 2.5rem; }
.toprow { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-title { margin: 0; font-family: var(--display); font-size: clamp(1.4rem, 2.5vw, 1.85rem); letter-spacing: -.02em; }
.page-sub { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }
.user-chip { display: flex; align-items: center; gap: .75rem; }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: none; cursor: pointer; font: inherit; font-weight: 600;
  border-radius: 10px; padding: .65rem 1rem; text-decoration: none;
  transition: .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(15,118,110,.22); }
.btn-primary:hover { background: #0d5f59; color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: #fef2f2; color: var(--bad); border: 1px solid #fecaca; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.stat {
  background: var(--surface); border-radius: var(--radius); padding: 1rem 1.1rem;
  box-shadow: var(--shadow); border: 1px solid rgba(212,226,221,.7);
}
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-family: var(--display); font-size: 1.7rem; margin-top: .25rem; }

.card {
  background: var(--surface); border-radius: var(--radius); padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow); border: 1px solid rgba(212,226,221,.7); margin-bottom: 1rem;
}
.card h2, .card h3 { margin: 0 0 .85rem; font-size: 1.05rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .75rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #f7fbf9; }

.badge {
  display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700;
}
.badge-warn { background: #fff7ed; color: var(--warn); }
.badge-info { background: #eff6ff; color: var(--info); }
.badge-ok { background: #ecfdf5; color: var(--ok); }
.badge-bad { background: #fef2f2; color: var(--bad); }
.badge-muted { background: #f3f4f6; color: #4b5563; }

.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: .85rem; font-weight: 500; }
.flash-success { background: #ecfdf5; color: var(--ok); border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: var(--bad); border: 1px solid #fecaca; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
label.field { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .92rem; }
label.field span.hint { font-weight: 500; color: var(--muted); font-size: .8rem; }
input, select, textarea {
  font: inherit; font-weight: 500; padding: .7rem .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fbfcfb; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,118,110,.14); background: #fff;
}
.req { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.filters input, .filters select { min-width: 160px; }
.muted { color: var(--muted); }
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    linear-gradient(145deg, rgba(11,61,58,.92), rgba(18,82,77,.85)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232dd4bf' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.login-brand img { width: 48px; height: 48px; }
.login-brand h1 { margin: 0; font-family: var(--display); font-size: 1.4rem; }
.login-brand p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.note-box { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 10px; padding: .85rem 1rem; color: #115e59; font-size: .9rem; margin-bottom: 1rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1.25rem; }
.detail-item .k { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.detail-item .v { margin-top: .2rem; font-weight: 500; white-space: pre-wrap; }
.mobile-toggle { display: none; }
.form-section-title {
  margin: 1.25rem 0 .75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--bg-deep);
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
}
.form-section-title:first-child { margin-top: 0; }
.guest-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .85rem;
  background: #f7fbf9;
}
.guest-card h4 {
  margin: 0 0 .75rem;
  font-size: .92rem;
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-105%); transition: .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: inline-flex; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .backdrop.show { display: block; }
}
