:root {
  --bg: #0f1115;
  --panel: #181b20;
  --panel-soft: #20252b;
  --panel-raised: #1f242a;
  --panel-deep: #121519;
  --panel-glass: rgba(24, 27, 32, 0.86);
  --ink: #f4f7f5;
  --muted: #a7b0ad;
  --line: #30373d;
  --line-strong: #48515a;
  --accent: #2dd4bf;
  --accent-dark: #5eead4;
  --accent-soft: #123b36;
  --danger: #fb7185;
  --open: #34d399;
  --closed: #9ca3af;
  --finished: #34d399;
  --waiting: #f59e0b;
  --restricted: #f87171;
  --unknown: #c084fc;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.22);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.08) 0, transparent 360px),
    linear-gradient(180deg, #15191d 0, #0f1115 340px),
    var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.app-header {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--panel-glass);
  border: 1px solid rgba(72, 81, 90, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--open);
}

.topbar h1,
.auth-copy h2,
.empty h2 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 26px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  opacity: 0.82;
}

.session-email {
  max-width: 260px;
  color: rgba(167, 176, 173, 0.78);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.header-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.header-message {
  min-height: 20px;
  margin: 14px 0 0;
}

.stat-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  background: rgba(18, 21, 25, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  border-radius: 8px 8px 0 0;
  background: var(--line-strong);
}

#activeBookiesCard::before {
  background: #60a5fa;
}

#waitingBookiesCard::before {
  background: var(--waiting);
}

#kycBookiesCard::before {
  background: #c084fc;
}

#readyFluttersCard::before {
  background: var(--open);
}

.stat-button {
  cursor: pointer;
}

.stat-button:hover {
  background: var(--panel-soft);
  border-color: rgba(45, 212, 191, 0.55);
  transform: translateY(-1px);
}

