/*
 * Opossum Designs partner portal.
 * Brand spec: lockup sheet OD-LM-01 v1.1 (canonical).
 * Values here are the handoff's design tokens; change them there first.
 */

:root {
  --charcoal: #171b18;
  --cream: #e6d8be;
  --bone: #f2eada;
  --olive: #495241;
  --orange: #e5672a;
  --gray: #7c807a;
  --white: #ffffff;

  --radius: 2px;
  --border: 1.5px solid var(--charcoal);
  --divider: 1px solid var(--cream);
  --shadow: 6px 6px 0 var(--charcoal);

  --pad-y: clamp(24px, 4vw, 48px);
  --pad-x: clamp(16px, 4vw, 48px);
  --max-w: 1360px;

  --display: 'Russo One', 'Arial Black', sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--charcoal);
  font-family: var(--body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--charcoal);
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--olive);
}

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

button:disabled,
input:disabled,
select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 19px;
  line-height: 1.15;
}

/* ---------- primitives ---------------------------------------------------- */

.mono,
.code {
  font-family: var(--display);
  letter-spacing: 0.04em;
}

.micro {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--olive);
}
.micro-11 {
  font-size: 11px;
}

.meta {
  font-size: 12px;
  color: var(--olive);
}
.meta-13 {
  font-size: 13px;
  color: var(--olive);
}

.stack {
  display: flex;
  flex-direction: column;
}
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-20 { gap: 20px; }
.gap-28 { gap: 28px; }
.gap-36 { gap: 36px; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.card {
  background: var(--white);
  border: var(--border);
}
.card-head {
  background: var(--cream);
  border-bottom: var(--border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: var(--divider);
  flex-wrap: wrap;
}
.card-row:last-child {
  border-bottom: none;
}

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

.btn {
  font: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--orange);
  color: var(--charcoal);
  border: none;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
}
.btn-primary:hover:not(:disabled) {
  background: var(--charcoal);
  color: var(--bone);
}
.btn-secondary {
  background: transparent;
  color: var(--charcoal);
  border: var(--border);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 16px;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--cream);
}
.btn-dark {
  background: var(--charcoal);
  color: var(--bone);
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 16px;
}
.btn-dark:hover:not(:disabled) {
  background: var(--olive);
}
.btn-download {
  background: transparent;
  border: var(--border);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
}
.btn-download:hover:not(:disabled) {
  background: var(--orange);
  border-color: var(--orange);
}
.btn-small {
  font-size: 13px;
  padding: 7px 12px;
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--charcoal);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
  cursor: pointer;
}

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

label.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}
label.field.small {
  font-size: 12px;
  gap: 6px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='date'],
input[type='number'],
input[type='file'],
select,
textarea {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  font-weight: 400;
  color: var(--charcoal);
  min-width: 0;
}
select.compact,
input.compact {
  font-size: 14px;
  padding: 9px 10px;
}
select.tiny {
  font-size: 12px;
  padding: 3px 6px;
  border-width: 1px;
  margin-top: 6px;
  display: block;
}
input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
  margin: 2px 0 0;
  flex: none;
}

.error-bar {
  background: var(--charcoal);
  color: var(--bone);
  padding: 10px 14px;
  font-size: 14px;
  border-left: 4px solid var(--orange);
}

/* ---------- chips --------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  white-space: nowrap;
}
.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid currentColor;
  flex: none;
}
.chip.small {
  font-size: 11px;
  padding: 3px 8px;
}
.chip.small .dot {
  width: 7px;
  height: 7px;
}

/* status colours: background / text / border / dot */
.st-presented        { background: var(--cream);    color: var(--charcoal); border-color: var(--cream); }
.st-presented .dot   { background: var(--gray); }
.st-under-review     { background: var(--olive);    color: var(--bone);     border-color: var(--olive); }
.st-under-review .dot{ background: var(--cream); }
.st-samples-requested{ background: var(--white);    color: var(--charcoal); border-color: var(--orange); }
.st-samples-requested .dot { background: var(--orange); }
.st-samples-sent     { background: var(--bone);     color: var(--charcoal); border-color: var(--olive); }
.st-samples-sent .dot{ background: var(--olive); }
.st-in-negotiation   { background: var(--orange);   color: var(--charcoal); border-color: var(--orange); }
.st-in-negotiation .dot { background: var(--charcoal); }
.st-licensed         { background: var(--charcoal); color: var(--bone);     border-color: var(--charcoal); }
.st-licensed .dot    { background: var(--orange); }
.st-passed           { background: var(--white);    color: var(--olive);    border-color: var(--gray); }
.st-passed .dot      { background: transparent; }
.st-none             { background: transparent;     color: var(--gray);     border-color: transparent; }
.st-none .dot        { display: none; }

