/* ─── PALETTE ───────────────────────────────────────────────────── */
:root {
  --cream:       #F5F0E8;
  --ivory:       #EDE8DF;
  --sand:        #C9A882;
  --sand-light:  #E8D9C4;
  --sand-dark:   #9A7A58;
  --charcoal:    #4A4A48;
  --charcoal-lt: #6B6B68;
  --border:      rgba(74,74,72,0.13);
  --white:       #FFFFFF;
  --ok:          #4A6B4A;
  --err:         #8B3A3A;
  --font-serif:  'Cormorant Garamond', serif;
  --font-sans:   'DM Sans', sans-serif;
}

/* ─── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--cream); color: var(--charcoal); font-size: 14px; line-height: 1.6; min-height: 100vh; width: 100%; }
a { color: var(--sand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { font-family: var(--font-serif); font-weight: 300; }

/* ─── FORMS ──────────────────────────────────────────────────────── */
input, select, textarea, button { font-family: var(--font-sans); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--charcoal-lt); }
.field input, .field select, .field textarea {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--charcoal); width: 100%; outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sand); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field-hint { font-size: 11px; color: var(--charcoal-lt); margin-top: -10px; margin-bottom: 14px; }

/* ─── BUTTONS ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 20px; border-radius: 8px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .18s; text-decoration: none; }
.btn-primary { background: var(--charcoal); color: var(--white); }
.btn-primary:hover { background: #333331; color: var(--white); }
.btn-sand    { background: var(--sand); color: var(--white); }
.btn-sand:hover { background: var(--sand-dark); color: var(--white); }
.btn-ghost   { background: transparent; color: var(--charcoal); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--ivory); }
.btn-danger  { background: #F9EDED; color: var(--err); border: 1px solid #E8C8C8; }
.btn-danger:hover { background: #F3DADA; }
.btn-sm    { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; padding: 14px; }

/* ─── CARDS ──────────────────────────────────────────────────────── */
.card       { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 24px; }
.card-title { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .09em; color: var(--charcoal-lt); margin-bottom: 20px; }

/* ─── BADGES ─────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-pending  { background: #FBF5E6; color: #7A6020; }
.badge-yes      { background: #EAF0E4; color: var(--ok); }
.badge-no       { background: #F5E8E8; color: var(--err); }
.badge-fr       { background: var(--sand-light); color: var(--sand-dark); }
.badge-sk       { background: var(--ivory); color: var(--charcoal); }

/* ─── TABLE ──────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--charcoal-lt); padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--cream); }

/* ─── LINK BOX ───────────────────────────────────────────────────── */
.link-box { display: flex; align-items: center; gap: 8px; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.link-box span { font-size: 11px; color: var(--charcoal-lt); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; }
.copy-btn { background: none; border: none; cursor: pointer; color: var(--sand-dark); font-size: 12px; font-weight: 500; padding: 2px 6px; white-space: nowrap; }
.copy-btn:hover { text-decoration: underline; }

/* ─── ALERTS ─────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-ok  { background: #EAF0E4; color: var(--ok);  border: 1px solid #C5D9C5; }
.alert-err { background: #F5E8E8; color: var(--err); border: 1px solid #E8C8C8; }

/* ─── NOTIFICATION TOAST ─────────────────────────────────────────── */
.notif { position: fixed; bottom: 24px; right: 24px; background: var(--charcoal); color: var(--white); padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 9999; transform: translateY(80px); opacity: 0; transition: all .3s; pointer-events: none; }
.notif.show { transform: translateY(0); opacity: 1; }

/* ─── MODAL ──────────────────────────────────────────────────────── */
.modal-bg  { display: none; position: fixed; inset: 0; background: rgba(74,74,72,.45); z-index: 500; align-items: center; justify-content: center; }
.modal-bg.open { display: flex; }
.modal     { background: var(--white); border-radius: 16px; padding: 32px; max-width: 620px; width: 92%; max-height: 88vh; overflow-y: auto; position: relative; }
.modal-x   { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--charcoal-lt); line-height: 1; }

/* ─── STATS ──────────────────────────────────────────────────────── */
.stats { display: grid; gap: 14px; margin-bottom: 22px; }
.stats.c4 { grid-template-columns: repeat(4,1fr); }
.stat-card  { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.stat-lbl   { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--charcoal-lt); margin-bottom: 8px; }
.stat-val   { font-family: var(--font-serif); font-size: 32px; font-weight: 300; color: var(--charcoal); }
.stat-val.g { color: var(--ok); }
.stat-val.r { color: var(--err); }
.stat-val.s { color: var(--sand-dark); }

/* ─── QR ─────────────────────────────────────────────────────────── */
.qr-wrap { text-align: center; padding: 16px; background: var(--cream); border-radius: 10px; border: 1px solid var(--border); }

/* ─── GALLERY ────────────────────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: 10px; }
.photo-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del  { position: absolute; top: 6px; right: 6px; background: rgba(74,74,72,.75); color: white; border: none; border-radius: 50%; width: 26px; height: 26px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; transition: border-color .2s; }
.upload-zone:hover { border-color: var(--sand); }
.upload-zone p { color: var(--charcoal-lt); font-size: 13px; margin-top: 8px; }

/* ─── SIDEBAR LAYOUT ─────────────────────────────────────────────── */
.layout   { display: flex; min-height: 100vh; width: 100%; }
.sidebar  { width: 220px; background: var(--charcoal); color: var(--white); flex-shrink: 0; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; overflow-y: auto; }
.sb-logo  { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-names { font-family: var(--font-serif); font-size: 18px; font-weight: 300; }
.sb-names span { color: var(--sand); font-style: italic; }
.sb-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.4); margin-top: 3px; }
.sb-nav   { flex: 1; padding: 14px 0; }
.sb-item  { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255,255,255,.6); font-size: 13px; text-decoration: none; transition: all .15s; border-left: 3px solid transparent; }
.sb-item:hover { color: var(--white); background: rgba(255,255,255,.05); text-decoration: none; }
.sb-item.on { color: var(--white); background: rgba(201,168,130,.15); border-left-color: var(--sand); }
.sb-icon  { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sb-badge { background: var(--sand); color: var(--white); font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 10px; margin-left: auto; }
.sb-foot  { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-foot a { color: rgba(255,255,255,.45); font-size: 12px; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.sb-foot a:hover { color: var(--white); text-decoration: none; }
.main     { margin-left: 220px; padding: 32px 36px; flex: 1; min-width: 0; width: calc(100vw - 220px); }
.pg-title { font-family: var(--font-serif); font-size: 28px; font-weight: 300; margin-bottom: 5px; }
.pg-sub   { font-size: 13px; color: var(--charcoal-lt); margin-bottom: 26px; }

/* ─── STRENGTH BAR ───────────────────────────────────────────────── */
.strength     { height: 3px; border-radius: 2px; background: var(--border); margin-top: 5px; overflow: hidden; }
.strength-bar { height: 100%; width: 0; border-radius: 2px; transition: width .3s, background .3s; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .sidebar { width: 200px; } .main { margin-left: 200px; padding: 20px 16px; }
  .field-row, .field-row.three { grid-template-columns: 1fr; }
  .stats.c4 { grid-template-columns: 1fr 1fr; }
}
