/* GSD admin panel */

:root {
  --a-bg: #F1F5F9;
  --a-panel: #FFFFFF;
  --a-ink: #0F1B2B;
  --a-body: #55657A;
  --a-line: #DCE3EC;
  --a-navy: #0B1F3A;
  --a-accent: #F97316;
  --a-accent-dark: #DC5F06;
  --a-radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--a-bg);
  color: var(--a-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--a-ink); margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.12rem; }

a { color: #1D4680; text-decoration: none; }
a:hover { color: var(--a-accent-dark); }

.muted { color: var(--a-body); }
.small { font-size: .85rem; }
.right { text-align: right; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }

.side {
  background: var(--a-navy);
  color: #A9BCD3;
  padding: 22px 0 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 0 20px 20px;
  color: #fff; font-weight: 700; font-size: .98rem; line-height: 1.15;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 14px;
}
.side-brand:hover { color: #fff; }
.side-brand small { display: block; font-size: .7rem; font-weight: 500; color: #8DA5C0; letter-spacing: .04em; }
.side-mark {
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #1D4680, #2C63AF);
  display: grid; place-items: center; font-size: .76rem; font-weight: 800; color: #fff;
}

.side-nav { display: flex; flex-direction: column; }
.side-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .58rem 20px;
  color: #B9C9DC; font-size: .93rem; font-weight: 500;
  border-left: 3px solid transparent;
}
.side-nav a span { width: 20px; text-align: center; font-size: .95rem; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.is-active {
  background: rgba(249,115,22,.14);
  border-left-color: var(--a-accent);
  color: #fff; font-weight: 600;
}
.side-heading {
  margin: 18px 0 6px; padding: 0 20px;
  font-size: .68rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: #6C86A6;
}

.pill {
  margin-left: auto; font-style: normal;
  background: var(--a-accent); color: #fff;
  border-radius: 999px; padding: .05rem .48rem;
  font-size: .72rem; font-weight: 700;
}
.pill--new { background: var(--a-accent); margin-left: .5rem; vertical-align: middle; padding: .1rem .5rem; }

.main { padding: 30px 34px 70px; max-width: 1000px; }

.page-head { margin-bottom: 22px; }
.page-head p { margin: 0; max-width: 68ch; }

/* ---------- Panels ---------- */
.panel {
  background: var(--a-panel);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius);
  padding: 22px;
  margin-bottom: 20px;
}
.panel > h2 { margin-bottom: 1rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.tile {
  background: #fff; border: 1px solid var(--a-line); border-radius: var(--a-radius);
  padding: 18px 20px;
}
.tile b { display: block; font-size: 1.7rem; font-weight: 800; color: var(--a-ink); line-height: 1.1; }
.tile span { font-size: .85rem; }
.tile--accent { border-color: var(--a-accent); background: rgba(249,115,22,.06); }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field > label {
  display: block; font-size: .84rem; font-weight: 650;
  color: var(--a-ink); margin-bottom: .3rem;
}
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--a-line);
  border-radius: 7px;
  font: inherit; font-size: .93rem;
  color: var(--a-ink); background: #fff;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(29,70,128,.3); outline-offset: 1px;
  border-color: #1D4680;
}
.list-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .87rem; }
.help { margin: .3rem 0 0; font-size: .8rem; color: #7A8A9C; }

.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 550; color: var(--a-ink); }
.check input { width: auto; }

