* {
  box-sizing: border-box;
}

:root {
  --bg: #f7f7f2;
  --surface: #ffffff;
  --surface-soft: #f3f5f0;
  --surface-warm: #fff7df;
  --surface-jade: #eaf8f1;
  --text: #17211b;
  --muted: #6f7b74;
  --border: #e3e8e4;

  --primary: #17211b;
  --jade: #1f9d72;
  --jade-dark: #15795a;
  --jade-soft: #e7f7ef;

  --amber: #d99a22;
  --amber-soft: #fff3d7;

  --danger: #c85a5a;
  --danger-soft: #fdecec;

  --shadow-sm: 0 8px 24px rgba(23, 33, 27, 0.06);
  --shadow-md: 0 16px 40px rgba(23, 33, 27, 0.10);
  --shadow-lg: 0 24px 60px rgba(23, 33, 27, 0.14);

  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(31, 157, 114, 0.09), transparent 26%),
    linear-gradient(180deg, #fafaf6 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 100px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px 20px;
  background: rgba(250, 250, 246, 0.90);
  border-bottom: 1px solid rgba(227, 232, 228, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-kicker {
  color: var(--jade-dark);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-block h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.profile-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--jade), var(--jade-dark));
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(31, 157, 114, 0.24);
  cursor: pointer;
}

.main-content {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 30px 18px 42px;
}

.welcome-section {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  padding: 26px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,0.14), transparent 30%),
    linear-gradient(145deg, #1b2b23 0%, #17211b 50%, #214d3d 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.welcome-section::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -65px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(31, 157, 114, 0.16);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-section .eyebrow {
  color: rgba(255, 255, 255, 0.62);
}

.welcome-section h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 480px;
  font-size: clamp(1.8rem, 5vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.status-pill {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
}

.status-ok {
  background: rgba(255, 255, 255, 0.12);
  color: #d9ffed;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #50d69e;
  box-shadow: 0 0 0 5px rgba(80, 214, 158, 0.10);
}

.summary-section,
.alerts-section,
.assistant-section,
.daily-close-section {
  margin-top: 30px;
}

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

.section-heading h3 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.04em;
}

.text-button {
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--jade-dark);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

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

.summary-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 148px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.summary-card:nth-child(1) {
  background: var(--jade-soft);
  border-color: #d8eee3;
}

.summary-card:nth-child(2) {
  background: #fff;
}

.summary-card:nth-child(4) {
  background: var(--amber-soft);
  border-color: #f1dfb2;
}

.summary-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-value {
  margin-top: 9px;
  font-size: clamp(1.45rem, 5vw, 1.95rem);
  letter-spacing: -0.06em;
}

.summary-detail {
  margin-top: auto;
  padding-top: 15px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.positive {
  color: var(--jade-dark);
  font-weight: 800;
}

.warning-text {
  color: #a16b12;
  font-weight: 800;
}

.featured-card {
  grid-column: span 2;
  min-height: 165px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,0.12), transparent 30%),
    linear-gradient(145deg, var(--jade-dark), var(--jade)) !important;
  color: #fff;
  border-color: transparent !important;
  box-shadow: 0 18px 36px rgba(31, 157, 114, 0.20);
}

.featured-card .summary-label,
.featured-card .summary-detail {
  color: rgba(255, 255, 255, 0.72);
}

.featured-card .summary-value {
  font-size: clamp(2rem, 7vw, 2.7rem);
}

.quick-register-section {
  margin-top: 18px;
}

.primary-register-button {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #1a2a22, #17211b);
  color: #fff;
  text-align: left;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-register-button:hover {
  box-shadow: var(--shadow-lg);
}

.primary-register-button:active {
  transform: scale(0.985);
}

.register-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--jade);
  color: #fff;
  font-size: 1.65rem;
  box-shadow: 0 8px 20px rgba(31, 157, 114, 0.22);
}

.register-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.register-copy strong {
  font-size: 1rem;
}

.register-copy small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.71rem;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(23, 33, 27, 0.035);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.alert-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.alert-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--surface-soft);
  font-size: 1.15rem;
}

.alert-card:nth-child(1) .alert-icon {
  background: var(--jade-soft);
}

.alert-card:nth-child(2) .alert-icon {
  background: #eef1ff;
}

.alert-card:nth-child(3) .alert-icon {
  background: var(--amber-soft);
}

.alert-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.alert-copy strong {
  font-size: 0.83rem;
  line-height: 1.3;
}

.alert-copy span {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.arrow {
  color: #a8b0aa;
  font-size: 1.5rem;
  font-weight: 300;
}

.assistant-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, #eefaf4 0%, #ffffff 70%);
  border: 1px solid #d9ece1;
  box-shadow: var(--shadow-sm);
}

.assistant-card::after {
  content: "✦";
  position: absolute;
  right: 24px;
  top: 18px;
  color: rgba(31, 157, 114, 0.14);
  font-size: 4rem;
  line-height: 1;
}

.assistant-copy {
  position: relative;
  z-index: 1;
}

.assistant-copy h3 {
  margin: 8px 0 7px;
  font-size: 1.12rem;
  letter-spacing: -0.04em;
}

