:root {
  --bg: #f4efe2;
  --surface: rgba(255, 255, 255, 0.88);
  --ink: #16211b;
  --muted: #5a655f;
  --brand: #0f8f60;
  --brand-strong: #0b6f4a;
  --line: #d6ddcf;
  --good: #1f7a4e;
  --bad: #a02828;
  --shadow: 0 12px 30px rgba(14, 35, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #d6f2e5 0%, rgba(214, 242, 229, 0) 34%),
              radial-gradient(circle at 92% 0%, #f5d2a6 0%, rgba(245, 210, 166, 0) 32%),
              var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}

.bg-shape-a {
  width: 420px;
  height: 420px;
  background: #9ceec9;
  top: -130px;
  right: -130px;
}

.bg-shape-b {
  width: 360px;
  height: 360px;
  background: #ffd7a4;
  left: -120px;
  bottom: -130px;
}

.container {
  width: min(980px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
  position: relative;
  z-index: 1;
}

#panel-reports {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.hero {
  margin-bottom: 1.2rem;
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-strong);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

h1, h2 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.sub {
  margin-top: 0.5rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.34rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.badge-good {
  border-color: #1f7a4e;
  background: #edf7f1;
  color: #16593a;
}

.badge-warn {
  border-color: #a77c22;
  background: #fff8e7;
  color: #7c5b14;
}

.badge-bad {
  border-color: #a02828;
  background: #fdeaea;
  color: #7d1f1f;
}

.top-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.top-indicators .badge {
  margin-top: 0.8rem;
}

.auth-card {
  margin-bottom: 1rem;
}

.auth-form {
  grid-template-columns: 1.2fr 1fr auto;
  align-items: end;
}

.auth-actions {
  align-self: end;
}

.auth-badge {
  margin-top: 0;
}

.menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.menu-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  font-weight: 700;
}

.menu-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-color: transparent;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-top: 1rem;
  backdrop-filter: blur(6px);
}

.muted-list {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  letter-spacing: 0.02em;
}

.card p {
  margin-top: 0.4rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-head h2 {
  margin-bottom: 0.15rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.compact {
  grid-template-columns: 1fr auto;
  align-items: end;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.93rem;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.9);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 143, 96, 0.23);
  border-color: var(--brand);
}

.button-row {
  display: flex;
  gap: 0.65rem;
  align-items: end;
}

.secondary-btn {
  background: #eef3ef;
  color: var(--ink);
  border: 1px solid var(--line);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

.result {
  min-height: 1.25rem;
  font-size: 0.93rem;
  font-weight: 600;
}

.result.success {
  color: var(--good);
}

.result.error {
  color: var(--bad);
}

.data-list {
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.data-table thead {
  background: rgba(15, 143, 96, 0.08);
  border-bottom: 2px solid var(--line);
}

.data-table th {
  padding: 0.85rem 0.75rem;
  text-align: left;
  font-weight: 700;
  color: var(--ink);
  border-right: 1px solid var(--line);
}

.data-table th.sort-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table th.sort-th:hover {
  background: rgba(15, 143, 96, 0.14);
}

.data-table th.sort-active {
  color: var(--primary, #0f8f60);
}

.data-table th:last-child {
  border-right: none;
}

.data-table td {
  padding: 0.75rem;
  border-right: 1px solid var(--line);
  color: var(--ink);
}

.data-table td:last-child {
  border-right: none;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--line);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(15, 143, 96, 0.04);
}

.table-btn {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.table-btn:not(:last-child) {
  margin-right: 0.4rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: #edf7f1;
  color: var(--good);
}

.status-pill.inactive {
  background: #fbeaea;
  color: var(--bad);
}

.output-block {
  margin-top: 0.8rem;
  background: rgba(22, 33, 27, 0.92);
  color: #d9f4e6;
  border-radius: 12px;
  padding: 0.9rem;
  min-height: 110px;
  overflow: auto;
  font-size: 0.86rem;
  line-height: 1.45;
}

.kpi-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 0.85rem;
}

.kpi-label {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.kpi-value {
  margin: 0.28rem 0 0;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

.report-layout {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0.7rem;
}

.report-panel {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  padding: 0.8rem;
}

.report-panel h3 {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

.bar-chart {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.bar-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.bar-track {
  height: 11px;
  border-radius: 999px;
  background: #ecf1ee;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #0f8f60, #36c788);
}

.bar-fill.negative {
  background: linear-gradient(135deg, #b24646, #e57575);
}

.bar-value {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.status-mix {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.status-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  background: rgba(255, 255, 255, 0.78);
}

.status-tile .name {
  font-size: 0.77rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.status-tile .count {
  margin-top: 0.18rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 0.65rem;
}

.variance-chip {
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
}

.variance-chip.good {
  background: #edf7f1;
  color: #1f7a4e;
}

.variance-chip.risk {
  background: #fdeeee;
  color: #a02828;
}

tr.expandable {
  cursor: pointer;
}

tr.expandable:hover td {
  background: rgba(26, 53, 100, 0.06);
}

.expand-icon {
  font-size: 0.65rem;
  opacity: 0.55;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.cashier-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: #f4f7ff;
}

.cashier-detail-table th {
  background: #e8edf8;
  color: var(--brand-strong);
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  text-align: left;
  font-size: 0.78rem;
}

.cashier-detail-table td {
  padding: 0.4rem 0.8rem;
  border-bottom: 1px solid #dce3f0;
  color: var(--ink);
}

.cashier-detail-row:last-child td {
  border-bottom: none;
}

@media (max-width: 700px) {
  .auth-form {
    grid-template-columns: 1fr;
  }

  .menu {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-layout {
    grid-template-columns: 1fr;
  }

  .report-filter-grid {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 92px 1fr auto;
  }

  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .section-head,
  .button-row,
  .data-actions {
    flex-direction: column;
  }
}