.color-row { display: flex; gap: .5rem; align-items: center; }
.color-row input[type="color"] {
  width: 52px; height: 40px; padding: 2px; border-radius: 7px;
  border: 1px solid var(--a-line); background: #fff; cursor: pointer;
}
.color-text { max-width: 130px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--a-accent); color: #fff;
  border: 1px solid var(--a-accent);
  padding: .6rem 1.15rem; border-radius: 7px;
  font: inherit; font-weight: 650; font-size: .93rem;
  cursor: pointer; transition: background .16s ease, color .16s ease;
}
.btn:hover { background: var(--a-accent-dark); border-color: var(--a-accent-dark); color: #fff; }
.btn--sm { padding: .38rem .8rem; font-size: .85rem; }
.btn--ghost { background: #fff; color: var(--a-ink); border-color: var(--a-line); }
.btn--ghost:hover { background: #F5F8FB; color: var(--a-ink); border-color: #C4D0DE; }
.btn--danger { background: #fff; color: #B91C1C; border-color: #F3C8C8; }
.btn--danger:hover { background: #FEF2F2; color: #991B1B; border-color: #E8A9A9; }

.icon-btn {
  background: #fff; border: 1px solid var(--a-line); border-radius: 6px;
  width: 30px; height: 30px; cursor: pointer;
  color: var(--a-body); font-size: .9rem; line-height: 1;
}
.icon-btn:hover { background: #F1F5F9; color: var(--a-ink); }
.icon-btn--danger:hover { background: #FEF2F2; color: #B91C1C; border-color: #E8A9A9; }

/* ---------- Repeater rows ---------- */
.panel--rows { padding-bottom: 14px; }
.rows-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rows-head h2 { margin: 0; }

.row-card {
  border: 1px solid var(--a-line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #FCFDFE;
}
.row-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem .5rem .3rem; }
.row-toggle {
  flex: 1; display: flex; align-items: center; gap: .45rem;
  background: none; border: 0; cursor: pointer;
  font: inherit; text-align: left; color: var(--a-ink);
  padding: .35rem .4rem;
}
.row-toggle .chev { display: inline-block; transition: transform .15s ease; color: var(--a-body); }
.row-card.is-open .row-toggle .chev { transform: rotate(90deg); }
.row-tools { display: flex; gap: .3rem; }
.row-body { display: none; padding: 4px 16px 16px; border-top: 1px solid var(--a-line); }
.row-card.is-open .row-body { display: block; }
.row-template { display: none; }

/* ---------- Save bar ---------- */
.save-bar {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: .8rem;
  background: rgba(241,245,249,.94);
  backdrop-filter: blur(6px);
  padding: 14px 0;
  border-top: 1px solid var(--a-line);
}

/* ---------- Flash ---------- */
.flash {
  padding: .75rem 1rem; border-radius: 8px; margin-bottom: 18px;
  font-size: .92rem; font-weight: 550;
}
.flash--ok  { background: #DCFCE7; color: #14532D; border: 1px solid #A7E9BF; }
.flash--err { background: #FEE2E2; color: #991B1B; border: 1px solid #F3C0C0; }

/* ---------- Tables / quick links ---------- */
.table { width: 100%; border-collapse: collapse; }
.table td { padding: .6rem 0; border-bottom: 1px solid var(--a-line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--a-accent); margin-right: .35rem; vertical-align: middle;
}

.quick { display: grid; gap: 8px; margin-bottom: 1rem; }
.quick-item {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .7rem .8rem; border: 1px solid var(--a-line); border-radius: 8px;
  color: var(--a-body);
}
.quick-item:hover { border-color: #C4D0DE; background: #F8FAFC; color: var(--a-body); }
.quick-item strong { color: var(--a-ink); }
.quick-icon { font-size: 1.15rem; line-height: 1.3; }

/* ---------- Leads ---------- */
.lead--unread { border-left: 3px solid var(--a-accent); }
.lead-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.lead-head h2 { margin-bottom: .1rem; }
.lead-actions { display: flex; gap: .4rem; }
.lead-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem 1.4rem; margin: 1rem 0 0; }
.lead-grid dt { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #8195AB; }
.lead-grid dd { margin: .1rem 0 0; color: var(--a-ink); font-size: .93rem; }
.lead-msg {
  margin-top: 1rem; padding: .9rem 1rem;
  background: #F5F8FB; border-radius: 8px;
  color: var(--a-ink); font-size: .93rem;
}

/* ---------- Login / setup ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; background: #0B1F3A; padding: 24px; }
.auth-card {
  background: #fff; border-radius: 12px; padding: 34px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.auth-card h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.auth-card label { display: block; font-size: .84rem; font-weight: 650; color: var(--a-ink); margin: 1rem 0 .3rem; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 1.2rem; }
.auth-mark {
  width: 46px; height: 46px; border-radius: 10px; margin-bottom: 1rem;
  background: linear-gradient(135deg, #0B1F3A, #1D4680);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 22px 18px 60px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
