:root {
  --ink: #132a1f;
  --gold: #9B804A;
  --gold-soft: #b39a67;
  --cream: #f2ede3;
  --cream-deep: #e6dfcf;
  --white: #fdfcf9;
  --danger: #a33a2a;
  --ok: #2e6b4f;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', 'Segoe UI', Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 2px 14px rgba(19, 42, 31, 0.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--cream); color: var(--ink); font-size: 14.5px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; }
button { font-family: var(--sans); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

.center-card { max-width: 400px; margin: 12vh auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.center-card h1 { font-size: 1.7rem; margin-bottom: 4px; }
.center-card .sub { color: #5c6a60; font-size: 0.86rem; margin-bottom: 20px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.82rem; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c9c2b0; border-radius: 8px;
  background: var(--white); font-family: var(--sans); font-size: 0.92rem; color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--cream); padding: 8px 15px; border-radius: 8px;
  font-size: 0.88rem; font-weight: 500; cursor: pointer;
}
.btn:hover { background: #1d3b2d; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #8a713f; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--cream-deep); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(163,58,42,0.08); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

.error-text { color: var(--danger); font-size: 0.85rem; margin: 8px 0; }
.ok-text { color: var(--ok); font-size: 0.85rem; margin: 8px 0; }
.help { color: #5c6a60; font-size: 0.8rem; }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } .sidebar { position: static !important; height: auto !important; } }
.sidebar { background: var(--ink); color: var(--cream); padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .brand { font-family: var(--serif); font-size: 1.2rem; margin-bottom: 4px; }
.sidebar .brand b { color: var(--gold-soft); }
.sidebar .who { font-size: 0.75rem; opacity: 0.75; margin-bottom: 18px; word-break: break-all; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav button {
  text-align: left; background: none; border: none; color: var(--cream); padding: 9px 12px;
  border-radius: 8px; font-size: 0.9rem; cursor: pointer; opacity: 0.85;
}
.sidebar nav button:hover { background: rgba(242,237,227,0.1); opacity: 1; }
.sidebar nav button.active { background: var(--gold); color: #fff; opacity: 1; }
.sidebar .foot { margin-top: auto; padding-top: 14px; }
.badge { display: inline-block; min-width: 18px; text-align: center; background: var(--danger); color: #fff; border-radius: 999px; font-size: 0.7rem; padding: 1px 6px; margin-left: 6px; }

.main { padding: 26px 30px 60px; max-width: 1060px; }
.main h1 { font-size: 1.7rem; margin-bottom: 4px; }
.main .sub { color: #5c6a60; font-size: 0.86rem; margin-bottom: 20px; }

.card { background: var(--white); border: 1px solid var(--cream-deep); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--white); border: 1px solid var(--cream-deep); border-radius: var(--radius); padding: 14px; }
.stat .v { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.stat .l { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: #5c6a60; }

.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--cream-deep); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #5c6a60; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--cream-deep); vertical-align: middle; }
.table-wrap { overflow-x: auto; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.chip-ok { background: rgba(46,107,79,0.14); color: var(--ok); }
.chip-warn { background: #fbf3df; color: #6b5320; }
.chip-off { background: var(--cream-deep); color: #5c6a60; }

.item { border: 1px solid var(--cream-deep); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: var(--white); }
.item.pending { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.item-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.item-head b { font-size: 0.95rem; }
.item-head .when { margin-left: auto; color: #7a857d; font-size: 0.76rem; }
.item-body { white-space: pre-wrap; font-size: 0.9rem; margin-bottom: 10px; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.item-photos { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.item-photos img { width: 74px; height: 74px; object-fit: cover; border-radius: 6px; border: 1px solid var(--cream-deep); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gcell { background: var(--white); border: 1px solid var(--cream-deep); border-radius: 8px; overflow: hidden; }
.gcell.hidden-cell { opacity: 0.45; }
.gcell img { width: 100%; height: 120px; object-fit: cover; display: block; }
.gcell .gmeta { padding: 7px 8px; }
.gcell input { width: 100%; border: 1px solid transparent; background: transparent; font-size: 0.78rem; padding: 3px 4px; border-radius: 5px; }
.gcell input:focus { border-color: #c9c2b0; background: var(--white); }
.gcell .gbtns { display: flex; gap: 4px; padding: 0 8px 8px; }

.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.toggle input { width: 18px; height: 18px; accent-color: var(--gold); }
.toggle .t-label b { display: block; font-size: 0.9rem; }
.toggle .t-label span { font-size: 0.78rem; color: #5c6a60; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(19,26,22,0.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--white); border-radius: 12px; padding: 22px; max-width: 440px; width: 100%; }
.modal h3 { margin-bottom: 10px; }
.modal-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

.temp-pass { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; background: var(--cream); border: 1px dashed var(--gold); padding: 10px 14px; border-radius: 8px; text-align: center; margin: 10px 0; user-select: all; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.empty-note { text-align: center; color: #5c6a60; padding: 30px 10px; font-size: 0.9rem; }
