/* SSO staf Indolat.
   Colours come from meet.indolat.co.id/branding/indolat.css: the staff tools
   share one dark surface with Indolat orange as the single accent. */

:root {
  --bg: #0d0d0d;
  --surface: #171717;
  --surface-2: #202020;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.24);
  --text: #f5f5f5;
  --muted: #b5b5b5;
  --primary: #cc4e00;        /* white text on it: 4.5:1 */
  --primary-hover: #b84600;
  --primary-active: #9e3c00;
  --accent: #ff8132;         /* links and focus on --bg: 7.8:1 */
  --accent-hover: #ffa066;
  --accent-tint: rgba(255, 129, 50, 0.12);
  --accent-line: rgba(255, 129, 50, 0.45);
  --danger: #ff7a7a;
  --danger-tint: rgba(255, 90, 90, 0.12);
  --danger-solid: #a3242b;
  --ok-tint: rgba(111, 214, 154, 0.12);
  --ok-line: rgba(111, 214, 154, 0.40);
  --radius: 6px;
  --radius-lg: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
}

/* The orange glow of the meet.indolat.co.id home page, only behind the
   sign-in card: it is the one place staff see Indolat before the tools. */
body.is-auth {
  background:
    radial-gradient(ellipse 70% 55% at 5% 0%, rgba(255, 98, 0, 0.22), transparent 65%),
    radial-gradient(ellipse 55% 50% at 100% 85%, rgba(204, 78, 0, 0.14), transparent 65%),
    var(--bg);
}

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 0 0 8px; }
h2 { font-size: 1.125rem; margin: 36px 0 12px; }
h3 { font-size: 1rem; margin: 0 0 12px; }
p { margin: 0 0 12px; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

a[href], button, summary, select, label[for], input[type="checkbox"] { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
}
.skip-link:focus { left: 12px; }

/* ---- sign-in pages ---- */

.auth {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
}

.auth-logo { display: block; height: 32px; width: auto; margin: 0 0 28px; }
.auth h1 { font-size: 1.5rem; }
.auth form + form { margin-top: 12px; }

.lead { color: var(--muted); margin-bottom: 24px; }
.lead strong { color: var(--text); }

/* ---- signed-in shell ---- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-height: 44px; }
.brand img { height: 24px; width: auto; }
.brand-sub { color: var(--muted); font-size: 0.875rem; padding-left: 12px; border-left: 1px solid var(--border-strong); }
.brand:hover { color: var(--text); }

.mainnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; }
.mainnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius);
}
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a[aria-current="page"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.account { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-name { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }

.page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 24px 56px; }

.footer { color: var(--muted); font-size: 0.8125rem; text-align: center; padding: 20px 16px; border-top: 1px solid var(--border); }

/* ---- forms ---- */

.stack { display: flex; flex-direction: column; gap: 16px; }
.narrow { max-width: 480px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 0.9375rem; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
}
textarea { resize: vertical; font-family: var(--mono); font-size: 0.875rem; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.4); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); }
input:disabled { opacity: 0.6; }

.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
.check label { font-weight: 400; }

.hint { color: var(--muted); font-size: 0.875rem; margin: 0; }
.center { text-align: center; }
form.center { display: flex; justify-content: center; }

