/* CabinetWeave brand tokens and shared component styles. No dependency on any host app. */
:root {
  --cw-navy: #132f49;
  --cw-gold: #b58c44;
  --cw-gold-light: #d9ae5e;
  --cw-gold-dark: #8a6a2c;
  --cw-paper: #f3f4ef;
  --cw-slate: #5b6b82;
  --cw-rule: #d5d8d0;
  --cw-error: #a4262c;
  --cw-success: #2f6b3f;
  --cw-radius: 4px;
  --cw-font: Lato, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cw-paper);
  color: var(--cw-navy);
  font: 400 16px/1.5 var(--cw-font);
}

h1, h2, h3 { line-height: 1.25; }
a { color: var(--cw-gold-dark); }

/* Controls */
input, select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--cw-slate);
  border-radius: var(--cw-radius);
  background: #fff;
  color: var(--cw-navy);
  font: inherit;
}

button, .cw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: var(--cw-radius);
  background: var(--cw-gold);
  color: #10202f;
  font: 700 1rem var(--cw-font);
  text-decoration: none;
  cursor: pointer;
}

button:hover, .cw-button:hover { background: var(--cw-gold-light); }

.cw-button-quiet {
  background: transparent;
  color: var(--cw-navy);
  box-shadow: inset 0 0 0 1px var(--cw-slate);
}
.cw-button-quiet:hover { background: #e6e8e0; }

.cw-button-danger {
  background: transparent;
  color: var(--cw-error);
  box-shadow: inset 0 0 0 1px var(--cw-error);
}
.cw-button-danger:hover { background: #f4e3e3; }

input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--cw-gold-dark);
  outline-offset: 2px;
}

.cw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* PageShell */
.cw-skip {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--cw-paper);
  border-radius: var(--cw-radius);
}
.cw-skip:focus { top: 8px; }

.cw-band { background: var(--cw-navy); color: #fff; border-bottom: 3px solid var(--cw-gold); }

.cw-band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  max-width: 64rem;
  margin: 0 auto;
  padding: 10px 16px;
}

/* The wordmark is navy, so it sits on a paper tile rather than the band. */
.cw-logo {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--cw-paper);
  border-radius: var(--cw-radius);
}
.cw-logo img { display: block; height: 32px; width: auto; }

.cw-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }

.cw-nav a, .cw-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--cw-radius);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.cw-nav a:hover { background: rgba(255, 255, 255, 0.12); }
.cw-nav a.active { box-shadow: inset 0 -3px 0 var(--cw-gold-light); }
.cw-band a:focus-visible, .cw-band button:focus-visible { outline-color: var(--cw-gold-light); }

.cw-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cw-actions form { margin: 0; }
.cw-actions button {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.cw-actions button:hover { background: rgba(255, 255, 255, 0.12); }

.cw-content { max-width: 64rem; margin: 0 auto; padding: 24px 16px 48px; }
.cw-content > h1 { margin: 0 0 16px; font-size: 1.75rem; font-weight: 900; }

/* Card */
.cw-card {
  margin: 0 0 24px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--cw-rule);
  border-radius: var(--cw-radius);
}
.cw-card-title { margin: 0 0 12px; font-size: 1.125rem; font-weight: 900; }

/* Field */
.cw-field { margin: 0 0 16px; }
.cw-field label { display: block; margin: 0 0 6px; font-weight: 700; }
.cw-field small { display: block; margin-top: 4px; color: var(--cw-slate); }

/* StatusNote */
.cw-note { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--cw-radius); border-left: 4px solid; background: #fff; }
.cw-note-error { color: var(--cw-error); border-color: var(--cw-error); }
.cw-note-success { color: var(--cw-success); border-color: var(--cw-success); }

/* EmptyState */
.cw-empty { padding: 20px; border: 1px dashed var(--cw-slate); border-radius: var(--cw-radius); color: var(--cw-slate); }
.cw-empty-title { margin: 0 0 4px; color: var(--cw-navy); font-weight: 700; }
.cw-empty > :last-child { margin-bottom: 0; }

/* DataTable */
.cw-table { width: 100%; border-collapse: collapse; }
.cw-table th, .cw-table td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--cw-rule); }
.cw-table th { color: var(--cw-slate); font-size: 0.875rem; font-weight: 700; }

@media (max-width: 40rem) {
  .cw-table, .cw-table tbody, .cw-table tr, .cw-table td { display: block; width: 100%; }
  .cw-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cw-table tr { padding: 8px 0; border-bottom: 2px solid var(--cw-rule); }
  .cw-table td { padding: 6px 0; border: 0; overflow-wrap: anywhere; }
  .cw-table td[data-label]::before { content: attr(data-label); display: block; color: var(--cw-slate); font-size: 0.8125rem; font-weight: 700; }
}

/* Sign-in page */
.signin { max-width: 26rem; margin: 12vh auto 0; padding: 0 16px; }
.signin h1 { font-size: 1.75rem; font-weight: 900; margin: 0 0 12px; }
.signin p { color: var(--cw-slate); }
.signin .error { color: var(--cw-error); }
.signin label { display: block; font-weight: 700; margin: 16px 0 6px; }
.signin button { width: 100%; margin-top: 16px; }