.stat-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.stat-card strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
  padding: 28px;
  background: var(--panel-glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand-mark {
  margin-bottom: 18px;
}

.auth-copy p:last-child {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(72, 81, 90, 0.76);
  border-radius: 8px;
  background: rgba(18, 21, 25, 0.92);
  color: var(--ink);
  padding: 9px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 800;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button.primary {
  background: var(--accent);
  color: #06211f;
}

.button.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.button.secondary,
.button.ghost {
  background: rgba(18, 21, 25, 0.72);
  color: rgba(244, 247, 245, 0.82);
  border-color: rgba(72, 81, 90, 0.58);
}

.button.secondary:hover,
.button.ghost:hover {
  background: rgba(32, 37, 43, 0.86);
  color: var(--ink);
  border-color: rgba(72, 81, 90, 0.9);
}

.session .button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 750;
}

.icon-only-button {
  width: 32px;
  min-width: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.sign-out-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.add-person-panel {
  margin-bottom: 12px;
  padding: 14px;
  background: var(--panel-glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.add-person-panel .section-heading {
  margin-bottom: 12px;
}

.bookie-lookup,
.flutters-section,
.people-section {
  position: relative;
  margin-bottom: 12px;
  padding: 14px;
  background: var(--panel-glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.lookup-heading {
  position: relative;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  text-align: left;
}

.lookup-heading:hover .eyebrow {
  color: var(--accent-dark);
}

.lookup-heading .eyebrow {
  margin: 0;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lookup-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.lookup-heading strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.lookup-heading strong span {
  color: var(--ink);
  font-size: 18px;
}

.bookie-lookup.open .lookup-heading,
.flutters-section.open .lookup-heading,
.people-section.open .lookup-heading {
  margin-bottom: 12px;
}

.bookie-lookup.open .lookup-heading .chevron,
.flutters-section.open .lookup-heading .chevron,
.people-section.open .lookup-heading .chevron {
  transform: rotate(225deg);
}

.people-section-body {
  display: grid;
  gap: 12px;
}

.lookup-controls {
  display: grid;
  grid-template-columns: minmax(140px, 170px) minmax(180px, 230px) minmax(220px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.lookup-results {
  display: grid;
  gap: 10px;
}

.lookup-group {
  border: 1px solid rgba(72, 81, 90, 0.7);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(24, 27, 32, 0.82);
}

.lookup-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.08), transparent 55%),
    rgba(31, 36, 42, 0.82);
  border-bottom: 1px solid var(--line);
}

.lookup-group-heading strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.lookup-group-heading span {
  min-width: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 21, 25, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  padding: 4px 8px;
  text-align: center;
}

.lookup-table-wrap {
  overflow-x: auto;
}

.lookup-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.lookup-table th,
.lookup-table td {
  border-bottom: 1px solid rgba(48, 55, 61, 0.72);
  padding: 6px 7px;
  text-align: left;
  vertical-align: middle;
}

.lookup-table th {
  color: var(--muted);
  background: rgba(18, 21, 25, 0.62);
  font-size: 11px;
  font-weight: 750;
  text-transform: none;
}

.lookup-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.018);
}

.lookup-table tbody tr:hover {
  background: rgba(45, 212, 191, 0.055);
}

.lookup-table tr:last-child td {
  border-bottom: 0;
}

.lookup-table th:nth-child(1),
.lookup-table td:nth-child(1) {
  width: 17%;
}

.lookup-table th:nth-child(2),
.lookup-table td:nth-child(2) {
  width: 23%;
}

.lookup-table th:nth-child(3),
.lookup-table td:nth-child(3),
.lookup-table th:nth-child(4),
.lookup-table td:nth-child(4) {
  width: 13%;
}

.lookup-table th:nth-child(5),
.lookup-table td:nth-child(5) {
  width: 104px;
  text-align: center;
}

.lookup-table td:nth-child(5) .lookup-status-select {
  margin-inline: auto;
}

.lookup-table td {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.lookup-table td.lookup-notes-cell {
  vertical-align: middle;
}

.lookup-table td strong {
  overflow-wrap: anywhere;
}

.lookup-copy-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}

.lookup-copy-value.read-only-value {
  align-items: center;
}

.lookup-copy-value span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lookup-copy-value .copy-button {
  width: 26px;
  height: 26px;
}

.lookup-copy-value .copy-icon {
  width: 15px;
  height: 15px;
}

.person-search-value {
  justify-content: space-between;
  gap: 6px;
}

.lookup-copy-value.read-only-value.person-search-value {
  justify-content: space-between;
}

.person-search-button {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.person-search-button .search-icon {
  width: 14px;
  height: 14px;
}

.lookup-status-select {
  min-width: 92px;
  min-height: 32px;
  padding: 5px 6px;
  border-color: currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  background-color: var(--panel-deep);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.lookup-notes-cell {
  width: 16%;
}

.lookup-notes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 26px;
  min-width: 0;
}

.lookup-notes-row span {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.lookup-notes-row .icon-button {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
}

.lookup-note-editor {
  display: grid;
  gap: 8px;
}

.lookup-note-editor textarea {
  width: 100%;
  min-height: 66px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  color: var(--ink);
  background: var(--panel-deep);
  outline: none;
}

.lookup-note-editor textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.lookup-empty {
  padding: 18px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.08), transparent),
    var(--panel-deep);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.flutters-body {
  display: grid;
  gap: 12px;
}

.flutter-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(72, 81, 90, 0.7);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.82);
}

.flutter-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.08), transparent 55%),
    rgba(31, 36, 42, 0.82);
  border-bottom: 1px solid var(--line);
}

.flutter-panel-heading strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.flutter-panel-heading span {
  min-width: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 21, 25, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  padding: 4px 8px;
  text-align: center;
}

.flutter-list .lookup-empty {
  margin: 10px;
}

.flutter-table th:nth-child(1),
.flutter-table td:nth-child(1) {
  width: 10%;
}

.flutter-table th:nth-child(2),
.flutter-table td:nth-child(2) {
  width: 17%;
}