.code-input {
  font-family: var(--mono);
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fields-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.fields-row .field { flex: 1 1 200px; }
.fields-row .field.grow { flex: 2 1 280px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
form.inline select { width: auto; min-width: 200px; max-width: 100%; }

/* ---- buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled { opacity: 0.55; }
.btn-block { width: 100%; }
.btn-small { padding: 0 12px; font-size: 0.875rem; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); color: #fff; }
.btn-primary:active:not(:disabled) { background: var(--primary-active); }

.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent-line); color: var(--text); }
.btn-secondary:active:not(:disabled) { background: var(--bg); }

.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--text); background: var(--surface-2); }
.btn-quiet:active { background: var(--bg); }

.btn-danger { background: var(--danger-solid); color: #fff; }
.btn-danger:hover { background: #8a1d23; color: #fff; }
.btn-danger:active { background: #741a1f; }

.btn-danger-quiet { background: transparent; color: var(--danger); border-color: rgba(255, 122, 122, 0.45); }
.btn-danger-quiet:hover { background: var(--danger-tint); }
.btn-danger-quiet:active { background: rgba(255, 90, 90, 0.2); }

.btn-link {
  background: none;
  border: 0;
  padding: 0 6px;
  min-height: 44px;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--accent-hover); }
.btn-link:active { color: var(--primary); }

/* ---- feedback ---- */

.notice { padding: 12px 14px; border: 1px solid; border-radius: var(--radius); margin: 0 0 18px; }
.notice-ok { background: var(--ok-tint); border-color: var(--ok-line); }
.notice-error { background: var(--danger-tint); border-color: rgba(255, 122, 122, 0.45); }
.notice-warn { background: var(--accent-tint); border-color: var(--accent-line); }
.stack .notice { margin: 0; }

.status { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.auth .status { text-align: center; }
.status:empty { display: none; }

.empty {
  color: var(--muted);
  padding: 18px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  margin: 0 0 16px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  vertical-align: middle;
}

.tag {
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 0 8px;
  margin: 0 0 10px;
}

.muted { color: var(--muted); }
.meta { color: var(--muted); margin: 0 0 24px; }
.crumb { margin: 0 0 6px; font-size: 0.875rem; }
.key { margin-left: 6px; font-size: 0.75rem; color: var(--muted); vertical-align: middle; }

/* ---- page parts ---- */

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px 24px;
  margin: 28px 0;
}
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }
.split { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-bottom: 8px; }
.split .panel { margin: 0; }
.stack > .panel { margin: 0; }
.panel.stack > h2 { margin-bottom: 0; }
.note-form { margin-top: 20px; }

.search { margin: 0 0 20px; display: flex; flex-direction: column; gap: 6px; }
.search label { font-weight: 600; font-size: 0.9375rem; }
.search-row { display: flex; gap: 8px; max-width: 520px; }

.tabs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; padding: 0; }
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tabs a:hover { color: var(--text); border-color: var(--border-strong); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-color: var(--accent-line); background: var(--accent-tint); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 8px 0 24px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.secret { display: inline-block; font-size: 1rem; padding: 6px 10px; border: 1px dashed var(--accent-line); user-select: all; }

/* Confirmation without script: the summary opens the real submit button. */
details.confirm { display: inline-block; }
details.confirm > summary { list-style: none; }
details.confirm > summary::-webkit-details-marker { display: none; }
.confirm-body {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  max-width: 360px;
}
.confirm-body p { font-size: 0.9375rem; }

details.add > summary { display: flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--accent); }
details.add[open] > summary { margin-bottom: 12px; }

