/* jjresume admin — navy + gold theme matching the public site */

:root {
  --navy: #0f1b2d;
  --navy-soft: #1a2a44;
  --navy-line: rgba(255, 255, 255, 0.12);
  --gold: #c9a227;
  --gold-soft: #d9b43a;
  --ink: #23272f;
  --muted: #5c6470;
  --line: #e3ddd0;
  --bg: #f5f2ea;
  --card: #ffffff;
  --danger: #b3372f;
  --ok: #2f7a4d;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(15, 27, 45, 0.08);
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
}

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

/* The hidden attribute must win over display: grid/flex on our layouts. */
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); letter-spacing: 0.03em; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-soft); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost { background: transparent; color: inherit; border-color: rgba(35, 39, 47, 0.35); }
.btn-ghost:hover { border-color: currentColor; }

.btn-small { padding: 0.35rem 0.9rem; font-size: 0.82rem; }

.btn-danger { background: transparent; color: var(--danger); border-color: rgba(179, 55, 47, 0.4); }
.btn-danger:hover { border-color: var(--danger); background: rgba(179, 55, 47, 0.06); }

/* ===== Login ===== */

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(201, 162, 39, 0.2), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-soft) 100%);
  padding: 1.5rem;
}

.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.2rem;
}

.login-brand {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--navy);
  margin-bottom: 1.6rem;
}

.login-brand span { color: var(--gold); }
.login-brand em { font-size: 0.85rem; font-family: var(--font-body); font-style: normal; color: var(--muted); font-weight: 500; margin-left: 0.3rem; }

.login-card h1 { font-size: 2rem; text-transform: uppercase; color: var(--navy); }
.login-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.5rem; }

.login-card form { display: grid; gap: 1rem; }
.login-card label { display: grid; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; }
.login-card input {
  font: inherit;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}
.login-card input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

.form-error {
  color: var(--danger);
  font-size: 0.88rem;
  background: rgba(179, 55, 47, 0.08);
  border: 1px solid rgba(179, 55, 47, 0.25);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
}

/* ===== App layout ===== */

.app-view { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #cfd6e4;
  display: flex;
  flex-direction: column;
  padding: 1.3rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  padding: 0 0.6rem 1.2rem;
}

.sidebar-brand span { color: var(--gold); }
.sidebar-brand em { font-size: 0.8rem; font-family: var(--font-body); font-style: normal; color: #9fb0cc; font-weight: 500; margin-left: 0.25rem; }

.sidebar-nav { display: grid; gap: 0.2rem; flex: 1; }

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: #cfd6e4;
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  padding: 0.55rem 0.75rem;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-item.active { color: #fff; background: rgba(201, 162, 39, 0.15); border-left-color: var(--gold); }

.sidebar-footer {
  border-top: 1px solid var(--navy-line);
  padding-top: 1rem;
  display: grid;
  gap: 0.6rem;
  justify-items: start;
}

.who { font-size: 0.85rem; color: #fff; }
.who strong { color: var(--gold); }
.view-site { color: #9fb0cc; font-size: 0.82rem; text-decoration: none; }
.view-site:hover { color: #fff; text-decoration: underline; }

.sidebar .btn-ghost { color: #cfd6e4; border-color: var(--navy-line); }

/* ===== Panel ===== */

.panel { padding: 2rem clamp(1.2rem, 4vw, 3rem); max-width: 980px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.panel-head h1 {
  font-size: 2.1rem;
  text-transform: uppercase;
  color: var(--navy);
  position: relative;
  padding-bottom: 0.35rem;
}

.panel-head h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46px;
  height: 4px;
  background: var(--gold);
  border-radius: 2px;
}

.role-note {
  font-size: 0.9rem;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  margin-bottom: 1.2rem;
}

.panel-body { display: grid; gap: 1rem; margin-top: 1.2rem; }

.panel-save {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 0;
  margin-top: 1.4rem;
}

.toast {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  background: var(--navy);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  z-index: 30;
}

.toast.error { background: var(--danger); }

/* ===== Editors ===== */

.item-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.3rem;
  display: grid;
  gap: 0.7rem;
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.item-head h3 { font-size: 1.15rem; text-transform: uppercase; color: var(--navy); }

.item-tools { display: flex; gap: 0.35rem; }

.icon-btn {
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfaf7;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.icon-btn:hover:not(:disabled) { color: var(--navy); border-color: var(--navy); }
.icon-btn.danger:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.field { display: grid; gap: 0.25rem; }
.field > span { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.field input, .field textarea {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  color: var(--ink);
  width: 100%;
}

.field textarea { min-height: 110px; resize: vertical; }

.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.field input:disabled, .field textarea:disabled { background: #f1ede2; color: var(--muted); }

.field-inline { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0.7rem; }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.hint { font-size: 0.82rem; color: var(--muted); }

.check-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.check-row input { width: 17px; height: 17px; accent-color: var(--gold); }

/* Headshot photo management */
.photo-frame {
  width: 140px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid var(--gold);
  background: #f1ede2;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card .item-tools { margin-top: 0.8rem; }

/* Users */
.users-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.users-table th, .users-table td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.users-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: #fbfaf7; }
.users-table tr:last-child td { border-bottom: 0; }
.user-email { font-weight: 600; }
.user-meta { color: var(--muted); font-size: 0.84rem; }
.role-select, .active-select {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.badge-admin { background: rgba(201, 162, 39, 0.18); color: #8a6d10; }
.badge-editor { background: rgba(47, 122, 77, 0.14); color: var(--ok); }
.badge-viewer { background: rgba(92, 100, 112, 0.14); color: var(--muted); }

.add-user-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.3rem;
  display: grid;
  gap: 0.7rem;
}

/* Responsive */
@media (max-width: 820px) {
  .app-view { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-nav { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .field-inline, .field-pair { grid-template-columns: 1fr; }
  .users-table { display: block; overflow-x: auto; }
}