.flutter-table th:nth-child(3),
.flutter-table td:nth-child(3) {
  width: 26%;
}

.flutter-table th:nth-child(4),
.flutter-table td:nth-child(4) {
  width: 13%;
}

.flutter-table th:nth-child(5),
.flutter-table td:nth-child(5) {
  width: 78px;
  text-align: center;
}

.flutter-table th:nth-child(6),
.flutter-table td:nth-child(6) {
  width: 22%;
}

.flutter-table.has-days-left th:nth-child(1),
.flutter-table.has-days-left td:nth-child(1) {
  width: 9%;
}

.flutter-table.has-days-left th:nth-child(2),
.flutter-table.has-days-left td:nth-child(2) {
  width: 16%;
}

.flutter-table.has-days-left th:nth-child(3),
.flutter-table.has-days-left td:nth-child(3) {
  width: 25%;
}

.flutter-table.has-days-left th:nth-child(4),
.flutter-table.has-days-left td:nth-child(4) {
  width: 12%;
}

.flutter-table.has-days-left th:nth-child(5),
.flutter-table.has-days-left td:nth-child(5) {
  width: 78px;
  text-align: center;
}

.flutter-table.has-days-left th:nth-child(6),
.flutter-table.has-days-left td:nth-child(6) {
  width: 17%;
}

.flutter-table.has-days-left th:nth-child(7),
.flutter-table.has-days-left td:nth-child(7) {
  width: 68px;
  text-align: left;
}

.flutter-table .chip {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 11px;
}

.flutter-table .lookup-status-select {
  width: 74px;
  min-width: 74px;
  padding: 5px 4px;
  font-size: 11px;
}

.lookup-copy-value.read-only-value {
  justify-content: flex-start;
  min-height: 26px;
}

.lookup-copy-value.read-only-value span {
  display: flex;
  align-items: center;
  min-height: 26px;
  overflow-wrap: anywhere;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 240px) 44px;
  gap: 12px;
  align-items: end;
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
}

.status-filter {
  display: none;
}

.add-person-icon-button {
  align-self: end;
  width: 42px;
  height: 42px;
  color: #06211f;
  background: var(--accent);
  border-color: var(--accent);
}

.add-person-icon-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.plus-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message {
  min-height: 22px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 14px;
}

.message.error {
  color: var(--danger);
}

.people-list {
  display: grid;
  gap: 12px;
}

.person {
  position: relative;
  background: rgba(24, 27, 32, 0.92);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.person:hover {
  background: rgba(31, 36, 42, 0.94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.status-accent-open {
  border-left-color: var(--open);
}

.status-accent-waiting {
  border-left-color: var(--waiting);
}

.status-accent-unknown {
  border-left-color: var(--unknown);
}

.status-accent-finished {
  border-left-color: var(--finished);
}

.status-accent-closed {
  border-left-color: var(--closed);
}

.status-accent-active {
  border-left-color: #60a5fa;
}

.status-accent-kyc {
  border-left-color: #c084fc;
}

.status-accent-restricted {
  border-left-color: var(--restricted);
}

.person-summary {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 11px 13px;
  text-align: left;
}

.person-summary:hover {
  background: rgba(45, 212, 191, 0.045);
}

.person-name {
  margin: 0 0 3px;
  font-size: 16px;
  line-height: 1.25;
}

.person-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.summary-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.bookie-count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(72, 81, 90, 0.72);
  border-radius: 999px;
  background: rgba(18, 21, 25, 0.78);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 8px;
  white-space: nowrap;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.person.expanded .chevron {
  transform: rotate(225deg);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status-open,
.status-finished {
  color: var(--open);
  background: rgba(52, 211, 153, 0.12);
}

.status-closed {
  color: var(--closed);
  background: rgba(156, 163, 175, 0.12);
}

.status-waiting {
  color: var(--waiting);
  background: rgba(245, 158, 11, 0.13);
}

.status-active {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.14);
}

.status-kyc {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.14);
}

.status-restricted {
  color: var(--restricted);
  background: rgba(248, 113, 113, 0.14);
}

.status-empty {
  color: var(--closed);
  background: rgba(156, 163, 175, 0.12);
}

.status-unknown {
  color: var(--unknown);
  background: rgba(192, 132, 252, 0.14);
}

.person-details {
  display: none;
  padding: 0 13px 13px;
}

.person.expanded .person-details {
  display: block;
  animation: reveal 150ms ease-out;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-section {
  border-top: 1px solid rgba(48, 55, 61, 0.74);
  padding-top: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-heading span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.section-heading::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(48, 55, 61, 0.72);
}

.bookie-heading {
  margin-top: 18px;
}

.add-bookie-button {
  min-height: 30px;
  border: 1px solid rgba(72, 81, 90, 0.62);
  border-radius: 8px;
  background: rgba(18, 21, 25, 0.82);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.add-bookie-button:hover {
  background: var(--accent-soft);
  border-color: rgba(45, 212, 191, 0.55);
  transform: translateY(-1px);
}

.add-bookie-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 160px) minmax(130px, 170px);
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(72, 81, 90, 0.6);
  border-radius: 8px;
  background: rgba(18, 21, 25, 0.82);
}

.add-bookie-form textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--panel);
  outline: none;
}

