/* Base page styles shared by the staff console and both portals: type, forms,
   buttons' companions, tables, panels. Loaded after app-ui.css, so it keeps the
   same cascade the staff console always had. */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding: 1.1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-raised);
  }

  .wordmark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
  }

  .wordmark span { color: var(--accent); }

  main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.75rem 1.5rem 6rem;
  }

  /* tokens.css only styles input[type="text"/"date"] — extend the same look
     to the other input types Django's form fields render by default. */
  input[type="email"], input[type="password"], input[type="tel"], input[type="number"] {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.65em 0.8em;
    width: 100%;
  }

  input[type="email"]:focus-visible, input[type="password"]:focus-visible,
  input[type="tel"]:focus-visible, input[type="number"]:focus-visible {
    outline: 2px solid var(--accent-teal);
    outline-offset: 1px;
    border-color: var(--accent-teal);
  }

  /* A filter control that currently has a value applied — makes it obvious at a
     glance which of several dropdowns is actually narrowing the list. */
  select.is-filtered, input.is-filtered {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-teal) 22%, transparent);
  }

  .filter-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--accent-teal);
    font-weight: 600;
  }

  .filter-status a { color: inherit; text-decoration: underline; }

  .field { margin-bottom: 1.15rem; }
  .field:last-child { margin-bottom: 0; }

  .field label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
  }

  .field .errorlist {
    list-style: none;
    margin: 0 0 0.4rem;
    padding: 0;
    color: var(--warning);
    font-size: 0.82rem;
  }

  .field .hint {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
  }

  .form-panel {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.75rem 2rem;
    max-width: 560px;
  }

  .eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
  }

  h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.3rem);
    margin: 0 0 0.6rem;
    text-wrap: balance;
  }

  h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 1.1rem;
  }

  .page-intro { color: var(--text-secondary); max-width: 62ch; margin: 0 0 1.5rem; }

  .section-note { font-size: 0.86rem; color: var(--text-secondary); max-width: 66ch; margin: -0.6rem 0 1.1rem; }

  .status-message { font-size: 0.92rem; color: var(--text-secondary); max-width: 58ch; margin-top: 0.5rem; }

  section { margin-bottom: 2.5rem; }

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

  .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1.5rem;
  }

  .back-link:hover { color: var(--text); }

  .empty-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--bg-raised);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.35rem;
  }

  .table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }

  table { width: 100%; border-collapse: collapse; min-width: 480px; background: var(--bg-raised); }

  thead th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sunken);
  }

  tbody td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; }
  tbody tr:last-child td { border-bottom: none; }

  a.row-link { color: inherit; text-decoration: none; }
  a.row-link:hover { color: var(--accent-teal); }

  .status-dot-pill { display: inline-flex; align-items: center; gap: 0.5em; font-size: 0.85rem; white-space: nowrap; }
  .status-dot-pill .dot { width: 0.5em; height: 0.5em; border-radius: 50%; flex: none; background: var(--accent-teal); }
  .status-dot-pill.placed .dot { background: var(--success); }
  .status-dot-pill.inactive .dot { background: var(--text-secondary); }
  .status-dot-pill.inactive { color: var(--text-secondary); }

  .details-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 2rem; }

  .detail-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
  }

  .detail-value { font-size: 0.94rem; }

  .panel { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem 1.75rem; }

  @media (max-width: 560px) {
    .details-grid { grid-template-columns: 1fr; }
  }
