/* IKALOGIC ID — the little that is specific to the accounts service.
   Everything shared (palette, buttons, badges) comes from ika-pico.css. */

/* ---- Sign-in ------------------------------------------------------------- */
.login-page { background: var(--ika-bg); }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--ika-space-4);
}
.login-card {
  background: var(--ika-panel);
  border: 1px solid var(--ika-line);
  border-radius: var(--ika-radius-lg);
  box-shadow: var(--ika-shadow);
  padding: var(--ika-space-6) 2.25rem;
  width: 100%;
  max-width: 23rem;
  margin: 0;
}
.login-logo { height: 26px; display: block; margin: 0 auto var(--ika-space-5); }
.login-lead {
  text-align: center;
  font-size: var(--ika-text-sm);
  color: var(--ika-muted);
  margin-bottom: var(--ika-space-5);
}
.login-error {
  background: var(--ika-danger-soft);
  color: var(--ika-coral-hover);
  border: 1px solid var(--ika-coral);
  border-radius: var(--ika-radius-sm);
  padding: var(--ika-space-2) var(--ika-space-3);
  font-size: var(--ika-text-sm);
  margin-bottom: var(--ika-space-4);
}

/* ---- The hub ------------------------------------------------------------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--ika-space-4);
  margin-top: var(--ika-space-5);
}
.tool-card {
  display: flex;
  align-items: center;
  gap: var(--ika-space-3);
  padding: var(--ika-space-4);
  background: var(--ika-panel);
  border: 1px solid var(--ika-line);
  /* The tool's own colour on the edge, so the hub reads like the top bars. */
  border-left: 4px solid var(--tool-color, var(--ika-coral));
  border-radius: var(--ika-radius);
  box-shadow: var(--ika-shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ika-shadow);
  text-decoration: none;
}
.tool-icon { width: 34px; height: 34px; border-radius: 8px; flex: none; }
.tool-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-text strong { color: var(--ika-slate); }
.tool-text .muted { font-size: var(--ika-text-sm); line-height: 1.35; }

/* ---- People / access matrix --------------------------------------------- */
/* The wrapper is the scroll container, horizontally and vertically.

   It already scrolled sideways so the page never has to. Giving it a height and
   letting it scroll vertically too is what makes the sticky header below work:
   `overflow-x: auto` alone still computes `overflow-y` to `auto`, so this box is
   a scroll container either way — and a sticky header inside one sticks to *it*,
   not to the viewport. With no height set, the box grows to fit the table, the
   page does the scrolling, and the header never stops moving. */
.matrix-wrap {
  overflow: auto;
  max-height: calc(100vh - 15rem);
}
.matrix { min-width: 46rem; font-size: var(--ika-text-sm); }
.matrix th, .matrix td { vertical-align: middle; }

/* The header carries the only thing identifying a column — a tool icon and its
   name — while every cell under it is an anonymous role dropdown. Scrolled out
   of sight, the table stops meaning anything. */
.matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  /* A sticky cell is not opaque by default, so the rows would show through it. */
  background: var(--ika-panel);
  /* A cell's own border does not travel with it when it sticks, so the rule under
     the header is drawn as an inset shadow instead. */
  box-shadow: inset 0 -1px 0 var(--ika-line-strong);
}
.matrix .tool-col { text-align: center; }
.matrix .tool-col select { margin: 0; padding: .2rem 1.4rem .2rem .4rem; font-size: var(--ika-text-xs); }
.matrix tr.inactive { opacity: .55; }
.matrix form { margin: 0; display: inline; }
.col-icon { width: 18px; height: 18px; border-radius: 4px; vertical-align: -4px; margin-right: .3rem; }
.actions-col { white-space: nowrap; }
.actions-col form { display: block; margin-bottom: .25rem; }
.actions-col button { width: 100%; }

.add-person { display: flex; gap: var(--ika-space-3); align-items: flex-end; flex-wrap: wrap; }
.add-person label { flex: 1 1 14rem; margin: 0; }
.add-person button { margin: 0; flex: none; }

.notice {
  background: var(--ika-info-soft);
  border-left: 4px solid var(--ika-info);
  padding: var(--ika-space-3) var(--ika-space-4);
  /* A generated password can appear here, so keep it selectable and unwrapped. */
  font-family: var(--ika-font-mono);
  font-size: var(--ika-text-sm);
  overflow-x: auto;
}
.notice.error {
  background: var(--ika-danger-soft);
  border-left-color: var(--ika-danger);
}

.access-list { list-style: none; padding: 0; }
.access-list li {
  display: flex; align-items: center; gap: var(--ika-space-2);
  padding: var(--ika-space-2) 0;
  border-bottom: 1px solid var(--ika-line);
}
.access-list li strong { flex: 1; font-weight: 600; }
