/* FP Backoffice — small hand-rolled admin styling, no framework. */

:root {
  /* Mostly neutral; orange reserved for links, primary actions and small
     brand accents. FF5E00 primary, FFB26B glow, neutrals for the rest. */
  --bg: #f7f7f6;
  --panel: #ffffff;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #6f6f6f;
  --line: #e7e7e5;
  --accent: #ff5e00;
  --accent-2: #ffb26b;
  --accent-hover: #e65400;
  --accent-text: #c24a00; /* AA-legible orange for links on light */
  --accent-soft: #fbf0e8;
  --accent-ink: #ffffff;
  --danger: #b91c1c;
  --ok: #15803d;
  /* Playlists are associated with purple shades (headers, links, cards). */
  --purple: #7c3aed;
  --purple-text: #6d28d9;
  --purple-soft: #f4f0fe;
  --purple-line: #e4d9fb;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #111111;
  color: #f3ede7;
  padding: 0 20px;
  height: 52px;
}
.topbar .brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: .3px;
  text-decoration: none;
}
.topbar .brand span { color: var(--accent-2); font-weight: 500; }
.topbar nav a {
  color: #d9d2cc;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar .whoami {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b9afa8;
}
.topbar .whoami form { margin: 0; }
.topbar .whoami .ghost { color: #d9d2cc; border-color: rgba(255, 255, 255, .18); }
.topbar .whoami .ghost:hover { background: rgba(255, 255, 255, .1); }

main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.muted { color: var(--muted); font-weight: 400; }
.crumbs { margin: 0 0 14px; color: var(--muted); }
.crumbs a { color: var(--accent-text); text-decoration: none; }
.error { color: var(--danger); }
.empty { padding: 18px 4px; }

a { color: var(--accent-text); }
a:hover { color: var(--accent); }

/* Cards / detail lists */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}
.meta { margin-bottom: 8px; }
.meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.meta-head h1 { margin: 0; }
.meta dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 16px;
  margin: 0;
}
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }

/* Tables */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table { border: none; border-radius: 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 8px 12px;
  white-space: nowrap;
}
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
th {
  background: #fafafa;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--line);
}
tbody tr:hover td { background: #f6f6f5; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; }
tr.row-deleted td { color: var(--muted); }
tr.row-pause td { background: #fff7ef; }

/* Badges */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #ececea;
  color: var(--ink-2);
}
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.danger { background: #fee2e2; color: var(--danger); }

/* Location header (company page) */
.loc-head { margin: 26px 0 10px; }
.loc-head h2 { margin: 0; }
.loc-sub { margin: 2px 0 0; font-size: 13px; }
.loc-contact { margin-left: 10px; }
.contact-match { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.contact-match:hover { color: var(--accent); text-decoration: underline; }

/* Playlists — associated with purple shades */
.playlists thead th,
.playlist-page thead th { background: var(--purple-soft); color: var(--purple-text); }
.playlists td a { color: var(--purple-text); }
.playlists td a:hover { color: var(--purple); }
.playlists .table-scroll,
.playlist-page .table-scroll { border-color: var(--purple-line); }
.playlist-page .meta {
  background: var(--purple-soft);
  border-color: var(--purple-line);
}
.playlist-page .meta-head h1 .muted { color: var(--purple-text); }

/* Forms & buttons */
input[type="search"], input[type="text"], input[type="password"], input:not([type]) {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font: inherit;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 94, 0, .20); }
.search { margin-bottom: 16px; }

button {
  font: inherit;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button:hover { filter: brightness(1.04); }
button:disabled { opacity: .5; cursor: default; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button.ghost:hover { background: var(--accent-soft); filter: none; }
button.danger { background: var(--danger); color: #fff; }
button.danger.ghost { background: transparent; color: var(--danger); border-color: var(--line); }
button.danger.ghost:hover { background: #fef2f2; }
.confirm { display: inline-flex; gap: 6px; align-items: center; }

/* Confirm modal (delete) — fades in over a dimmed backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 17, 17, .55);
}
.modal {
  width: 380px;
  max-width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Login */
.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.card.login { width: 340px; display: flex; flex-direction: column; gap: 12px; }
.card.login h1 { margin: 0; }
.card.login label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.card.login p { margin: 0; }
.card.login button { margin-top: 6px; }

/* htmx request indicator on the search box */
.search.htmx-request { background-image: linear-gradient(90deg, #ffe9d6, #fff); }