/* ---- tables ---- */

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 0 0 16px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
thead th { font-size: 0.8125rem; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.nowrap code { overflow-wrap: normal; }
.uris code { display: block; margin: 2px 0; width: fit-content; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
td.details { min-width: 260px; }
td.details code { background: none; padding: 0; font-size: 0.75rem; color: var(--muted); }

.matrix th[scope="row"] { position: sticky; left: 0; background: var(--surface); min-width: 240px; font-weight: 400; }
.matrix th[scope="row"] code { display: block; width: fit-content; margin-top: 2px; font-size: 0.75rem; color: var(--muted); }
.matrix .role-col { text-align: center; }
.matrix tr.group th { background: var(--bg); font-weight: 700; position: static; }
.matrix td.cell { padding: 0; text-align: center; }
.matrix .cell-hit { display: flex; align-items: center; justify-content: center; min-width: 52px; min-height: 44px; }
.matrix .cell-hit input { width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; accent-color: var(--primary); }

/* ---- home ---- */

.greeting { font-size: 2rem; margin-bottom: 4px; }
.tools h2 { margin-top: 24px; }

.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.tool {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
a.tool:hover { color: var(--text); border-color: var(--accent-line); }
a.tool:active { background: var(--surface-2); }
.tool-name { font-weight: 700; font-size: 1.0625rem; }
.tool-ext { color: var(--accent); margin-left: 6px; font-size: 0.875rem; }
.tool-role { font-size: 0.9375rem; }
.tool-url { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.tool.is-unset { border-style: dashed; }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin-top: 44px; }
.card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.card h2 { font-size: 1rem; margin: 0 0 10px; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list a { display: inline-flex; align-items: center; min-height: 44px; }

.rows { list-style: none; margin: 0 0 16px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row-main { display: flex; flex-direction: column; min-width: 0; }

.offer { max-width: 560px; }
.skip-offer { margin-top: 20px; }

.filters { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); align-items: end; margin: 8px 0 20px; }
.filters .actions { grid-column: 1 / -1; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; color: var(--muted); }

/* ---- meetings ---- */

.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.cal-label { margin: 0; font-size: 1.125rem; }
.cal-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.segmented a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--muted); text-decoration: none; }
.segmented a + a { border-left: 1px solid var(--border-strong); }
.segmented a:hover { color: var(--text); background: var(--surface-2); }
.segmented a[aria-current="page"] { color: var(--text); font-weight: 600; background: var(--accent-tint); }

table.month { table-layout: fixed; min-width: 720px; }
table.month td { vertical-align: top; height: 104px; padding: 6px; border-right: 1px solid var(--border); }
table.month td:last-child { border-right: 0; }
table.month td.out { background: var(--bg); }
table.month td.out .daynum { color: var(--muted); opacity: 0.6; }
table.month td.today .daynum { color: var(--accent); font-weight: 700; }
.daynum { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }

/* One booking in the calendar; the left edge carries its status. */
.chip {
  display: block;
  margin: 0 0 4px;
  padding: 3px 6px;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--accent-line); }
.chip-done { border-left-color: #6fd69a; }
.chip-no_show { border-left-color: #e3b341; }
.chip-canceled { border-left-color: var(--muted); color: var(--muted); text-decoration: line-through; }
.chip-time { font-variant-numeric: tabular-nums; font-weight: 600; }

.status { display: inline-block; font-size: 0.8125rem; font-weight: 600; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--border-strong); vertical-align: middle; }
.status-booked { border-color: var(--accent-line); color: var(--accent); }
.status-done { border-color: var(--ok-line); color: #6fd69a; }
.status-no_show { border-color: rgba(227, 179, 65, 0.5); color: #e3b341; }
.status-canceled { color: var(--muted); }

.week { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.week-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; }
.week-day.today { border-color: var(--accent-line); }
.week-day h3 { font-size: 0.9375rem; margin: 0 0 8px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin-bottom: 6px; font-size: 0.875rem; }

.card-wide { grid-column: 1 / -1; }
.card-sub { font-size: 0.875rem; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda a { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.agenda a:hover .agenda-who { color: var(--accent); }
.agenda-when { font-variant-numeric: tabular-nums; color: var(--muted); }
.agenda-who { font-weight: 600; }
table.counts th, table.counts td { padding: 6px 10px; }
table.counts { margin-bottom: 12px; }

fieldset.choice, fieldset.days { border: 0; margin: 0; padding: 0; }
fieldset.choice legend, fieldset.days legend { font-weight: 600; font-size: 0.9375rem; margin-bottom: 4px; padding: 0; }
fieldset.days { display: flex; flex-wrap: wrap; gap: 0 18px; }
fieldset.days legend { width: 100%; }
.check input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
.checks { color: var(--muted); font-size: 0.9375rem; padding-left: 20px; }
.logo-preview { height: 40px; width: auto; max-width: 240px; background: #ffffff; padding: 6px; border-radius: var(--radius); }
details.spam { margin: 8px 0 24px; }
.history { list-style: none; padding: 0; margin: 0; font-size: 0.875rem; }
.history li { padding: 4px 0; border-bottom: 1px solid var(--border); }

@media (max-width: 720px) {
  .topbar { padding: 8px 16px; gap: 4px 12px; }
  .mainnav { order: 3; width: 100%; }
  .mainnav a { padding: 0 10px; }
  .page { padding: 24px 16px 48px; }
  .auth-card { padding: 28px 20px 24px; }
  h1 { font-size: 1.5rem; }
  .greeting { font-size: 1.625rem; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .panel { padding: 18px 16px 20px; }
}

@media (max-width: 480px) {
  .account-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
