/* Staff area only. Loaded by templates/staff/base.html and nothing else, so
   nothing here can reach the public site. */

.staff-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.staff-brand { font-weight: 600; }
.staff-nav { display: flex; gap: var(--space-3); margin-left: auto; }
.staff-main { padding: var(--space-4); max-width: 70rem; margin: 0 auto; }

/* The sign-out form is a flex item of .staff-header alongside .staff-nav —
   without this its default block margin adds invisible height below it,
   stretching the header taller than the brand/nav rhythm intends. The
   button itself has no .btn hook in the markup, so it's reset here to read
   as a plain link beside the nav items rather than native button chrome. */
.staff-logout { margin: 0; }
.staff-logout button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.staff-logout button:hover { text-decoration: underline; }

.staff-tiles {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}
.tile { padding: var(--space-3); border: 1px solid var(--line); border-radius: 6px; }
.tile h2 { font-size: var(--text-sm); text-transform: uppercase; margin: 0 0 var(--space-2); }
.tile-figure { font-size: 1.75rem; font-weight: 600; margin: 0; }
/* Secondary line under a tile's figure (e.g. "5 days away" on Next shoot).
   `.muted` is only ever defined scoped in this codebase — .staff-table .muted,
   .quote-builder .muted — so the tile needs its own, or the class silently
   does nothing here. */
.tile .muted { font-size: var(--text-sm); color: var(--ink-2); margin: 0; }
/* This tile marks a deposit that cleared without its Stripe credit landing —
   invoicing the full total would overcharge the client. A 1px border-color
   swap reads as decoration at a glance; a heavier border, a tinted
   background, and a coloured heading together read as an alert. */
.tile-alert {
  border: 2px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.tile-alert h2 { color: var(--danger); }

/* Login markup has no .field wrapper per input (unlike the public contact
   form in components.css), so label/input are styled directly, matching
   that same restrained treatment: a constrained column, not a full-width
   marketing page. */
.staff-login { max-width: 24rem; margin: var(--space-8) auto 0; }
.staff-login form { display: flex; flex-direction: column; }
.staff-login label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin: var(--space-4) 0 var(--space-2);
}
.staff-login label:first-of-type { margin-top: 0; }
.staff-login input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 0.65em 0.75em;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease);
}
.staff-login input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink);
}
.staff-login button {
  margin-top: var(--space-5);
  align-self: flex-start;
}

.staff-filters { display: flex; gap: var(--space-3); margin-bottom: var(--space-3); }
.staff-filters .on { font-weight: 600; text-decoration: underline; }

.staff-table { width: 100%; border-collapse: collapse; }
.staff-table th,
.staff-table td { text-align: left; padding: var(--space-2); border-bottom: 1px solid var(--line); }
.staff-table .muted { display: block; font-size: var(--text-sm); color: var(--ink-2); }

/* Narrow screens: the table reflows to stacked blocks, and each cell grows a
   heading from its data-label. One markup source for both layouts — two
   renderings of the same data is how a phone view and a desktop view quietly
   start disagreeing. The cost is that data-label must stay in step with the
   column headers; a test asserts that. */
@media (max-width: 46rem) {
  .staff-table thead { display: none; }
  .staff-table,
  .staff-table tbody,
  .staff-table tr,
  .staff-table td { display: block; width: 100%; }
  .staff-table tr {
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: var(--space-3);
    padding: var(--space-2);
  }
  .staff-table td { border: 0; display: flex; justify-content: space-between; gap: var(--space-3); }
  .staff-table td::before {
    content: attr(data-label);
    font-size: var(--text-sm);
    color: var(--ink-2);
    flex: 0 0 auto;
  }
}

/* Messages: every staff write reports through here after redirecting. */
.staff-messages { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.staff-message {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--color-border, #ddd);
  background: var(--color-surface, #f6f6f6);
}
.staff-message--error { border-left-color: #b3261e; }
.staff-message--success { border-left-color: #1e7b34; }

/* Forms */
.staff-form { display: grid; gap: 1rem; max-width: 32rem; margin-bottom: 2rem; }
.staff-form label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.staff-form input, .staff-form select { width: 100%; padding: 0.5rem; }
.staff-form .errorlist { color: #b3261e; list-style: none; padding: 0; margin: 0.25rem 0 0; }
.staff-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }

/* Line editor */
.line-editor { margin: 1.5rem 0; }
.line-editor .line-custom { font-style: italic; }
.line-editor td form { display: inline; }

@media (max-width: 46rem) {
  .staff-form { max-width: none; }
}
