/* The Fountain admin dashboard — shares Studio's palette/variables
   (studio/src/styles.css) so the admin surface reads as the same product
   rather than a separate dev tool. */
:root{
  --bg:#f6f7f9; --panel:#ffffff; --panel2:#f1f2f4; --border:#e4e7ec;
  --text:#14161a; --muted:#6b7280; --accent:#4f46e5; --accent-ink:#ffffff;
  --err:#dc2626; --radius:10px;
}
*{box-sizing:border-box}
body{font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;margin:0;background:var(--bg);color:var(--text)}
header{display:flex;align-items:center;gap:10px;padding:10px 20px;background:var(--panel);border-bottom:1px solid var(--border);font-weight:700}
header img{width:26px;height:26px;border-radius:6px;display:block}
header .logout{margin-left:auto;text-decoration:none;background:var(--panel2);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:6px 12px;font-size:13px;font-weight:500}
header .logout:hover{background:var(--border)}
main{padding:24px;max-width:1160px;margin:0 auto}
h2{margin:26px 0 8px;font-size:15px}
table{border-collapse:collapse;width:100%;margin:6px 0 8px;background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
th,td{text-align:left;padding:8px 12px;border-bottom:1px solid var(--border);font-size:13px;vertical-align:top}
th{color:var(--muted);font-weight:600;white-space:nowrap}
table[data-sortable] th{cursor:pointer;user-select:none}
table[data-sortable] th:hover{color:var(--text)}
tr:last-child td{border-bottom:none}
a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}
.pill{padding:2px 9px;border-radius:10px;background:var(--panel2);border:1px solid var(--border);font-size:12px}
.muted{color:var(--muted)}
.err{color:var(--err)}
.filter{width:280px;max-width:100%;margin-bottom:6px;padding:7px 10px;border:1px solid var(--border);border-radius:8px;font:inherit;background:var(--panel);color:var(--text)}
.row-actions form,.row-actions{display:inline}
button,.btn{font:inherit;cursor:pointer;border:none;border-radius:8px;padding:6px 12px;background:var(--accent);color:var(--accent-ink);font-weight:600;font-size:13px}
button:disabled{opacity:.5;cursor:default}
.ghost{background:var(--panel);color:var(--text);border:1px solid var(--border);font-weight:500}
.ghost:hover{background:var(--panel2)}
.danger{background:#fff;color:var(--err);border:1px solid #f3c6c6}
.danger:hover{background:#fef2f2}
.card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);padding:18px;margin:10px 0 24px;max-width:640px}
.card h2{margin-top:0}
.card label{display:block;margin:10px 0 4px;font-size:13px;font-weight:600;color:var(--muted)}
.card select,.card textarea,.card input[type=file]{width:100%;font:inherit;padding:8px 10px;border:1px solid var(--border);border-radius:8px;background:var(--panel);color:var(--text)}
.card textarea{min-height:80px;resize:vertical}
.summary{color:var(--muted);margin:4px 0 18px}
.login{display:grid;place-items:center;height:100vh}
.login-card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:36px;max-width:360px;text-align:center;display:grid;gap:12px;justify-items:center;box-shadow:0 10px 40px rgba(0,0,0,.06)}
.login-card img{width:48px;height:48px;border-radius:12px}
.login-card h2{margin:0;font-size:20px}
a.btn{display:inline-block;text-decoration:none}
.disabled{opacity:.4;pointer-events:none}
.pager{display:flex;align-items:center;gap:12px;margin:2px 0 24px}
.inline-form{display:flex;gap:8px;align-items:center}
.inline-form input{flex:1;font:inherit;padding:8px 10px;border:1px solid var(--border);border-radius:8px;background:var(--panel);color:var(--text)}
/* Turn attachments: uploaded screenshots/references on an edit turn. Shown as icons, not
   thumbnails — a table cell can't give an arbitrary screenshot a sane aspect ratio, and
   cover-cropping mangled tall phone captures. Clicking opens the full image in a lightbox
   (max-width/height, so it always scales to fit), matching the Studio chat's interaction. */
.turn-imgs{display:flex;flex-wrap:wrap;gap:4px}
.turn-img-btn{background:var(--panel);color:var(--text);border:1px solid var(--border);
  border-radius:6px;padding:2px 7px;font-size:12px;font-weight:500;line-height:1.5}
.turn-img-btn:hover{background:var(--panel2);border-color:var(--accent)}
.lightbox{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.72);cursor:zoom-out;padding:24px}
.lightbox img{max-width:92vw;max-height:92vh;border-radius:10px;box-shadow:0 20px 60px rgba(0,0,0,.5);cursor:default}

/* stats page */
.small{font-size:12px}
td.over{color:#b91c1c;font-weight:700}
.spark{width:120px}
.spark span{display:block;height:8px;border-radius:4px;background:var(--accent);min-width:2px}
.stats-form input{font:inherit;padding:4px 6px;border:1px solid var(--border);border-radius:6px;
  background:var(--panel);color:var(--text)}
