:root {
  --bg: #f5f4ef;
  --ink: #1c1d2f;
  --muted: #5b5f71;
  --surface: #ffffff;
  --accent: #e66a3d;
  --accent-dark: #c44f25;
  --soft: #ffe8dd;
  --ring: #2d9c8f;
}

/* Dark cinematic theme */
.theme-dark {
  --bg: linear-gradient(180deg,#0b0f17 0%, #071024 60%);
  --ink: #e6eef6;
  --muted: #99a6b8;
  --surface: rgba(12,18,28,0.65);
  --accent: #ff8a00;
  --accent-dark: #ff6b00;
  --soft: rgba(255,138,0,0.08);
  --ring: #76e0c9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Sora', sans-serif;
  background: radial-gradient(circle at top left, #fff0d7, transparent 35%),
    radial-gradient(circle at 85% 15%, #d6f2ea, transparent 30%),
    var(--bg);
  color: var(--ink);
}

h1,
h2,
h3 {
  font-family: 'Fraunces', serif;
  margin: 0 0 0.75rem;
}

main {
  width: min(1120px, 94%);
  margin: 1.5rem auto 3rem;
}

.hero-page {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.hero-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(28, 29, 47, 0.12);
  max-width: 740px;
  animation: rise 0.75s ease both;
}

.auth-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: stretch;
  padding: 2rem;
  min-height: calc(100vh - 3rem);
  overflow: hidden;
  background: radial-gradient(circle at top left, rgba(255, 160, 86, 0.16), transparent 30%),
    radial-gradient(circle at 90% 15%, rgba(120, 210, 190, 0.15), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(20px);
}

.auth-hero__copy {
  padding: 1rem;
}

.auth-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.auth-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 25px 65px rgba(16, 24, 40, 0.15);
  border-radius: 24px;
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 138, 0, 0.12), transparent 25%);
  pointer-events: none;
}

.auth-card--glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.auth-hero .eyebrow {
  color: var(--accent);
}

.auth-hero h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1.05;
}

.auth-hero .hero-copy {
  max-width: 680px;
}

.hero-actions {
  margin-top: 1.5rem;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  background: rgba(255, 255, 255, 0.98);
}

.auth-card .btn {
  width: 100%;
}

.auth-page {
  padding: 1rem 0;
}

@media (max-width: 940px) {
  .auth-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 1.2rem;
  }
}

.hero-copy {
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions,
.quick-links,
.toolbar,
.payment-actions,
.inline-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quick-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.panel {
  background: var(--surface);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(16, 17, 27, 0.08);
  margin-bottom: 1rem;
}

.owner-shell {
  width: min(1320px, 95%);
}

.owner-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.owner-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.owner-sidebar {
  position: sticky;
  top: 1rem;
  height: fit-content;
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.sidebar-link {
  justify-content: flex-start;
  width: 100%;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #f7f7fb;
  color: var(--ink);
}

.sidebar-link.active {
  background: linear-gradient(120deg, var(--accent), #f29e4c);
  color: white;
}

.owner-content {
  min-width: 0;
}

.dashboard-section {
  margin-bottom: 1rem;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.soft-panel {
  background: #fafafa;
  box-shadow: none;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.table-card {
  background: #fff;
  border: 1px solid #eef1f6;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 10px 22px rgba(16, 17, 27, 0.06);
}

.table-card--available {
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  border-color: #e8edf5;
}

.table-card--active {
  background: linear-gradient(90deg, rgba(255,180,120,0.08), rgba(255,120,20,0.04));
  border-color: rgba(255,150,50,0.18);
  box-shadow: 0 10px 30px rgba(255,140,20,0.06), 0 0 24px rgba(255,140,20,0.04) inset;
}

.table-card--paid {
  background: linear-gradient(90deg, rgba(120,240,160,0.04), rgba(80,200,120,0.04));
  border-color: rgba(100,200,140,0.12);
  box-shadow: 0 10px 30px rgba(60,210,120,0.06), 0 0 18px rgba(60,210,120,0.04) inset;
}

.table-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: #f5f6fa;
  color: var(--ink);
  font-weight: 700;
}

.table-card__badge--available {
  background: #eef2f8;
  color: #47546a;
}

.table-card__badge--active {
  background: rgba(255, 140, 20, 0.14);
  color: #b55100;
}

.table-card__badge--paid {
  background: rgba(50, 185, 110, 0.14);
  color: #1f7a46;
}

.table-card__qr {
  width: 100%;
  max-width: 170px;
  display: block;
  margin: 0.9rem auto 0;
  border-radius: 12px;
  background: #fff;
}

.table-card__meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.55rem;
}

.table-card .toolbar {
  margin-top: 0.8rem;
}

.table-card .btn {
  flex: 1 1 auto;
}

.analytics-item {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #eceef3;
}

.auth-page,
.dashboard-layout,
.customer-layout {
  animation: fadeIn 0.55s ease both;
}

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

.auth-hero .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge--success {
  background: rgba(16, 185, 129, 0.16);
  color: #0f766e;
}

.badge--soft {
  background: rgba(255, 138, 0, 0.14);
  color: #c2410c;
}

.badge--premium {
  background: rgba(96, 165, 250, 0.16);
  color: #2563eb;
}
  margin-bottom: 1rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}

.customer-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.sticky-cart {
  position: sticky;
  top: 1rem;
  height: fit-content;
}

.card {
  border: 1px solid #eceef3;
  border-radius: 12px;
  padding: 0.8rem;
  background: #fff;
}

.card p {
  margin: 0.3rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), #f29e4c);
  color: white;
}

.btn-dark {
  background: #1f2339;
  color: white;
}

.btn-light {
  background: var(--soft);
  color: #672a13;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.68rem 0.74rem;
  border-radius: 10px;
  border: 1px solid #dfe4ef;
  font-family: inherit;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ring);
}

