/* The dashboard. Same palette as the site, but laid out as a working tool:
   a navy rail on the left, an ivory workspace on the right. */

.admin-login { min-height: 82vh; display: grid; place-items: center; padding: 40px 20px; }
.admin-login .card {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line);
  padding: 40px 36px; box-shadow: var(--shadow); text-align: center;
}
.admin-login img { height: 40px; margin: 0 auto 8px; }
.admin-login .sub { color: var(--ink-soft); font-size: .9rem; margin-bottom: 26px; }
.admin-login form { text-align: left; }

.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; align-items: start; }
.admin-side {
  position: sticky; top: 0; align-self: start; height: 100vh; background: var(--navy-2); color: var(--cream-soft);
  padding: 26px 18px; display: flex; flex-direction: column; gap: 4px;
}
.admin-side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; }
.admin-side .brand img { height: 30px; }
.admin-side .brand .tag { font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: .8em 1em; border-radius: var(--r); color: var(--cream-soft);
  font-size: .84rem; letter-spacing: .04em; transition: background .25s var(--ease), color .25s var(--ease);
}
.admin-nav button svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.admin-nav button:hover { background: rgba(242,234,217,.08); color: var(--cream); }
.admin-nav button.on { background: var(--gold); color: #2a2007; }
.admin-nav button.on svg { opacity: 1; }
.admin-side .side-foot { margin-top: auto; border-top: 1px solid rgba(242,234,217,.14); padding-top: 14px; }
.admin-side .side-foot a, .admin-side .side-foot button { color: var(--cream-soft); font-size: .78rem; padding: .5em 1em; display: block; width: 100%; text-align: left; }
.admin-side .side-foot a:hover, .admin-side .side-foot button:hover { color: var(--cream); }

.admin-main { padding: 34px clamp(20px, 4vw, 48px) 80px; background: var(--paper); min-height: 100vh; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.admin-head h1 { font-size: 2.2rem; }
.admin-head p { color: var(--ink-soft); font-size: .9rem; margin: .3em 0 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.kpi { background: var(--card); border: 1px solid var(--line); padding: 22px 24px; }
.kpi .k { font-family: var(--serif); font-size: 2.6rem; color: var(--ink); line-height: 1; }
.kpi .l { margin-top: .5em; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }

.admin-card { background: var(--card); border: 1px solid var(--line); margin-bottom: 22px; }
.admin-card .card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-card .card-head h2 { font-size: 1.5rem; }
.admin-card .card-head .hint { font-size: .82rem; color: var(--ink-soft); }
.admin-card .card-body { padding: 8px 0; }
.admin-card.pad .card-body { padding: 24px; }

.atable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.atable th { text-align: left; font-family: var(--sans); font-weight: 500; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); padding: 12px 24px; border-bottom: 1px solid var(--line); }
.atable td { padding: 14px 24px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.atable tr:last-child td { border-bottom: 0; }
.atable tr:hover td { background: var(--paper); }
.atable .t-title { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.atable .muted { color: var(--ink-soft); }
.atable .actions { display: flex; gap: 8px; justify-content: flex-end; }
.atable .thumb { width: 46px; height: 46px; object-fit: cover; border: 1px solid var(--line); background: var(--paper-3); }
.pill { display: inline-block; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; padding: .35em .7em; border-radius: 40px; border: 1px solid var(--line); color: var(--ink-soft); }
.pill.on { background: #24503a; color: #d6f0e0; border-color: transparent; }
.pill.off { background: var(--paper-3); color: var(--ink-soft); }
.pill.gold { background: var(--gold-soft); color: var(--gold-deep); border-color: var(--line-gold); }

.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink-soft); transition: all .2s var(--ease); }
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn.danger:hover { border-color: var(--maroon); color: var(--maroon); }
.icon-btn svg { width: 16px; height: 16px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=url], .field select, .field textarea {
  border: 1px solid var(--line); background: var(--card); padding: .72em .9em; border-radius: var(--r); outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.field .help { font-size: .76rem; color: var(--ink-faint); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .84rem; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 40px; background: var(--paper-3); border: 1px solid var(--line); position: relative; transition: background .25s var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--gold); border-color: var(--gold); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* image picker */
.img-pick { display: flex; gap: 14px; align-items: flex-start; }
.img-pick .preview { width: 92px; height: 92px; border: 1px solid var(--line); background: var(--paper-3); object-fit: cover; flex: none; display: grid; place-items: center; color: var(--ink-faint); font-size: .7rem; overflow: hidden; }
.img-pick .preview img { width: 100%; height: 100%; object-fit: cover; }
.img-pick .pick-fields { flex: 1; }

/* modal */
.modal-scrim { position: fixed; inset: 0; z-index: 120; background: rgba(12,16,26,.5); backdrop-filter: blur(3px); display: grid; place-items: start center; padding: 5vh 20px; overflow-y: auto; animation: fadeIn .25s var(--ease); }
.modal { width: 100%; max-width: 620px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lift); animation: modalIn .35s var(--ease); }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; border-bottom: 1px solid var(--line); }
.modal .m-head h3 { font-size: 1.6rem; }
.modal .m-body { padding: 26px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px); } }

.ig-connect { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 24px; }
.ig-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-faint); }
.ig-status-dot.live { background: #34a853; box-shadow: 0 0 0 4px rgba(52,168,83,.18); }
.ig-status-dot.warn { background: var(--gold); }

.admin-preview-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 16px; }
.admin-preview-grid img { aspect-ratio: 1; object-fit: cover; width: 100%; border: 1px solid var(--line); }

@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-side .brand { padding: 6px 10px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-side .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .row2, .row3 { grid-template-columns: 1fr; }
}
