/* Plain, functional chrome for an internal tool. Deliberately does NOT
   share the tenant app's branding -- nothing here should ever be mistaken
   for a user-facing page. No external fonts or CDN scripts. */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f5f7;
  color: #1f2328;
  line-height: 1.5;
  min-height: 100vh;
  padding: 32px 16px;
  /* Centers a lone .card (login/accept-invite/complete-profile) both axes
     on the page. Pages using the wider .page dashboard layout override
     this back to normal top-aligned block flow just below. */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .page-based screens (dashboard/users/admins/settings/music-library) are
   top-aligned, potentially-tall, scrollable content -- flex-centering
   those vertically would push content off the top of the viewport. */
body:has(.page) {
  display: block;
}

.card {
  max-width: 460px;
  width: 100%;
  background: #fff;
  border: 1px solid #d8dce1;
  border-radius: 6px;
  padding: 28px;
}

h1 {
  font-size: 20px;
  margin-bottom: 6px;
}

h2 {
  font-size: 16px;
  margin: 24px 0 8px;
}

p.sub {
  font-size: 14px;
  color: #57606a;
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 4px;
}

input {
  width: 100%;
  padding: 9px 10px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid #b9c0c8;
  border-radius: 4px;
  background: #fff;
  color: inherit;
}

input:focus {
  outline: 2px solid #0969da;
  outline-offset: -1px;
  border-color: #0969da;
}

button {
  width: 100%;
  margin-top: 20px;
  padding: 10px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: #1f6feb;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

button:hover:not(:disabled) { background: #1a5fd0; }
button:disabled { background: #8fb4f0; cursor: default; }

.error {
  margin: 12px 0;
  padding: 10px 12px;
  font-size: 14px;
  color: #8b1a1a;
  background: #ffeef0;
  border: 1px solid #f0b8bd;
  border-radius: 4px;
}

.notice {
  margin: 12px 0;
  padding: 10px 12px;
  font-size: 14px;
  color: #1f4620;
  background: #eefbf0;
  border: 1px solid #b4e0bc;
  border-radius: 4px;
}

.secret {
  display: block;
  margin-bottom: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 1px;
  word-break: break-all;
  background: #f4f5f7;
  border: 1px solid #d8dce1;
  border-radius: 4px;
}

img#qr {
  display: block;
  margin: 4px auto 12px;
  border: 1px solid #d8dce1;
  border-radius: 4px;
  background: #fff;
}

dl.meta {
  font-size: 14px;
  margin: 16px 0;
}

dl.meta dt {
  font-weight: 600;
  color: #57606a;
  margin-top: 8px;
}

.linkbtn {
  display: inline-block;
  width: auto;
  margin-top: 20px;
  padding: 8px 14px;
  font-size: 14px;
  background: #6e7781;
}

.linkbtn:hover:not(:disabled) { background: #57606a; }

/* --- Multi-page console chrome (users/admins/settings/music-library) ----
   The auth pages above (.card, max-width 460px) stay a narrow centered
   card; these rules are additive for the wider table/dashboard screens. */

.page {
  max-width: 1100px;
  margin: 0 auto;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid #d8dce1;
}

.topnav .brand {
  font-weight: 700;
  margin-right: auto;
}

.topnav a {
  font-size: 14px;
  color: #57606a;
  text-decoration: none;
}

.topnav a.active, .topnav a:hover {
  color: #1f6feb;
}

.topnav button {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
  background: #6e7781;
}

.topnav button:hover:not(:disabled) { background: #57606a; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border: 1px solid #d8dce1;
  border-radius: 6px;
  padding: 16px 18px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
}

.stat-card .label {
  font-size: 13px;
  color: #57606a;
  margin-top: 2px;
}

.panel {
  background: #fff;
  border: 1px solid #d8dce1;
  border-radius: 6px;
  padding: 20px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar input, .toolbar select {
  width: auto;
  min-width: 140px;
}

.bulk-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #eef4ff;
  border: 1px solid #b6d0fb;
  border-radius: 4px;
  font-size: 14px;
}

.bulk-bar.visible { display: flex; }

.bulk-bar button {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
}

.bulk-bar button.danger { background: #cf222e; }
.bulk-bar button.danger:hover:not(:disabled) { background: #a40e26; }

table.users {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.users th, table.users td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #eaecef;
}

table.users th {
  color: #57606a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table.users tbody tr:hover {
  background: #f6f8fa;
  cursor: pointer;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d7de;
  margin-right: 6px;
}

.dot.active {
  background: #2da44e;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 20px;
  background: #eaecef;
  color: #57606a;
}

.pill.disabled { background: #ffebe9; color: #82071e; }
.pill.deleted { background: #f6f8fa; color: #57606a; text-decoration: line-through; }

dialog.modal {
  width: min(480px, 90vw);
  border: 1px solid #d8dce1;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

dialog.modal::backdrop {
  background: rgba(15, 20, 25, 0.5);
}

dialog.modal .modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

dialog.modal .modal-actions button {
  margin-top: 0;
}

dialog.modal button.secondary {
  background: #6e7781;
}
dialog.modal button.secondary:hover:not(:disabled) { background: #57606a; }

/* --- Sidebar-tabbed settings layout (prompt-settings.html) --------------- */

.settings-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.settings-nav {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: 1px solid #d8dce1;
  border-radius: 6px;
  padding: 8px;
  position: sticky;
  top: 20px;
}

.settings-nav button {
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: #1f2328;
  border-radius: 4px;
}

.settings-nav button:hover:not(:disabled) { background: #f4f5f7; }
.settings-nav button.active { background: #eef4ff; color: #1f6feb; }

.settings-content {
  flex: 1;
  min-width: 0;
}

.settings-section { display: none; }
.settings-section.active { display: block; }

.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field-group textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px;
  border: 1px solid #b9c0c8;
  border-radius: 4px;
  resize: vertical;
}

.field-group textarea:disabled {
  background: #f4f5f7;
  color: #57606a;
}

.field-group .save-btn {
  width: auto;
  margin-top: 8px;
  padding: 7px 14px;
  font-size: 13px;
}

.readonly-banner {
  padding: 10px 12px;
  margin-bottom: 20px;
  font-size: 14px;
  background: #fff8e6;
  border: 1px solid #f0d999;
  border-radius: 4px;
  color: #7a5c00;
}

.week-table-wrap {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid #eaecef;
  border-radius: 4px;
}

.week-table-wrap table.users th {
  position: sticky;
  top: 0;
  background: #fff;
}

/* Shared with music-library.html's category chips and
   prompt-settings.html's reflection-period picker. */
.categories-list { display: flex; flex-wrap: wrap; gap: 8px; }
.categories-list .pill { display: flex; align-items: center; gap: 6px; }
.categories-list .pill button { width: auto; margin: 0; padding: 0 4px; background: none; color: #57606a; font-size: 14px; }
