:root {
  --bg: #f4f6f8;
  --paper: rgba(255, 255, 255, 0.84);
  --paper-strong: rgba(255, 255, 255, 0.97);
  --ink: #172033;
  --muted: #6b7280;
  --line: rgba(23, 32, 51, 0.1);
  --brand: #0f766e;
  --brand-deep: #115e59;
  --sun: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.09);
}

* {
  box-sizing: border-box;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(15, 118, 110, 0.18),
      transparent 28%
    ),
    radial-gradient(
      circle at top right,
      rgba(245, 158, 11, 0.18),
      transparent 22%
    ),
    linear-gradient(180deg, #f8fafb 0%, #eef4f2 100%);
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(34px);
  pointer-events: none;
  opacity: 0.5;
}

.ambient-one {
  width: 220px;
  height: 220px;
  top: 90px;
  right: -40px;
  background: rgba(15, 118, 110, 0.14);
}

.ambient-two {
  width: 260px;
  height: 260px;
  bottom: 18px;
  left: -70px;
  background: rgba(245, 158, 11, 0.12);
}

.app-container {
  width: min(1120px, calc(100% - 24px));
}

.app-nav {
  padding: 14px 0;
  background: linear-gradient(
    135deg,
    rgba(23, 32, 51, 0.94),
    rgba(17, 94, 89, 0.94)
  );
  box-shadow: 0 10px 38px rgba(15, 23, 42, 0.12);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

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

.brand-lockup small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 500;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-family: "Fraunces", serif;
  font-size: 1.45rem;
}

.nav-actions {
  flex-wrap: wrap;
}

.operator-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.9rem;
}

.main-shell {
  padding: 18px 0 calc(88px + env(safe-area-inset-bottom));
}

.hero-card,
.content-panel,
.detail-hero,
.login-panel {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: var(--paper);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card,
.content-panel,
.detail-hero {
  padding: 22px;
}

.dashboard-hero {
  padding: 18px;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 420px);
  overflow: hidden;
}

.login-copy {
  padding: 34px;
  background:
    radial-gradient(
      circle at top left,
      rgba(245, 158, 11, 0.2),
      transparent 28%
    ),
    linear-gradient(135deg, rgba(15, 118, 110, 0.98), rgba(17, 24, 39, 0.95));
  color: #f8fafc;
}

.login-card {
  padding: 30px;
  background: var(--paper-strong);
}

.hero-copy h1,
.login-copy h1,
.detail-topbar h1 {
  margin: 14px 0 14px;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.hero-copy p,
.detail-topbar p,
.section-subtitle {
  color: var(--muted);
  line-height: 1.7;
}

.login-copy p {
  color: rgba(248, 250, 252, 0.78);
  line-height: 1.75;
}

.eyebrow-tag,
.spotlight-label,
.status-pill,
.summary-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
}

.eyebrow-tag {
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.eyebrow-dark {
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand-deep);
}

.phone-preview {
  margin-top: 28px;
  max-width: 240px;
  padding: 12px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
}

.phone-screen {
  padding: 20px;
  border-radius: 22px;
  background: rgba(17, 24, 39, 0.58);
}

.phone-screen span,
.phone-screen p {
  color: rgba(248, 250, 252, 0.78);
}

.phone-screen strong {
  display: block;
  margin: 8px 0;
  font-size: 1.2rem;
}

.summary-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(138px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.summary-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  min-height: 94px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 8px;
}

.summary-card strong {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  line-height: 1.08;
}