.add-bookie-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.add-bookie-notes,
.add-bookie-actions {
  grid-column: 1 / -1;
}

.add-bookie-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(48, 55, 61, 0.55);
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.person-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: rgba(18, 21, 25, 0.82);
  border: 1px solid rgba(72, 81, 90, 0.6);
  border-radius: 8px;
}

.person-edit-grid label.wide,
.person-edit-actions {
  grid-column: 1 / -1;
}

.person-edit-grid textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--panel);
  outline: none;
}

.person-edit-grid textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.person-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(48, 55, 61, 0.55);
}

.password-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.password-input-row input {
  min-width: 0;
}

.field {
  min-width: 0;
  padding: 9px 10px;
  background: linear-gradient(180deg, rgba(18, 21, 25, 0.98), rgba(24, 27, 32, 0.98));
  border: 1px solid rgba(72, 81, 90, 0.62);
  border-radius: 8px;
}

.field:hover {
  border-color: var(--line-strong);
}

.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: none;
}

.field-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.field-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  margin-top: 5px;
}

.copy-button {
  flex: 0 0 auto;
  width: 30px;
  height: 28px;
  border: 1px solid rgba(72, 81, 90, 0.62);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.9);
  color: var(--accent-dark);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.copy-button:hover {
  background: var(--accent-soft);
  border-color: rgba(45, 212, 191, 0.55);
  transform: translateY(-1px);
}

.copy-button.copied {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.7);
  color: var(--open);
  transform: scale(1.04);
}

.copy-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bookie-table {
  display: grid;
  gap: 7px;
}

.bookie {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(72, 81, 90, 0.58);
  border-radius: 8px;
  background: rgba(18, 21, 25, 0.72);
}

.bookie-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bookie-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.bookie-name-line strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.bookie-warning {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(251, 113, 133, 0.55);
  border-radius: 999px;
  background: rgba(251, 113, 133, 0.12);
  color: var(--danger);
  font-size: 11px;
  font-weight: 850;
  padding: 3px 8px;
  white-space: nowrap;
}