.assistant-copy p {
  margin: 0;
  max-width: 410px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.assistant-badge {
  display: inline-block;
  color: var(--jade-dark);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.assistant-button,
.secondary-button {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.74rem;
  font-weight: 800;
}

.assistant-button:disabled {
  color: #9ca59f;
  cursor: not-allowed;
}

.daily-close-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-warm);
  border: 1px solid #f0dfb8;
  box-shadow: var(--shadow-sm);
}

.daily-close-card h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  letter-spacing: -0.04em;
}

.daily-close-card p:not(.eyebrow) {
  margin: 0;
  max-width: 440px;
  color: #7f6f4f;
  font-size: 0.75rem;
  line-height: 1.55;
}

.daily-close-card .eyebrow {
  color: #a16b12;
}

.secondary-button {
  border-color: #e7c879;
  background: #fffdf7;
  color: #8c6118;
  cursor: pointer;
  white-space: nowrap;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  width: min(100%, 760px);
  min-height: 76px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 34px rgba(23, 33, 27, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #99a39d;
  font-size: 0.61rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.nav-item.active {
  color: var(--jade-dark);
}

.nav-main-action {
  justify-self: center;
  width: 56px;
  height: 56px;
  min-height: 56px;
  margin-top: -30px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--jade), var(--jade-dark));
  color: #fff;
  box-shadow: 0 12px 28px rgba(31, 157, 114, 0.28);
}

.nav-main-action span {
  font-size: 1.75rem;
  line-height: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 12px 0;
  background: rgba(23, 33, 27, 0.52);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.register-modal {
  width: min(100%, 620px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background: var(--surface);
  transform: translateY(30px);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .register-modal {
  transform: translateY(0);
}

.modal-handle {
  width: 42px;
  height: 5px;
  margin: 2px auto 20px;
  border-radius: 999px;
  background: #d4dbd6;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.48rem;
  letter-spacing: -0.05em;
}

.close-modal-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1.45rem;
  cursor: pointer;
}

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

.register-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.register-option:hover {
  transform: translateY(-1px);
  border-color: #c9d3cd;
}

.register-option-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface-soft);
  font-size: 1rem;
}

.register-option > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.register-option strong {
  font-size: 0.8rem;
}

.register-option small {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.35;
}

.highlight-option {
  background: linear-gradient(145deg, var(--jade-dark), var(--jade));
  color: #fff;
  border-color: transparent;
}

.highlight-option .register-option-icon {
  background: rgba(255, 255, 255, 0.14);
}

.highlight-option small {
  color: rgba(255, 255, 255, 0.70);
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 761px) {
  .topbar {
    padding-left: max(24px, calc((100vw - 760px) / 2 + 18px));
    padding-right: max(24px, calc((100vw - 760px) / 2 + 18px));
  }

  .main-content {
    padding-top: 40px;
  }

  .bottom-nav {
    bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
  }

  .app-shell {
    padding-bottom: 120px;
  }

  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }

  .register-modal {
    border-radius: 30px;
  }
}

@media (max-width: 560px) {
  .welcome-section {
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
  }

  .status-pill {
    align-self: flex-start;
  }

  .assistant-card,
  .daily-close-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .assistant-button,
  .secondary-button {
    width: 100%;
  }

  .register-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .main-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .summary-grid {
    gap: 9px;
  }

  .summary-card {
    min-height: 138px;
    padding: 15px;
  }

  .featured-card {
    min-height: 154px;
  }

  .summary-value {
    font-size: 1.35rem;
  }

  .featured-card .summary-value {
    font-size: 2rem;
  }

  .nav-item {
    font-size: 0.56rem;
  }
}


/* =========================
   QUICK SALE
   ========================= */
.sale-modal {
  width: min(100%, 520px);
}

.sale-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sale-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sale-field label {
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 800;
}

.sale-field small {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

.sale-amount-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 0 18px;
  border: 1px solid #cfe4d8;
  border-radius: 18px;
  background: var(--jade-soft);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.sale-amount-wrap:focus-within {
  border-color: var(--jade);
  box-shadow: 0 0 0 4px rgba(31, 157, 114, 0.10);
}

.sale-currency {
  color: var(--jade-dark);
  font-size: 1.35rem;
  font-weight: 800;
}

.sale-amount-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.sale-amount-input::placeholder {
  color: #9eb5a8;
}

.sale-description-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.sale-description-input:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 4px rgba(31, 157, 114, 0.08);
}

.sale-description-input::placeholder {
  color: #a5aea8;
}

.sale-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.sale-cancel-button,
.sale-save-button {
  min-height: 52px;
  border-radius: 15px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.sale-cancel-button {
  flex: 0 0 116px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.sale-save-button {
  flex: 1;
  border: 0;
  background: linear-gradient(145deg, var(--jade-dark), var(--jade));
  color: #fff;
  box-shadow: 0 12px 26px rgba(31, 157, 114, 0.22);
}

.sale-save-button:disabled {
  opacity: 0.42;
  box-shadow: none;
  cursor: not-allowed;
}

.sale-success {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #cfe8da;
  border-radius: 14px;
  background: var(--jade-soft);
  color: var(--jade-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.sale-success.show {
  display: flex;
}

@media (max-width: 560px) {
  .sale-actions {
    flex-direction: column-reverse;
  }

  .sale-cancel-button,
  .sale-save-button {
    width: 100%;
    flex: none;
  }
}