.message {
  margin-top: 0.75rem;
  min-height: 1.25rem;
  color: #105f53;
  font-weight: 600;
}

.lock-warning {
  color: #9a1f1f;
}

.qr-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.total {
  font-weight: 600;
  font-size: 1.05rem;
}

.brand-footer {
  text-align: center;
  padding: 1.1rem 0 1.7rem;
  color: #4c4f64;
  font-size: 0.92rem;
}

.theme-dark .brand-footer {
  color: #7f98b0;
}

.table-card--active::after,
.table-card--paid::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
}

.table-card {
  position: relative;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.table-card:hover { transform: translateY(-6px); }

.ad-popup {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: white;
  border-radius: 14px;
  max-width: 320px;
  box-shadow: 0 20px 40px rgba(17, 21, 38, 0.18);
  overflow: hidden;
  animation: rise 0.35s ease;
}

.ad-popup img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.ad-popup h3 {
  font-size: 1rem;
  padding: 0.7rem;
}

.ad-card {
  background: linear-gradient(135deg, #fff8f0 0%, #fffbf7 100%) !important;
  border: 2px solid var(--accent) !important;
  box-shadow: 0 4px 12px rgba(230, 106, 61, 0.12) !important;
  transition: transform 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
}

.ad-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(230, 106, 61, 0.2) !important;
}

.ad-card h3 {
  font-size: 1rem;
  font-weight: 700;
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  cursor: pointer;
}

.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6,8,10,0.45);
  z-index: 9999;
  padding: 1rem;
}
.modal__panel {
  width: min(880px, 98%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 12px;
  padding: 1rem;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.modal__body {
  display: grid;
  gap: 0.9rem;
}
.modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.6rem;
}

.card-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.table-card--clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.table-card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(16, 17, 27, 0.1);
}

.table-card__pay-pill {
  display: inline-flex;
  margin-top: 0.45rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.table-card__pay-pill--cash {
  background: rgba(50, 120, 220, 0.14);
  color: #1f4f9c;
}

.table-card__pay-pill--upi {
  background: rgba(110, 70, 220, 0.14);
  color: #4f2ca8;
}

.table-card__pay-pill--bill {
  background: rgba(255, 140, 20, 0.14);
  color: #b55100;
}

.owner-payment-form {
  margin-bottom: 1rem;
}

body.bill-modal-open {
  overflow: hidden;
}

.bill-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 16, 28, 0.55);
  backdrop-filter: blur(4px);
}

.bill-modal.is-open {
  display: flex;
}

.bill-modal.hidden {
  display: none !important;
}

.bill-modal__sheet {
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px 22px 16px 16px;
  box-shadow: 0 24px 60px rgba(10, 14, 30, 0.22);
}

.bill-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.35rem 0.5rem;
  border-bottom: 1px solid #eef1f6;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

.bill-modal__close {
  flex-shrink: 0;
  min-width: 5.5rem;
}

.bill-modal__body {
  padding: 1rem 1.35rem 1.35rem;
}

.bill-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.bill-table th,
.bill-table td {
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid #eef1f6;
  text-align: left;
}

.bill-table tfoot td {
  border-bottom: 0;
  font-size: 1.05rem;
}

.bill-add-section,
.bill-pay-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #e5e9f0;
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.pay-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 1rem;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  color: #fff;
}

.pay-btn__icon {
  font-size: 1.35rem;
  font-weight: 700;
}

.pay-btn--cash {
  background: linear-gradient(135deg, #2f6fed, #1f4f9c);
}

.pay-btn--upi {
  background: linear-gradient(135deg, #6a4ce8, #4f2ca8);
}

.bill-upi-panel {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: #f7f8fc;
}

.upi-app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin: 0.65rem 0;
}

.upi-app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
}

.upi-app-btn--phonepe { background: #5f259f; }
.upi-app-btn--gpay { background: #1a73e8; }
.upi-app-btn--paytm { background: #00baf2; color: #003a4d; }

.btn.full { width: 100%; margin-top: 0.5rem; }

@media (max-width: 900px) {
  .owner-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .owner-topbar,
  .section-head {
    flex-direction: column;
  }

  .owner-sidebar {
    position: static;
  }

  .customer-layout {
    grid-template-columns: 1fr;
  }

  .sticky-cart {
    position: static;
  }

  .grid-2,
  .grid-3,
  .card-row {
    grid-template-columns: 1fr;
  }
}
