:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-soft: #eef5ef;
  --ink: #17211c;
  --muted: #65736c;
  --line: #d8e0d9;
  --green: #176d4a;
  --green-dark: #0e4d35;
  --gold: #c27d22;
  --red: #b84b46;
  --blue: #2f6f91;
  --shadow: 0 18px 48px rgba(21, 47, 35, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(23, 109, 74, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 109, 74, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.account-card span,
.eyebrow,
.form-note,
.meta,
.stat-label {
  color: var(--muted);
}

.account-card,
.panel,
.table-wrap,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-card {
  padding: 14px;
}

.account-card strong,
.account-card span {
  display: block;
}

.account-kicker {
  margin-bottom: 3px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a,
.role-button,
.secondary-action,
.icon-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.nav-list a {
  padding: 11px 12px;
}

.nav-list a.active {
  border-color: rgba(23, 109, 74, 0.35);
  background: var(--surface-soft);
  color: var(--green-dark);
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 22px;
  max-width: 1180px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.role-switcher {
  display: inline-flex;
  flex-shrink: 0;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.role-button {
  min-height: 38px;
  padding: 0 12px;
  box-shadow: none;
}

.role-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.view {
  max-width: 1180px;
  margin: 0 auto;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.intro-panel {
  min-height: 440px;
  padding: 34px;
  border-radius: 8px;
  background: #173c33;
  color: #fff;
  overflow: hidden;
}

.intro-panel p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.76);
}

.court-visual {
  position: relative;
  height: 220px;
  margin-bottom: 28px;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(255, 255, 255, 0.62) 50%, transparent 50.5%),
    linear-gradient(180deg, transparent 28%, rgba(255, 255, 255, 0.62) 28.4%, transparent 28.8%),
    linear-gradient(180deg, transparent 72%, rgba(255, 255, 255, 0.62) 72.4%, transparent 72.8%),
    #24745a;
}

.net {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 7px;
  height: 100%;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.85) 0 8px,
    rgba(255, 255, 255, 0.2) 8px 14px
  );
}

.shuttle {
  position: absolute;
  width: 38px;
  height: 52px;
  border-radius: 50% 50% 10px 10px;
  background:
    linear-gradient(135deg, transparent 0 36%, rgba(255, 255, 255, 0.94) 37% 44%, transparent 45%),
    linear-gradient(45deg, transparent 0 36%, rgba(255, 255, 255, 0.94) 37% 44%, transparent 45%),
    #e8efe9;
  transform: rotate(-22deg);
}

.shuttle::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 10px;
  width: 18px;
  height: 12px;
  border-radius: 3px;
  background: var(--gold);
}

.shuttle-one {
  top: 38px;
  right: 18%;
}

.shuttle-two {
  bottom: 34px;
  left: 16%;
  transform: rotate(25deg) scale(0.85);
}

.panel {
  padding: 20px;
}

.panel-heading,
.stock-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.stock-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stock-card:last-child {
  border-bottom: 0;
}

.stock-card > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.stock-image {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f2;
  color: var(--green-dark);
  font-weight: 900;
}

.stock-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-form {
  align-self: start;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8f5;
}

.auth-tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.active {
  border-color: var(--green);
  background: #fff;
  color: var(--green-dark);
}

.demo-credentials {
  display: grid;
  gap: 4px;
  margin: 16px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.9rem;
}

.demo-credentials strong {
  color: var(--green-dark);
}

.profile-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.profile-summary strong,
.profile-summary span,
.profile-summary a {
  display: block;
}

.profile-summary a {
  margin-top: 4px;
  color: var(--green-dark);
  font-weight: 800;
}

.grid {
  display: grid;
  gap: 18px;
}

.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat strong {
  display: block;
  font-size: 1.8rem;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #2b3931;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd7cf;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

input[type="file"] {
  min-height: auto;
  padding: 9px;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.checkbox-label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.picture-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.picture-picker legend {
  padding: 0 6px;
  color: #2b3931;
  font-weight: 800;
}

.picture-picker .meta {
  grid-column: 1 / -1;
  margin: 0;
}

.picture-choice {
  position: relative;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.picture-choice input {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.picture-choice:has(input:checked) {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(23, 109, 74, 0.15);
}

.picture-choice img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  background: #f4f6f2;
}

.picture-choice span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.primary-action,
.secondary-action,
.icon-action {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
}

.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.9rem;
}

.primary-action {
  border: 0;
  background: var(--green);
  color: #fff;
}

.primary-action:hover,
.role-button.active:hover {
  background: var(--green-dark);
}

.secondary-action:hover,
.icon-action:hover {
  border-color: var(--green);
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e6ece9;
  color: #34463c;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.ready,
.badge.completed {
  background: #e4f3e7;
  color: #185b34;
}

.badge.stringing,
.badge.received {
  background: #e3f0f5;
  color: #24576f;
}

.badge.cancelled,
.stock-low,
.expense {
  color: var(--red);
}

.badge.admin {
  background: #f5ebdb;
  color: #7a4b13;
}

.badge.customer {
  background: #e4f3e7;
  color: #185b34;
}

.income {
  color: var(--green-dark);
}

.stock-ok {
  color: var(--green);
}

.meta {
  margin: 0;
  font-size: 0.9rem;
}

.empty-state {
  padding: 24px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  background: #17211c;
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 880px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

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

  .workspace {
    padding: 18px 14px 28px;
  }

  .topbar,
  .split-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .role-switcher {
    width: 100%;
  }

  .role-button {
    flex: 1;
  }

  .stats,
  .three-col,
  .two-col,
  .form-row {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    min-height: auto;
    padding: 22px;
  }

  .court-visual {
    height: 170px;
  }
}

@media (max-width: 520px) {
  .brand {
    align-items: flex-start;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 11px;
  }
}