/* partner access */
.st-active   { background: var(--olive);    color: var(--bone);     border-color: var(--olive); }
.st-invited  { background: var(--white);    color: var(--charcoal); border-color: var(--orange); }
.st-expired  { background: var(--white);    color: var(--olive);    border-color: var(--gray); }
.st-revoked  { background: var(--charcoal); color: var(--bone);     border-color: var(--charcoal); }
.st-active .dot, .st-invited .dot, .st-expired .dot, .st-revoked .dot { display: none; }

/* samples */
.st-requested      { background: var(--white);  color: var(--charcoal); border-color: var(--orange); }
.st-in-production  { background: var(--cream);  color: var(--charcoal); border-color: var(--cream); }
.st-in-transit     { background: var(--orange); color: var(--charcoal); border-color: var(--orange); }
.st-delivered      { background: var(--olive);  color: var(--bone);     border-color: var(--olive); }
.st-requested .dot, .st-in-production .dot, .st-in-transit .dot, .st-delivered .dot { display: none; }

/* deal documents */
.st-awaiting-your-redlines { background: var(--orange);   color: var(--charcoal); border-color: var(--orange); }
.st-redline-received       { background: var(--cream);    color: var(--charcoal); border-color: var(--cream); }
.st-draft                  { background: var(--white);    color: var(--olive);    border-color: var(--gray); }
.st-signed                 { background: var(--charcoal); color: var(--bone);     border-color: var(--charcoal); }
.st-paid                   { background: var(--olive);    color: var(--bone);     border-color: var(--olive); }
.st-due                    { background: var(--white);    color: var(--charcoal); border-color: var(--orange); }
.st-awaiting-your-redlines .dot, .st-redline-received .dot, .st-draft .dot,
.st-signed .dot, .st-paid .dot, .st-due .dot { display: none; }

.tag-exclusive {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--charcoal);
  color: var(--orange);
  padding: 3px 7px;
  border-radius: var(--radius);
}
.tag-expired {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  border: var(--border);
  padding: 2px 6px;
  border-radius: var(--radius);
}
.version {
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--gray);
  padding: 2px 6px;
  border-radius: var(--radius);
}
.version.new {
  border-color: var(--orange);
}
.ext {
  font-family: var(--display);
  font-size: 11px;
  background: var(--cream);
  padding: 6px 0;
  width: 48px;
  text-align: center;
  border-radius: var(--radius);
  flex: none;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--white);
  color: var(--charcoal);
  border: var(--border);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip:hover {
  background: var(--cream);
}
.filter-chip[aria-pressed='true'] {
  background: var(--charcoal);
  color: var(--bone);
}
.filter-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--charcoal);
  flex: none;
}
.filter-chip .count {
  opacity: 0.7;
}
/* The dot carries the status's dot colour, not its fill colour, so the chip
   itself stays white or charcoal. */
.filter-chip .dot.st-presented { background: var(--gray); }
.filter-chip .dot.st-under-review { background: var(--cream); }
.filter-chip .dot.st-samples-requested { background: var(--orange); }
.filter-chip .dot.st-samples-sent { background: var(--olive); }
.filter-chip .dot.st-in-negotiation { background: var(--charcoal); }
.filter-chip .dot.st-licensed { background: var(--orange); }
.filter-chip .dot.st-passed { background: var(--white); }

