/* The admin's page layout. Colours, type and shared components are in Railcart.Core's css/theme.css. The sidebar
   and the sign-in backdrop are the shop's dark "night" panels; the pages on them are the shop's light ones. */

.shell {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar: the wordmark, the navigation and signing out, light on night. */

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.25rem 1rem;
  background: var(--night);
  color: #fff;
}

/* The theme's focus ring is dark ink, which would vanish here. */
.sidebar :focus-visible {
  outline-color: #fff;
}

.sidebar .brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin: 0 0.75rem 2rem;
}

.sidebar .logo {
  height: 1.875rem;
}

.brand-tagline {
  color: #c3c8cd;
  font-size: 0.5625rem;
  letter-spacing: 0.24em;
  line-height: 1;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav a,
.side-nav [aria-disabled] {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding-inline: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

.side-nav a {
  transition: background-color var(--ease);
}

.side-nav a:hover {
  background: rgb(255 255 255 / 0.06);
}

.side-nav a[aria-current="page"] {
  background: rgb(255 255 255 / 0.1);
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-nav [aria-disabled] {
  color: #9aa1a8;
  cursor: not-allowed;
}

.side-nav .badge {
  margin-left: auto;
  border-color: rgb(255 255 255 / 0.2);
  color: inherit;
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
}

.sign-out {
  margin-top: auto;
}

.sign-out .button {
  width: 100%;
  border-color: rgb(255 255 255 / 0.35);
  background: transparent;
  color: #fff;
}

.sign-out .button:hover {
  background: rgb(255 255 255 / 0.08);
}

/* Pages. */

.content {
  width: min(72rem, 100%);
  min-width: 0;
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-head .eyebrow {
  margin-bottom: 0.5rem;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.panel {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-wrap: anywhere;
}

.panel h2 {
  font-size: 1.125rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  gap: 0.625rem;
  margin: 0 0 1rem;
}

/* The KPIs are the shop's grey category cards. */
.kpi {
  border-color: var(--stone);
  background: var(--stone);
}

.kpi dt {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.kpi dd {
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem;
}

.empty {
  display: grid;
  place-content: center;
  min-height: 12rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-align: center;
}

.empty p {
  margin: 0.125rem 0;
}

.checklist {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.checklist li::marker {
  color: var(--muted-ink);
  font-weight: 600;
}

/* Sign-in, setup and error pages: a white card on night, like the shop's hero. */

.standalone {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.25rem;
  background: var(--night);
}

.sign-in {
  width: min(24rem, 100%);
  padding: 2rem;
  border-color: var(--surface);
}

.sign-in .logo {
  margin-bottom: 1.5rem;
}

.sign-in h1 {
  font-size: 1.75rem;
}

.sign-in fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.sign-in-button {
  width: 100%;
  margin-top: 0.5rem;
}

@media (max-width: 52rem) {
  /* minmax(0, …): otherwise the row of nav items widens the page instead of scrolling. */
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar .brand {
    margin-bottom: 1rem;
  }

  .side-nav {
    grid-auto-flow: column;
    overflow-x: auto;
    scrollbar-color: rgb(255 255 255 / 0.3) transparent;
  }

  .side-nav a,
  .side-nav [aria-disabled] {
    white-space: nowrap;
  }

  .sign-out {
    margin-top: 1rem;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }
}

/* Lists of rows, such as the company applications. */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  color: var(--muted-ink);
  font-weight: 500;
}

.data-table td form {
  display: inline-block;
}

.notice {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel + .panel {
  margin-top: 1rem;
}

.photo-list {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.photo-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.photo-list img {
  aspect-ratio: 1;
  object-fit: cover;
}

.photo-list form {
  min-width: 0;
  max-width: 100%;
}

.photo-list input {
  max-width: 100%;
}
