/* Giggles Studio — the staff dashboard's look (top_posts console.css: Siaga design system, light theme, warm sidebar,
   Open Sauce One). Fonts are served from this site (CSP font-src 'self'). */

@font-face { font-family: "Open Sauce One"; src: url("/fonts/OpenSauceOne-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sauce One"; src: url("/fonts/OpenSauceOne-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Open Sauce One"; src: url("/fonts/OpenSauceOne-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --accent: #fe5426;
  --cta: #0c55f1; --cta-hi: #0a48cc;
  --ink: #0a0a0a; --text: #1a1c20; --muted: #5f6672; --muted-2: #8b93a3;
  --bg: #fdfdfc; --surface: #ffffff; --surface-2: #f6f5f3; --chip: #f3f1ee; --chip-hi: #ece9e4;
  --line: #e8e5e1; --line-2: #d8d4d0;
  --grn: #0a8754; --red: #c0392b; --yel: #9a6b00;
  --sans: "Open Sauce One", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
b { font-weight: 600; }
p { margin: 6px 0; }

/* ---------- Brand mark (three bars) ---------- */
.dash-brand-mark { display: inline-flex; gap: 2.5px; align-items: flex-end; height: 20px; }
.dash-brand-mark i { width: 5px; border-radius: 2px; background: var(--accent); display: block; }
.dash-brand-mark i:nth-child(1) { height: 14px; opacity: .8; }
.dash-brand-mark i:nth-child(2) { height: 20px; }
.dash-brand-mark i:nth-child(3) { height: 16px; opacity: .9; }

/* ---------- Sign-in card (the dashboard's login.html) ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: #fafafa; }
.auth-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 4px 16px rgba(0, 0, 0, .04); }
.brand-lg { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; color: #16181d; margin-bottom: 22px; letter-spacing: -0.01em; }
.auth-card h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; color: #171717; }
.auth-card .sub { font-size: 14px; color: #737373; margin: 0 0 26px; }
button.google { width: 100%; padding: 14px 16px; font-size: 14px; font-weight: 600; border: 1px solid #e5e5e5; border-radius: 10px; background: #fff; color: #171717; display: flex; align-items: center; justify-content: center; gap: 12px; transition: background .15s, border-color .15s; }
button.google:hover { background: #fafafa; border-color: #d4d4d4; }
.footer { margin-top: 24px; font-size: 11px; color: #a3a3a3; }
.err { color: #dc2626; font-size: 13px; margin-top: 12px; }

/* ---------- App shell + sidebar (console.css .dash-side) ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.dash-side { display: flex; flex-direction: column; gap: 2px; padding: 16px 10px 18px; border-right: 1px solid #ededf0; background: #f4f2f0; height: 100vh; position: sticky; top: 0; overflow-y: auto; }
.dash-brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px 14px; }
.dash-brand-text { font-weight: 600; font-size: 17px; color: #16181d; letter-spacing: -0.01em; }
.dash-section { padding: 18px 10px 7px; font-size: 11px; color: #8a9099; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.dash-navitem, .dash-account { display: flex; align-items: center; gap: 11px; width: 100%; font: inherit; padding: 9px 10px; border: none; background: none; cursor: pointer; text-align: left; color: #43474e; font-size: 14px; font-weight: 500; line-height: 1.4; border-radius: 8px; transition: background-color .15s ease, color .15s ease; }
.dash-navitem:hover { background: #eae6e3; color: #16181d; }
.dash-navitem.active { background: #eae6e3; color: #16181d; }
.dash-navicon { display: inline-flex; }
.dash-navicon svg { flex: none; width: 18px; height: 18px; color: #8a9099; }
.dash-navitem.active .dash-navicon svg { color: #16181d; }
.dash-navlabel { flex: 1; }
.dash-navcount { flex: none; font-size: 11px; font-weight: 600; color: #fff; background: var(--red); border-radius: 999px; padding: 2px 8px; line-height: 1.3; }
.dash-divider { border: none; border-top: 1px solid #ededf0; margin: 10px 6px; }
.dash-side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.dash-account { cursor: default; }
.dash-account-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; font-size: 11px; font-weight: 600; background: linear-gradient(180deg, #f1f2f4, #e7e9ec); color: #4a4f57; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); overflow: hidden; }
.dash-account-badge img { width: 100%; height: 100%; object-fit: cover; }
.dash-account-name { flex: 1; min-width: 0; font-weight: 500; color: #16181d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-account-roles { display: block; font-size: 11px; font-weight: 400; color: #8a9099; line-height: 1.3; }
.dash-navitem.signout:hover { background: #f0dbd7; color: var(--red); }
.dash-navitem.signout:hover .dash-navicon svg { color: var(--red); }

/* ---------- Page ---------- */
.shell-main { min-width: 0; }
.page-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.page-top h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.page-top .sub { color: var(--muted); font-size: 12px; }
.page-body { padding: 20px 24px 40px; max-width: 1180px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; scroll-margin-top: 80px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.card h2 { font-size: 14px; font-weight: 600; margin: 0; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.row.tight { margin: 8px 0 0; }
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 12px; }

/* ---------- Controls (the tool pages' buttons + inputs) ---------- */
button { background: var(--chip); color: var(--text); border: 0; border-radius: 8px; padding: 8px 13px; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 13px; white-space: nowrap; transition: background .12s ease; }
button:hover { background: var(--chip-hi); }
button:disabled { opacity: .55; cursor: default; }
button.on { background: var(--cta); color: #fff; }
button.on:hover { background: var(--cta-hi); }
button.red { background: #f8e6e2; color: var(--red); }
button.red:hover { background: #f2d6d0; }
button.link { background: none; color: var(--muted); padding: 4px 2px; text-decoration: underline; font-weight: 500; }
input[type="text"], input[type="password"] { flex: 1; min-width: 0; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; }
input:focus { outline: none; border-color: #b9cdf0; box-shadow: 0 0 0 3px #eef3fe; }
input.mono { font-family: var(--mono); font-size: 12px; }
input[readonly] { background: var(--surface-2); }

/* ---------- Status pill ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--chip); color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .02em; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.live { background: var(--red); color: #fff; }
.pill.live::before { opacity: 1; animation: blink 1.4s ease-in-out infinite; }
.pill.starting { background: #fdf3d8; color: var(--yel); }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- Notes ---------- */
.note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.note.warn { background: #fdf6e3; border-color: #f0dfb0; }
.note.danger { background: #fbefec; border-color: #f0d0c9; }
.note.info { background: #eef3fe; border-color: #c7d6f2; }

/* ---------- Settings table ---------- */
table.settings { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 13px; }
table.settings th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 12px 8px 0; width: 96px; vertical-align: top; border-bottom: 1px solid var(--line); }
table.settings td { padding: 8px 0; border-bottom: 1px solid var(--line); }
table.settings tr:last-child th, table.settings tr:last-child td { border-bottom: 0; }

/* ---------- Chat (live-chat.html bubbles) ---------- */
.chat-card { position: sticky; top: 76px; }
.chat { height: calc(100vh - 190px); min-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.m { display: flex; gap: 9px; align-items: flex-start; }
.m .av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--chip); flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.m .bub { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; min-width: 0; }
.m .hdr { font-size: 11px; color: var(--muted); margin-bottom: 1px; }
.m .hdr b { color: var(--text); }
.m .txt { word-wrap: break-word; white-space: pre-wrap; font-size: 13px; }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; font-size: 13px; }

/* ---------- Narrow screens: sidebar becomes a top bar ---------- */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .chat-card { position: static; }
  .chat { height: 50vh; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .dash-side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-right: 0; border-bottom: 1px solid #ededf0; }
  .dash-brand { padding: 4px 6px; }
  .dash-section, .dash-side > .dash-navitem, .dash-divider, .dash-account { display: none; }
  .dash-side-bottom { margin: 0 0 0 auto; }
  .dash-navitem.signout { width: auto; }
  .page-top { position: static; padding: 12px 16px; }
  .page-body { padding: 16px; }
}