/* ---------- login --------------------------------------------------------- */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}
.login-panel {
  background: var(--charcoal);
  color: var(--bone);
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.grid-lines::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(230, 216, 190, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 216, 190, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.login-panel > * {
  position: relative;
}
.login-panel h1 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
}
.login-panel p {
  margin: 0;
  color: var(--cream);
  line-height: 1.55;
  max-width: 380px;
}
.login-form-side {
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  align-items: center;
}
.login-form {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-form h2 {
  font-size: 28px;
}
.rev {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}
.rev b {
  color: var(--orange);
}

.placeholder-art {
  border: 1.5px dashed var(--gray);
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px;
  border-radius: var(--radius);
}

/* ---------- shell --------------------------------------------------------- */

.header {
  background: var(--charcoal);
  color: var(--bone);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-bar {
  padding: 12px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-name {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.mode-tag {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--cream);
  color: var(--cream);
  padding: 2px 6px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.mode-tag.admin {
  border-color: var(--orange);
  color: var(--orange);
}
.alerts-btn {
  background: transparent;
  border: 1.5px solid var(--olive);
  color: var(--bone);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.alerts-btn:hover {
  border-color: var(--orange);
}
.badge {
  background: var(--orange);
  color: var(--charcoal);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius);
}
.whoami {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
  line-height: 1.3;
  min-width: 0;
}
.whoami .org {
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 clamp(12px, 4vw, 44px);
  border-top: 1px solid var(--olive);
}
.nav button {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--cream);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 10px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.nav button:hover {
  color: var(--bone);
}
.nav button[aria-current='page'] {
  border-bottom-color: var(--orange);
  color: var(--bone);
}

.notif {
  position: absolute;
  right: var(--pad-x);
  top: 100%; /* sits under the header at any header height */
  width: min(calc(100vw - 24px), 400px);
  background: var(--white);
  color: var(--charcoal);
  border: var(--border);
  box-shadow: var(--shadow);
  z-index: 30;
  max-height: 70vh;
  overflow-y: auto;
}
.notif-row {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: none;
  border-bottom: var(--divider);
  font: inherit;
  padding: 12px 14px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  color: var(--charcoal);
}
.notif-row:hover {
  background: var(--bone);
}
.notif-row.unread {
  background: var(--bone);
}
.notif-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  background: transparent;
}
.notif-row.unread .dot {
  background: var(--orange);
}
.notif-row .text {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 400;
}
.notif-row.unread .text {
  font-weight: 600;
}

main {
  padding: var(--pad-y) var(--pad-x) 96px;
  max-width: var(--max-w);
}

/* ---------- dashboard ----------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}
.concept-card {
  border: var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0;
}
.concept-card:hover {
  box-shadow: var(--shadow);
}
.concept-card.expired {
  opacity: 0.62;
}
.concept-card .strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: var(--border);
  background: var(--cream);
}
.concept-card .body {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  align-items: flex-start;
}
.concept-card .foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: var(--divider);
  font-size: 12px;
}
.concept-card .foot > div {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.concept-card .foot > div:first-child {
  border-right: var(--divider);
}
.nudge {
  font-size: 12px;
  font-weight: 700;
  background: var(--bone);
  border-left: 4px solid var(--orange);
  padding: 6px 10px;
}

.skeleton {
  border: 1.5px solid var(--cream);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bone);
}
.skeleton span {
  background: var(--cream);
  display: block;
}

.state-error {
  border: var(--border);
  border-left: 6px solid var(--orange);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  max-width: 640px;
  background: var(--white);
}
.state-empty {
  border: 1.5px dashed var(--gray);
  padding: 48px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  max-width: 640px;
}
.state-expired {
  background: var(--charcoal);
  color: var(--bone);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  max-width: 680px;
}
.state-expired .micro {
  color: var(--orange);
}
.state-expired p {
  margin: 0;
  line-height: 1.5;
  color: var(--cream);
}
.state-expired .btn-primary:hover {
  background: var(--bone);
  color: var(--charcoal);
}

/* ---------- concept detail ------------------------------------------------ */

.detail-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 28px;
  align-items: start;
}
.hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: var(--border);
}
/* ---------- 3D product viewer --------------------------------------------- */

.product-viewer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pv-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: var(--border);
  background: var(--white);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* the orbit controls own the gesture */
  cursor: grab;
}
.pv-canvas:active {
  cursor: grabbing;
}
.pv-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
}
.pv-status {
  position: relative;
  margin: 0;
  padding: 10px 14px;
  max-width: 80%;
  background: var(--bone);
  border-left: 4px solid var(--orange);
  font-size: 13px;
  line-height: 1.45;
  color: var(--charcoal);
}
.pv-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pv-views {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
/* The :hover rule on .btn-secondary is more specific than a plain pressed
   rule, so pressed-and-hovered has to be spelled out or the label goes bone
   on cream and disappears. */
.pv-controls .btn[aria-pressed='true'],
.pv-controls .btn[aria-pressed='true']:hover {
  background: var(--charcoal);
  color: var(--bone);
  border-color: var(--charcoal);
}
.product-viewer.pv-failed .pv-controls {
  display: none;
}

.specs {
  border: var(--border);
  background: var(--white);
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.specs > div {
  padding: 12px 14px;
  border-bottom: var(--divider);
  border-right: var(--divider);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.specs > div.wide {
  grid-column: 1 / 3;
  border-right: none;
}
.spec-v {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.columns {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  align-items: flex-start;
}
.col-narrow { flex: 1 1 260px; min-width: 0; }
.col-wide { flex: 2 1 460px; min-width: 0; }
.col-half { flex: 1 1 380px; min-width: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
}
.timeline-item .rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.timeline-item .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bone);
  border: 2px solid var(--charcoal);
  margin-top: 4px;
  flex: none;
}
.timeline-item.last .dot {
  background: var(--orange);
}
.timeline-item .line {
  width: 2px;
  flex: 1;
  background: var(--charcoal);
  min-height: 24px;
}
.timeline-item:last-child .line {
  display: none;
}
.timeline-item .text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 18px;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  font-size: 13px;
}
.sample-grid > div {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.banner-expired {
  background: var(--charcoal);
  color: var(--bone);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  max-width: 720px;
}
.banner-expired p {
  margin: 0;
  color: var(--cream);
  line-height: 1.5;
}

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

.table-wrap {
  overflow-x: auto;
  border: var(--border);
  background: var(--white);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead tr {
  background: var(--charcoal);
  color: var(--bone);
  text-align: left;
}
th {
  padding: 10px 14px;
  font-weight: 600;
}
td {
  padding: 10px 14px;
}
tbody tr {
  border-bottom: var(--divider);
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr.selectable {
  cursor: pointer;
}
tbody tr.selectable:hover {
  background: var(--bone);
}
tbody tr.selected {
  background: var(--bone);
}
tbody tr.selected td:first-child {
  border-left: 4px solid var(--orange);
}
tbody tr td:first-child {
  border-left: 4px solid transparent;
}

.action-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--charcoal);
}
.action-pill.downloaded { background: var(--orange); }
.action-pill.signed-in { background: var(--olive); color: var(--bone); }
.action-pill.blocked { background: var(--charcoal); color: var(--bone); }

/* ---------- messages ------------------------------------------------------ */

.thread-list {
  display: flex;
  flex-direction: column;
  border: var(--border);
  background: var(--white);
  flex: 1 1 240px;
  min-width: 0;
  max-height: 520px;
  overflow-y: auto;
}
.thread-list button {
  text-align: left;
  background: var(--white);
  border: none;
  border-bottom: var(--divider);
  border-left: 4px solid transparent;
  font: inherit;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.thread-list button:hover {
  background: var(--bone);
}
.thread-list button[aria-current='true'] {
  background: var(--bone);
  border-left-color: var(--orange);
}
.thread-list .preview {
  font-size: 12px;
  color: var(--olive);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.thread-pane {
  flex: 3 1 420px;
  min-width: 0;
  border: var(--border);
  background: var(--white);
  display: flex;
  flex-direction: column;
}
.bubbles {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  max-height: 460px;
  overflow-y: auto;
}
.bubble {
  max-width: 78%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-start;
}
.bubble.mine {
  align-self: flex-end;
}
.bubble .who {
  font-size: 11px;
  color: var(--olive);
}
.bubble .text {
  background: var(--cream);
  color: var(--charcoal);
  padding: 11px 14px;
  border-radius: var(--radius);
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.mine .text {
  background: var(--charcoal);
  color: var(--bone);
}
.composer {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: var(--divider);
}
.composer input {
  flex: 1;
  padding: 11px 12px;
  font-size: 15px;
}
.composer button {
  padding: 0 18px;
}

/* ---------- admin --------------------------------------------------------- */

.request-card {
  border: var(--border);
  border-left: 5px solid var(--orange);
  background: var(--white);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.request-card .quote {
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 24px;
  align-items: start;
}
.inline-form {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 12px;
  align-items: end;
  border-bottom: var(--divider);
}
.count-pill {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  background: var(--cream);
  padding: 2px 8px;
  border-radius: var(--radius);
  vertical-align: middle;
}
.count-pill.hot {
  background: var(--orange);
}
/* A file picker needs the whole row; it never fits a 130px grid cell. */
.inline-form label:has(input[type='file']) {
  grid-column: 1 / -1;
}
.inline-form input[type='file'] {
  width: 100%;
  padding: 7px 8px;
  font-size: 13px;
}

/* ---------- toast --------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  z-index: 50;
  background: var(--charcoal);
  color: var(--bone);
  padding: 14px 20px;
  border-left: 5px solid var(--orange);
  font-size: 14px;
  max-width: min(92vw, 560px);
  box-shadow: 0 8px 24px rgba(23, 27, 24, 0.3);
  line-height: 1.45;
}

/* ---------- responsive ---------------------------------------------------- */

/* The header's two groups stack rather than collide on a phone. */
@media (max-width: 560px) {
  .header-bar {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .header-bar > .brand,
  .header-bar > .row {
    flex: 1 1 100%;
  }
  .header-bar > .row {
    justify-content: space-between;
  }
  .whoami {
    align-items: flex-start;
  }
  .whoami .org {
    max-width: 45vw;
  }
}

@media (max-width: 640px) {
  .btn-primary,
  .btn-secondary,
  .btn-dark {
    min-height: 44px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .btn-download,
  .btn-small {
    min-height: 44px;
  }
  .nav button {
    min-height: 44px;
  }
  .columns {
    gap: 28px;
  }
  .specs {
    grid-template-columns: 1fr;
  }
  .specs > div,
  .specs > div.wide {
    grid-column: 1;
    border-right: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
