/* Admin page style. Tokens from the "Binance" DESIGN.md (getdesign.md/binance):
   dark canvas, flat cards (no shadows, no gradients), yellow only for primary
   actions and key numbers, black text on yellow, numbers in a Plex face.
   Green and red are for trading in that system, so this page does not use
   them for status: notices use the yellow accent.
   Compact on purpose: the page must fit on one screen in normal use. */
:root {
  --canvas: #0B0E11;
  --card: #1E2329;
  --elevated: #2B3139;
  --line: #2B3139;
  --text: #EAECEF;
  --text-strong: #FFFFFF;
  --muted: #707A8A;
  --muted-strong: #929AA5;
  --primary: #FCD535;
  --primary-active: #F0B90B;
  --primary-disabled: #3A3A1F;
  --on-primary: #181A20;
  --up: #0ECB81; /* trading-up green: the user asked for it for the state and the cost */
  --down: #F6465D; /* trading-down red: the user asked for it for the destructive buttons */

  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-number: "IBM Plex Sans", Inter, sans-serif;

  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --focus: 0 0 0 2px rgba(59, 130, 246, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 400 14px/1.5 var(--font); }
main { width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--space-md); }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }

/* Type */
.title-lg { font-size: 24px; font-weight: 600; line-height: 1.3; color: var(--text-strong); }
.title-md { font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--text-strong); }
.caption { font-size: 12px; font-weight: 500; line-height: 1.4; }
.muted { color: var(--muted); }
.number, td.num { font-family: var(--font-number); font-variant-numeric: tabular-nums; }
.number { font-weight: 700; color: var(--text-strong); }
.text-link { color: var(--primary); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Top bar: brand, server state, 30-day cost */
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: 0 var(--space-lg); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 17px; color: var(--text-strong); display: flex; align-items: center; gap: 10px; }
.brand-muted { color: var(--muted-strong); font-weight: 500; }
.mark { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; } /* the book logo */
.topstatus { display: flex; align-items: center; gap: var(--space-lg); }
.top-cost { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
/* number-sm of the design system: Plex, 14px, weight 500 */
.number-sm { font-family: var(--font-number); font-size: 14px; font-weight: 500; line-height: 1.4; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }

/* State pills */
.pill { display: inline-block; padding: 3px 12px; border-radius: 9999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
/* "on" states (the server is on, a meeting is in progress): green, like the cost */
.pill-on { background: rgba(14, 203, 129, 0.14); color: var(--up); }
/* The server state in the top bar: number-sm, green when on */
#server-pill { font-family: var(--font-number); font-size: 14px; font-weight: 500; }
.pill-busy { background: rgba(59, 130, 246, 0.16); color: #8db5f8; }
.pill-off { background: var(--elevated); color: var(--muted-strong); }

/* Buttons */
.btn {
  font: 600 13px/1 var(--font); border: 0; border-radius: var(--radius-md); /* one text size for all buttons */
  padding: 12px 24px; height: 40px; cursor: pointer; white-space: nowrap;
}
.btn:focus-visible, input:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-active); }
.btn-primary:disabled { background: var(--primary-disabled); color: var(--muted); cursor: default; }
/* Destructive actions (Apagar, and the confirmations of Terminar and Eliminar):
   the trading-down button of the design, white text on red. */
.btn-danger { background: var(--down); color: #FFFFFF; }
.btn-danger:hover { background: #D93A4F; }
.btn-danger:disabled { background: rgba(246, 70, 93, 0.25); color: var(--muted-strong); cursor: default; }
.btn-secondary { background: var(--elevated); color: var(--text-strong); }
.btn-secondary:hover { background: #363c45; }
.btn-text { background: transparent; color: var(--muted-strong); padding: 8px 0; height: auto; font-weight: 500; }
.btn-text:hover { color: var(--primary); }
.btn-small { height: 28px; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius-xl); padding: var(--space-md) 20px; margin-bottom: var(--space-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; }
.card-actions { display: flex; align-items: center; gap: var(--space-sm); }

/* Server card: facts in one row, the ON/OFF button on the right */
.server { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.facts { display: flex; align-items: center; gap: var(--space-lg); flex-wrap: wrap; }
.fact { display: flex; flex-direction: column; }
.fact .number { font-size: 16px; }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: var(--space-xs); }
table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 13px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; padding: 4px var(--space-sm) 6px 0; border-bottom: 1px solid var(--line); }
td { padding: 6px var(--space-sm) 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
td:first-child { white-space: normal; } /* only the title wraps: a narrow screen scrolls the table */
tr:last-child td { border-bottom: 0; }
td.num, th.right { text-align: right; }
/* Two action columns: each button fills its column, so the buttons line up. */
td.action { width: 1%; padding-right: 6px; text-align: center; white-space: nowrap; } /* 1%: as narrow as the widest button */
td.action:last-child { padding-right: 0; }
td.action .btn { width: 100%; }
tr.ended td { color: var(--muted); }
/* The recordings of a meeting with more than one: under the meeting, indented. */
tr.subrow td { border-bottom-style: dashed; }
tr.subrow td:first-child { padding-left: 22px; } /* under the title, after the arrow slot */
/* The arrow that shows or hides the recordings of a meeting (and an empty slot
   of the same width in the other rows, so the titles line up). */
.disclosure {
  display: inline-block; width: 22px; padding: 0; border: 0; background: transparent;
  color: var(--muted-strong); font-size: 13px; text-align: left; cursor: pointer;
}
button.disclosure:hover { color: var(--primary); }
.empty { padding: var(--space-xs) 0 0; }
.bottom { text-align: right; }

/* Forms and dialogs */
.form { display: flex; flex-direction: column; gap: var(--space-md); }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted-strong); font-weight: 500; flex: 1; }
.row { display: flex; gap: var(--space-md); }
/* The labels of a row have the same height and keep the text right above the
   input, so the inputs line up also when one label has two lines. */
.row label { justify-content: flex-end; }
input, select {
  font: 400 14px/1.5 var(--font); color: var(--text-strong); background: var(--elevated);
  border: 1px solid var(--line); border-radius: var(--radius-lg); height: 40px; padding: 10px 16px;
}
select { padding: 0 12px; font-family: var(--font-number); }
.time { display: flex; align-items: center; gap: 6px; color: var(--text-strong); }
.time select { flex: 1; }
input[type="checkbox"] { height: auto; accent-color: var(--primary); }
.login { max-width: 400px; margin: 64px auto; padding: var(--space-lg); }
.login .form { margin-top: var(--space-md); }
dialog {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: var(--space-lg); width: min(500px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(11, 14, 17, 0.8); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); }
.notice {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  background: var(--elevated); border-left: 3px solid var(--primary); border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-md); color: var(--text-strong); margin-bottom: var(--space-sm);
}
.notice-close {
  background: transparent; border: 0; color: var(--muted-strong); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0 4px;
}
.notice-close:hover { color: var(--text-strong); }
.form .notice { margin-bottom: 0; }

/* Phone */
@media (max-width: 768px) {
  /* The top bar wraps: the state and the cost go to a second line. */
  .topbar { height: auto; padding: 10px var(--space-md); flex-wrap: wrap; row-gap: 8px; }
  .brand-muted { display: none; }
  .topstatus { gap: var(--space-md); flex-wrap: wrap; }
  .server { flex-direction: column; align-items: stretch; }
  .server .btn { width: 100%; }
  .row { flex-direction: column; }
}