.dashboard-panels {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.today-panel,
.queue-panel {
  padding: 14px;
  border-radius: 20px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.hero-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.hero-date {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.today-list,
.queue-list {
  display: grid;
  gap: 10px;
}

.today-item,
.queue-card {
  display: grid;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.08),
    rgba(245, 158, 11, 0.08)
  );
  border: 1px solid rgba(15, 118, 110, 0.08);
}

.today-item {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.today-item-main strong,
.queue-body strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.2;
}

.today-item-main span,
.queue-body span {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}

.today-item b,
.queue-card b {
  font-size: 0.96rem;
  color: var(--brand-deep);
}

.today-empty {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.92rem;
}

.queue-card {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.queue-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(23, 32, 51, 0.08);
  font-weight: 800;
}

.section-top,
.customer-card-top,
.detail-topbar,
.payout-mobile-top,
.investment-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.section-top,
.detail-topbar {
  align-items: start;
}

.search-shell {
  margin: 18px 0 20px;
}

.customer-card {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: 24px;
  padding: 15px;
  background: var(--paper-strong);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.customer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.customer-name {
  display: block;
  font-size: 0.96rem;
  font-weight: 800;
}

.customer-date {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.status-pill {
  padding: 7px 11px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.status-overdue {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.status-today {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.status-upcoming {
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand-deep);
}

.status-neutral {
  background: rgba(107, 114, 128, 0.12);
  color: var(--muted);
}

.customer-stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.customer-stats-row > div {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.08),
    rgba(245, 158, 11, 0.08)
  );
}

.compact-bottom-row > div {
  background: rgba(23, 32, 51, 0.04);
}

.customer-stats-row span,
.meta-grid span,
.investment-mini-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 5px;
}

.customer-stats-row strong,
.meta-grid strong,
.investment-mini-grid strong {
  font-size: 0.9rem;
}

.meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.meta-grid > div {
  flex: 1 1 calc(50% - 12px);
  min-width: 112px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.empty-state,
.empty-inline {
  padding: 28px 22px;
  border-radius: 22px;
  text-align: center;
  border: 1px dashed rgba(107, 114, 128, 0.32);
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
}

.customer-card-wrap.is-hidden {
  display: none;
}

.back-link {
  color: var(--brand-deep);
  font-weight: 700;
  text-decoration: none;
}

.detail-summary {
  margin-top: 20px;
}

.detail-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.investment-history-list {
  display: grid;
  gap: 16px;
}

.investment-block {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.investment-block-head h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
}

.investment-block-head p {
  color: var(--muted);
}

.investment-mini-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 1fr);
  gap: 8px;
  margin: 14px 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.investment-mini-grid > div {
  padding: 10px;
  border-radius: 14px;
  background: rgba(23, 32, 51, 0.04);
}

.table-shell {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.payout-table thead th {
  border: 0;
  padding: 16px 18px;
  background: rgba(23, 32, 51, 0.95);
  color: #fff;
}

.payout-table tbody td {
  padding: 16px 18px;
  border-color: rgba(23, 32, 51, 0.07);
}

.mobile-payout-list {
  display: grid;
  gap: 14px;
}

.payout-mobile-card {
  padding: 18px;
  border-radius: 22px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.payout-mobile-top strong {
  font-size: 1.15rem;
}

.payout-mobile-top span,
.payout-mobile-card small {
  color: var(--muted);
}

.app-modal {
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  background: rgba(248, 250, 252, 0.97);
  box-shadow: var(--shadow);
}

.modal-subtitle {
  color: var(--muted);
}

.modal-footer-stack {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.app-alert {
  border: 0;
  border-radius: 18px;
}

.desktop-add-btn {
  display: none;
}

.mobile-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1040;
  border-radius: 999px;
  padding: 14px 18px;
  box-shadow: 0 18px 36px rgba(15, 118, 110, 0.28);
}

.mobile-action-bar {
  display: none;
}

@media (min-width: 768px) {
  .dashboard-panels {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .summary-scroll {
    grid-auto-flow: initial;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .desktop-add-btn {
    display: inline-flex;
  }

  .mobile-fab {
    display: none;
  }
}

@media (min-width: 992px) {
  .hero-card,
  .content-panel,
  .detail-hero {
    padding: 28px;
  }

  .login-copy,
  .login-card {
    padding: 40px;
  }

  .summary-scroll {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .dashboard-hero {
    padding: 22px;
  }
}

@media (max-width: 991.98px) {
  .login-panel {
    grid-template-columns: 1fr;
  }

  .detail-topbar,
  .section-top {
    flex-direction: column;
  }

  .nav-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 767.98px) {
  .app-container {
    width: min(100%, calc(100% - 16px));
  }

  .main-shell {
    padding-top: 14px;
  }

  .hero-card,
  .content-panel,
  .detail-hero,
  .login-copy,
  .login-card {
    padding: 18px;
  }

  .dashboard-hero {
    padding: 14px;
  }

  .detail-action-group {
    display: none;
  }

  .today-panel,
  .queue-panel {
    padding: 12px;
    border-radius: 18px;
  }

  .today-item,
  .queue-card {
    padding: 12px;
    border-radius: 14px;
  }

  .summary-card {
    min-height: 84px;
  }

  .summary-card strong {
    font-size: 1.05rem;
  }

  .customer-card {
    padding: 13px;
  }

  .customer-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .customer-stats-row > div {
    padding: 10px;
  }

  .meta-grid > div {
    flex-basis: 100%;
  }

  .investment-block {
    padding: 14px;
    border-radius: 18px;
  }

  .investment-mini-grid {
    grid-auto-columns: minmax(104px, 1fr);
    gap: 7px;
    margin: 12px 0;
  }

  .investment-mini-grid > div {
    padding: 9px;
  }

  .investment-mini-grid span {
    font-size: 0.7rem;
  }

  .investment-mini-grid strong {
    font-size: 0.82rem;
  }

  .investment-block-head {
    flex-direction: column;
    align-items: start;
  }

  .mobile-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(23, 32, 51, 0.08);
  }

  .mobile-action-bar .btn {
    min-height: 48px;
    border-radius: 14px;
  }

  .modal-footer-stack {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .modal-footer-stack .btn {
    width: 100%;
  }
}

/* Login Page Styles */
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 24px 0;
  /* background:
    radial-gradient(
      circle at 20% 50%,
      rgba(15, 118, 110, 0.15),
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(245, 158, 11, 0.12),
      transparent 50%
    ),
    linear-gradient(135deg, #f8fafb 0%, #eef4f2 100%); */
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
  padding: 32px 28px;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.12),
    rgba(245, 158, 11, 0.12)
  );
  font-size: 32px;
  margin-bottom: 16px;
}

.login-header h1 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.login-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

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

.form-group {
  display: grid;
  gap: 10px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

.label-icon {
  font-size: 18px;
}

.form-input-wrapper {
  position: relative;
}

.form-input-wrapper input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(23, 32, 51, 0.08);
  border-radius: 14px;
  font-size: 16px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  transition: all 0.2s ease;
}

.form-input-wrapper input:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.form-input-wrapper input::placeholder {
  color: var(--muted);
}

.invalid-feedback {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.error-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.24);
  min-height: 52px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.32);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.btn-login:hover .btn-icon {
  transform: translateX(4px);
}

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(23, 32, 51, 0.08);
  text-align: center;
}

.login-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Mobile Login Page */
@media (max-width: 767.98px) {
  .login-shell {
    min-height: 50vh;
    padding: 20px 0;
  }

  .login-container {
    max-width: 100%;
    padding: 16px;
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .login-header {
    margin-bottom: 28px;
  }

  .login-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
    margin-bottom: 12px;
  }

  .login-header h1 {
    font-size: 24px;
    margin-bottom: 6px;
  }

  .login-subtitle {
    font-size: 14px;
  }

  .login-form {
    gap: 18px;
  }

  .form-label {
    font-size: 13px;
  }

  .form-input-wrapper input {
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 12px;
  }

  .btn-login {
    padding: 14px 20px;
    font-size: 15px;
    min-height: 48px;
    border-radius: 12px;
  }

  .login-footer {
    margin-top: 20px;
    padding-top: 16px;
  }

  .login-footer p {
    font-size: 12px;
  }
}

/* Tablet Login Page */
@media (min-width: 768px) and (max-width: 991.98px) {
  .login-shell {
    padding: 30px 0;
  }

  .login-container {
    max-width: 450px;
    padding: 20px;
  }

  .login-card {
    padding: 30px 26px;
  }
}
