:root {
  --ink: #20110b;
  --muted: #806554;
  --paper: #fff9ed;
  --cream: #f5dfbc;
  --coffee: #67351f;
  --espresso: #241009;
  --foam: #fff0cf;
  --accent: #df6f32;
  --accent-strong: #b94720;
  --sage: #62735a;
  --line: rgba(75, 40, 25, 0.16);
  --shadow: 0 28px 90px rgba(66, 32, 13, 0.2);
  --soft-shadow: 0 14px 40px rgba(66, 32, 13, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Avenir Next, Gill Sans, Trebuchet MS, sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(242, 174, 93, 0.34), transparent 26rem),
    radial-gradient(circle at 84% 4%, rgba(71, 35, 19, 0.24), transparent 23rem),
    radial-gradient(circle at 76% 74%, rgba(98, 115, 90, 0.2), transparent 28rem),
    linear-gradient(145deg, #fff8ec 0%, #f0d6ad 44%, #be845c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(36, 21, 15, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 21, 15, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

body::after {
  content: "";
  position: fixed;
  right: -140px;
  bottom: -180px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 32%, rgba(36, 16, 9, 0.1) 33% 34%, transparent 35%),
    radial-gradient(circle, rgba(255, 240, 207, 0.28), transparent 66%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  color: var(--foam);
  background: linear-gradient(135deg, var(--espresso), var(--coffee));
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(42, 18, 11, 0.22);
  filter: saturate(1.08);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 26px;
  align-items: stretch;
  margin-bottom: 20px;
  min-height: 430px;
}

.hero-content {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 234, 0.5);
  border-radius: 42px;
  padding: clamp(28px, 5vw, 54px);
  background:
    linear-gradient(120deg, rgba(255, 249, 237, 0.86), rgba(255, 240, 207, 0.58)),
    radial-gradient(circle at 82% 20%, rgba(223, 111, 50, 0.14), transparent 24rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-content::after {
  content: "";
  position: absolute;
  right: -62px;
  top: -82px;
  width: 240px;
  height: 240px;
  border: 26px solid rgba(103, 53, 31, 0.08);
  border-radius: 50%;
}

.status-pill {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 24px;
  border: 1px solid rgba(98, 115, 90, 0.22);
  border-radius: 999px;
  padding: 0.56rem 0.82rem;
  color: var(--sage);
  background: rgba(255, 255, 255, 0.46);
  font-size: 0.84rem;
  font-weight: 800;
}

.status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 6px rgba(98, 115, 90, 0.13);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: Songti SC, STSong, Georgia, serif;
  line-height: 1.05;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 790px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7.3rem);
  letter-spacing: -0.09em;
}

h2 {
  margin: 0;
  font-size: 2rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.quick-links a {
  border: 1px solid rgba(75, 40, 25, 0.14);
  border-radius: 999px;
  padding: 0.78rem 1rem;
  color: var(--espresso);
  background: rgba(255, 255, 255, 0.42);
  text-decoration: none;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease;
}

.quick-links a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.7);
}

.hero-card,
.panel,
.stat-card {
  border: 1px solid var(--line);
  background: rgba(255, 248, 234, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 240px;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 42px;
  padding: 32px;
  background:
    radial-gradient(circle at 52% 22%, rgba(255, 241, 211, 0.92) 0 15%, transparent 15.5%),
    radial-gradient(circle at 52% 22%, rgba(255, 241, 211, 0.18) 0 31%, transparent 31.5%),
    linear-gradient(160deg, rgba(103, 53, 31, 0.96), rgba(36, 16, 9, 0.98));
  color: var(--foam);
}

.hero-card::before {
  content: "";
  position: absolute;
  right: -82px;
  top: 88px;
  width: 180px;
  height: 132px;
  border: 24px solid rgba(255, 240, 207, 0.18);
  border-left-color: transparent;
  border-radius: 50%;
}

.steam {
  position: absolute;
  top: 38px;
  left: 50%;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

.steam i {
  display: block;
  width: 10px;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(to top, transparent, rgba(255, 240, 207, 0.72), transparent);
  animation: steam 2.9s ease-in-out infinite;
}

.steam i:nth-child(2) {
  animation-delay: 0.35s;
}

.steam i:nth-child(3) {
  animation-delay: 0.7s;
}

@keyframes steam {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(8px) scaleY(0.85);
  }

  50% {
    opacity: 0.88;
    transform: translateY(-8px) scaleY(1.08);
  }
}

.hero-card span,
.hero-card small {
  color: rgba(255, 241, 211, 0.78);
}

.hero-card strong {
  margin: 0.25rem 0;
  font-size: clamp(2.8rem, 6vw, 4.3rem);
  letter-spacing: -0.08em;
}

.panel,
.stat-card {
  border-radius: 30px;
  padding: 24px;
}

.input-panel {
  margin-bottom: 18px;
  box-shadow: var(--soft-shadow);
}

form {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: rgba(32, 17, 11, 0.72);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(75, 40, 25, 0.12);
  border-radius: 18px;
  padding: 0.92rem 0.95rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

input:focus,
select:focus {
  border-color: rgba(224, 109, 47, 0.72);
  box-shadow: 0 0 0 4px rgba(224, 109, 47, 0.12);
}

.wide {
  grid-column: span 2;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 154px;
  box-shadow: var(--soft-shadow);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(223, 111, 50, 0.12);
}

.bean-stat::after {
  background: rgba(98, 115, 90, 0.14);
}

.stat-card span,
.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 0.5rem 0;
  font-size: clamp(1.75rem, 4.4vw, 3.45rem);
  line-height: 1;
  letter-spacing: -0.08em;
}

.section-title {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title.compact {
  margin-bottom: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary {
  color: var(--espresso);
  background: linear-gradient(135deg, #f8e8ca, #e9c999);
}

.danger {
  color: #fff9ec;
  background: linear-gradient(135deg, #a13324, #711c14);
}

.table-wrap {
  border: 1px solid rgba(75, 40, 25, 0.1);
  border-radius: 22px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.34);
}

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

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

th {
  color: rgba(32, 17, 11, 0.62);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(245, 223, 188, 0.38);
}

td {
  color: var(--ink);
  background: rgba(255, 249, 237, 0.2);
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.42);
}

.delete-row {
  padding: 0.45rem 0.7rem;
  color: #9f2b1e;
  background: rgba(159, 43, 30, 0.1);
}

.empty-state {
  display: none;
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
}

.empty-state.is-visible {
  display: block;
}

@media (max-width: 1040px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-card {
    min-height: 260px;
  }

  form {
    grid-template-columns: repeat(2, 1fr);
  }

  .wide {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 14px 0 36px;
  }

  .hero-content,
  .hero-card,
  .panel,
  .stat-card {
    border-radius: 24px;
  }

  h1 {
    letter-spacing: -0.07em;
  }

  .quick-links a {
    width: 100%;
    text-align: center;
  }

  form {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

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