.bookie-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.bookie-created-field {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.bookie-created-field input {
  width: 118px;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
  text-transform: none;
}

.status-editor {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.status-editor select {
  min-width: 92px;
}

.bookie-notes-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.bookie-notes-side {
  display: inline-flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 8px;
  margin-left: auto;
}

.bookie-notes-main {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 8px;
  min-width: 0;
}

.bookie-notes {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.note-editor {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 9px;
}

.note-editor textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--panel);
  outline: none;
}

.note-editor textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.note-button {
  min-height: 32px;
  border: 1px solid rgba(72, 81, 90, 0.62);
  border-radius: 8px;
  background: rgba(18, 21, 25, 0.92);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.note-button:hover {
  background: var(--panel-soft);
  border-color: rgba(72, 81, 90, 0.9);
}

.note-button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06211f;
}

.note-button.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.note-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.icon-button {
  width: 32px;
  height: 30px;
  border: 1px solid rgba(72, 81, 90, 0.62);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.9);
  color: var(--accent-dark);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.icon-button:hover {
  background: var(--accent-soft);
  border-color: rgba(45, 212, 191, 0.55);
  transform: translateY(-1px);
}

.icon-button.danger-button {
  color: var(--danger);
}

.icon-button.danger-button:hover {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.55);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.pencil-icon,
.archive-icon,
.search-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trash-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-generate-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty {
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(96, 165, 250, 0.07), transparent),
    var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  text-align: center;
}

.empty p {
  color: var(--muted);
}

.skeleton-card {
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.025), transparent 45%),
    rgba(24, 27, 32, 0.9);
  border-left-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.skeleton-card:hover {
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.025), transparent 45%),
    rgba(24, 27, 32, 0.9);
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.skeleton-line,
.skeleton-chip {
  display: block;
  background: linear-gradient(90deg, rgba(26, 31, 36, 0.92) 0%, rgba(45, 52, 59, 0.94) 50%, rgba(26, 31, 36, 0.92) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.15s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-line.title {
  width: min(240px, 58%);
  height: 16px;
  margin-bottom: 9px;
}

.skeleton-line.short {
  width: min(190px, 45%);
  height: 12px;
}

.skeleton-chip-row {
  display: flex;
  gap: 8px;
}

.skeleton-chip {
  width: 68px;
  height: 23px;
  border-radius: 999px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

body[data-density="compact"] .shell {
  width: min(1280px, calc(100% - 24px));
}

body[data-density="compact"] .people-list {
  gap: 8px;
}

body[data-density="compact"] .person-summary {
  padding: 12px 14px;
}

body[data-density="compact"] .person-name {
  font-size: 16px;
}

body[data-density="compact"] .person-details {
  padding: 0 14px 14px;
}

body[data-density="compact"] .field,
body[data-density="compact"] .bookie {
  padding: 8px 9px;
}

body[data-density="compact"] .bookie-lookup,
body[data-density="compact"] .flutters-section,
body[data-density="compact"] .people-section {
  padding: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .session {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .auth-panel,
  .lookup-controls,
  .flutters-body,
  .toolbar,
  .person-summary {
    grid-template-columns: 1fr;
  }

  .header-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    min-height: 56px;
    padding: 10px 8px;
    text-align: center;
  }

  .stat-card span {
    margin-bottom: 4px;
    font-size: 20px;
  }

  .stat-card strong {
    font-size: 10px;
    line-height: 1.15;
  }

  .person-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .person-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-meta,
  .status-strip {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .auth-panel {
    padding: 18px;
  }

  .app-header {
    padding: 12px;
  }

  .topbar {
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .lookup-heading {
    flex-direction: column;
    gap: 8px;
  }

  .lookup-heading strong {
    align-self: flex-start;
  }

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

  .person-edit-grid {
    grid-template-columns: 1fr;
  }

  .bookie-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .add-bookie-form {
    grid-template-columns: 1fr;
  }

  .status-editor {
    justify-content: flex-start;
  }

  .bookie-controls {
    justify-content: flex-start;
  }

  .bookie-notes-row {
    align-items: flex-start;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  .header-stats {
    grid-template-columns: repeat(5, minmax(52px, 1fr));
    gap: 6px;
  }

  .stat-card {
    min-height: 50px;
    padding: 8px 5px;
  }

  .stat-card span {
    font-size: 18px;
  }

  .stat-card strong {
    font-size: 9px;
  }

  .lookup-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lookup-table {
    min-width: 760px;
  }

  .flutter-table {
    min-width: 820px;
  }
}
