@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --forest: #050505;
  --forest-2: #1a1a1a;
  --lime: #eeeeee;
  --lime-dark: #c7c7c7;
  --cream: #ededed;
  --paper: #ffffff;
  --ink: #090909;
  --muted: #666666;
  --line: #d5d5d5;
  --danger: #b83d34;
  --success: #262626;
  --shadow: 0 20px 60px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: 'DM Sans', Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: 'Manrope', 'DM Sans', sans-serif; }

.eyebrow { color: #777; font-size: 11px; font-weight: 800; letter-spacing: .19em; margin: 0 0 10px; }
.eyebrow.light { color: #bdbdbd; }
.brand-logo { background: #000; border: 1px solid #333; border-radius: 10px; display: block; height: 56px; object-fit: cover; object-position: center; width: 100px; }
.auth-logo { background: #000; border-radius: 18px; display: block; height: 205px; margin: 0 auto 28px; object-fit: cover; object-position: center; width: min(100%, 320px); }

.auth-page { align-items: center; background: var(--forest); display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.auth-card { background: var(--paper); border-radius: 24px; box-shadow: 0 30px 90px rgba(0,0,0,.28); max-width: 460px; padding: 42px; width: 100%; }
.auth-card h1 { font-size: 34px; letter-spacing: -.04em; margin-bottom: 10px; }
.auth-card > p:not(.eyebrow):not(.helper) { color: var(--muted); line-height: 1.6; }
.auth-links { display: flex; font-weight: 700; justify-content: space-between; margin-top: 24px; }
.auth-links a, .text-link { color: #202020; text-decoration: underline; text-underline-offset: 3px; }
.text-link { display: inline-block; font-weight: 800; margin-top: 22px; }
.helper { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; margin: 24px 0 0; padding-top: 18px; }

.topbar { align-items: center; background: var(--forest); color: white; display: flex; justify-content: space-between; min-height: 70px; padding: 12px clamp(18px, 4vw, 52px); }
.brand { align-items: center; display: flex; font-family: 'Manrope', sans-serif; font-weight: 800; gap: 12px; }
.topbar nav { display: flex; font-size: 14px; font-weight: 700; gap: 12px; }
.topbar nav a { border-radius: 999px; padding: 10px 14px; }
.topbar nav a:hover { background: rgba(255,255,255,.1); }

.admin-shell { margin: 0 auto; max-width: 1320px; padding: 42px clamp(16px, 4vw, 52px) 70px; }
.admin-heading { align-items: end; display: flex; gap: 28px; justify-content: space-between; margin-bottom: 26px; }
.admin-heading h1 { font-size: clamp(32px, 5vw, 50px); letter-spacing: -.055em; margin-bottom: 8px; }
.admin-heading > div > p:last-child { color: var(--muted); margin-bottom: 0; }
.summary-card { background: var(--forest); border-radius: 18px; color: white; min-width: 260px; padding: 22px 26px; }
.summary-card span, .summary-card small { color: #b9b9b9; display: block; }
.summary-card span { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.summary-card strong { color: var(--lime); display: block; font-family: 'Manrope', sans-serif; font-size: 32px; letter-spacing: -.04em; margin: 5px 0; }
.summary-card small { font-size: 13px; }
.cash-admin-panel { align-items: stretch; display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }
.cash-admin-panel h2 { margin-bottom: 5px; }
.cash-admin-panel p:last-child { margin-bottom: 0; }
.cash-form { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(5, minmax(130px, 1fr)); width: 100%; }
.cash-form .cash-save { grid-column: 1 / -1; }
.cash-form input[readonly] { background: #e2e2e2; font-weight: 800; }

.admin-grid { align-items: start; display: grid; gap: 24px; grid-template-columns: minmax(300px, .72fr) minmax(480px, 1.28fr); }
.panel { background: var(--paper); border: 1px solid rgba(0,0,0,.08); border-radius: 20px; box-shadow: var(--shadow); padding: 26px; }
.panel h2 { font-size: 23px; letter-spacing: -.03em; }
.form-panel { position: sticky; top: 20px; }
.form-stack { display: grid; gap: 17px; }
label { color: #4e5b52; display: grid; font-size: 13px; font-weight: 700; gap: 7px; }
.optional { color: #98a099; font-size: 11px; font-weight: 500; }
input, textarea, select { background: #fafafa; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); min-height: 48px; outline: none; padding: 12px 14px; resize: vertical; width: 100%; }
textarea { min-height: 86px; }
input:focus, textarea:focus, select:focus { border-color: #555; box-shadow: 0 0 0 4px rgba(0,0,0,.10); }
input[readonly] { color: #8b948e; cursor: not-allowed; }
.button-row { display: flex; gap: 10px; }
.quantity-fields { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.button { align-items: center; border: 1px solid transparent; border-radius: 999px; cursor: pointer; display: inline-flex; font-weight: 800; justify-content: center; min-height: 46px; padding: 11px 19px; }
.button.primary { background: var(--forest); color: white; }
.button.primary:hover { background: var(--forest-2); }
.button.ghost { background: #ededed; border-color: #d8d8d8; }
.button.wide { width: 100%; }
.notice { border-radius: 12px; margin-bottom: 18px; padding: 13px 16px; }
.notice.success { background: #e8e8e8; color: #161616; }
.notice.error { background: #fae7e3; color: #913028; }

.panel-title { align-items: center; display: flex; justify-content: space-between; }
.product-search { margin: 4px 0 16px; }
.product-search input { background: #f2f2f2; padding-left: 16px; }
.admin-product[hidden],
.search-empty[hidden] { display: none; }
.count-pill { align-items: center; background: var(--lime); border-radius: 999px; display: flex; font-weight: 800; height: 36px; justify-content: center; min-width: 36px; padding: 0 12px; }
.product-admin-list { display: grid; gap: 4px; }
.admin-product { align-items: center; border-top: 1px solid #e8e6df; display: grid; gap: 13px; grid-template-columns: 42px minmax(0,1fr) auto auto; padding: 15px 2px; transition: opacity .2s; }
.admin-product.is-hidden { opacity: .43; }
.reference { align-items: center; background: #ededed; border-radius: 9px; color: #666; display: flex; font-size: 11px; font-weight: 800; height: 38px; justify-content: center; }
.admin-product-main { min-width: 0; }
.admin-product-main strong, .admin-product-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-product-main span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.admin-price { font-family: 'Manrope', sans-serif; font-weight: 800; white-space: nowrap; }
.admin-price small { color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 11px; }
.row-actions { display: flex; gap: 5px; }
.row-actions form { margin: 0; }
.icon-button { align-items: center; background: #ededed; border: 0; border-radius: 9px; cursor: pointer; display: flex; font-size: 18px; height: 34px; justify-content: center; padding: 0; width: 34px; }
.icon-button.danger { color: var(--danger); }
.icon-button.add { background: #090909; color: white; font-size: 22px; font-weight: 800; }
.empty { color: var(--muted); padding: 54px 20px; text-align: center; }
.empty > span { color: #555; font-size: 32px; }
.empty h3 { color: var(--ink); margin: 10px 0 4px; }
.settings-panel { margin-top: 24px; }
.settings-panel summary { cursor: pointer; font-weight: 800; }
.password-form { align-items: end; display: grid; gap: 12px; grid-template-columns: minmax(230px, 380px) auto; margin-top: 20px; }

/* Public live screen */
.live-page { background: var(--forest); color: white; min-height: 100vh; overflow-x: hidden; position: relative; }
.ambient { border-radius: 50%; filter: blur(2px); pointer-events: none; position: fixed; }
.ambient-one { background: rgba(255,255,255,.055); height: 650px; right: -260px; top: -270px; width: 650px; }
.ambient-two { border: 1px solid rgba(255,255,255,.08); bottom: -300px; height: 700px; left: -330px; width: 700px; }
.live-header { align-items: center; display: flex; justify-content: space-between; margin: 0 auto; max-width: 1260px; padding: 28px clamp(20px, 5vw, 64px); position: relative; z-index: 2; }
.live-brand { align-items: center; display: flex; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; gap: 12px; line-height: 1.05; }
.live-brand small { color: #bdbdbd; font-size: 9px; letter-spacing: .22em; }
.live-logo { background: #000; border: 1px solid #333; border-radius: 12px; display: block; height: 72px; object-fit: cover; object-position: center; width: 122px; }
.live-actions { align-items: center; display: flex; gap: 10px; }
.live-status { align-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; color: #c7c7c7; display: flex; font-size: 12px; gap: 9px; padding: 9px 14px; }
.register-link { background: white; border: 1px solid white; border-radius: 999px; color: #090909; font-size: 12px; font-weight: 800; padding: 10px 16px; transition: background .2s, color .2s; }
.register-link:hover { background: transparent; color: white; }
.live-status i { animation: pulse 1.8s infinite; background: #fff; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,255,255,.1); height: 7px; width: 7px; }
.live-status.offline i { animation: none; background: #d98980; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } }
.live-shell { margin: 0 auto; max-width: 1260px; padding: 44px clamp(20px, 5vw, 64px) 80px; position: relative; z-index: 1; }
.hero { max-width: 820px; }
.hero h1 { font-size: clamp(60px, 10vw, 128px); letter-spacing: -.075em; line-height: .88; margin: 0; }
.hero h1 em { color: var(--lime); font-style: normal; }
.hero-copy { color: #bcbcbc; font-size: clamp(16px, 2vw, 20px); line-height: 1.6; margin: 28px 0 0; max-width: 580px; }
.total-stage { margin: clamp(44px, 8vw, 90px) 0; }
.total-card { background: linear-gradient(135deg, #fff 0%, #d6d6d6 100%); border: 1px solid #fff; border-radius: 30px; box-shadow: 0 32px 100px rgba(0,0,0,.32); color: var(--forest); overflow: hidden; padding: clamp(28px, 5vw, 58px); position: relative; }
.total-card::after { border: 1px solid rgba(0,0,0,.14); border-radius: 50%; content: ''; height: 380px; position: absolute; right: -130px; top: -190px; width: 380px; }
.total-card-head { align-items: center; display: flex; gap: 20px; justify-content: space-between; min-height: 54px; padding-right: 120px; position: relative; z-index: 2; }
.total-label { font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.live-highlights { align-items: center; display: flex; gap: clamp(16px, 3vw, 34px); }
.cash-live { align-items: flex-end; display: flex; flex-direction: column; }
.cash-live > span,
.market-live span { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.market-live strong { font-family: 'Manrope', sans-serif; font-size: clamp(20px, 3vw, 34px); letter-spacing: -.04em; }
.cash-flow-values { display: flex; gap: clamp(10px, 1.7vw, 22px); margin-top: 4px; }
.cash-flow-values > div { align-items: flex-end; display: flex; flex-direction: column; }
.cash-flow-values small { color: #666; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.cash-flow-values strong { font-family: 'Manrope', sans-serif; font-size: clamp(14px, 1.7vw, 22px); letter-spacing: -.04em; white-space: nowrap; }
.cash-flow-values .remaining strong { border-bottom: 2px solid #090909; }
.market-live { align-items: flex-end; display: flex; flex-direction: column; }
.market-live strong { align-items: center; display: flex; gap: 5px; }
.market-live strong i { font-size: .8em; font-style: normal; }
.market-live strong b { font: inherit; }
.summary-logo { background: #050505; border: 1px solid #222; border-radius: 10px; height: 54px; object-fit: cover; object-position: center; position: absolute; right: clamp(22px, 4vw, 52px); top: 18px; width: 96px; z-index: 2; }
.product-summary-list { display: grid; gap: 10px 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 0 22px; position: relative; z-index: 1; }
.product-summary-row { align-items: center; background: rgba(255,255,255,.52); border: 1px solid rgba(0,0,0,.11); border-radius: 11px; display: flex; gap: 8px; justify-content: space-between; min-width: 0; padding: 9px 10px; }
.product-summary-row strong { font-family: 'Manrope', sans-serif; font-size: clamp(14px, 1.55vw, 18px); letter-spacing: -.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-summary-row span { background: #090909; border-radius: 999px; color: white; flex: 0 0 auto; font-family: 'Manrope', sans-serif; font-size: clamp(11px, 1.1vw, 13px); font-weight: 800; padding: 6px 9px; }
.summary-empty { color: #626262; grid-column: 1 / -1; padding: 24px 0; }
.total-meta { border-top: 1px solid rgba(0,0,0,.2); display: flex; font-size: 13px; justify-content: space-between; padding-top: 20px; }
.section-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 24px; }
.section-heading h2 { font-size: clamp(27px, 4vw, 42px); letter-spacing: -.045em; margin: 0; }
.spark { color: var(--lime); font-size: 38px; }
.live-products { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.live-product { align-items: center; animation: enter .5s both; animation-delay: var(--delay); background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; display: grid; gap: 10px; grid-template-columns: 42px minmax(0,1fr) auto; padding: 13px 14px; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.product-number { align-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; color: #fff; display: flex; font-size: 11px; font-weight: 800; height: 44px; justify-content: center; }
.product-copy h3 { font-size: 14px; margin: 0; }
.product-copy p { color: #aaa; font-size: 11px; margin: 3px 0 0; }
.live-product > strong { color: #fff; font-family: 'Manrope', sans-serif; font-size: clamp(13px, 1.5vw, 17px); letter-spacing: -.02em; white-space: nowrap; }
.live-empty, .live-error { background: rgba(255,255,255,.055); border: 1px dashed rgba(255,255,255,.15); border-radius: 18px; color: #b0b0b0; padding: 50px 20px; text-align: center; }
.live-empty span { color: var(--lime); font-size: 34px; }
.live-empty h3 { color: white; margin: 12px 0 5px; }
.live-error { margin-bottom: 18px; }
.live-error a { color: var(--lime); font-weight: 800; }
.live-footer { border-top: 1px solid rgba(255,255,255,.08); color: #888; display: flex; font-size: 11px; justify-content: space-between; letter-spacing: .1em; margin: 0 auto; max-width: 1132px; padding: 24px 0 36px; position: relative; text-transform: uppercase; }

@media (max-width: 1180px) {
  .cash-form { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .product-summary-list,
  .live-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .admin-heading { align-items: stretch; flex-direction: column; }
  .summary-card { min-width: 0; }
  .admin-grid { grid-template-columns: 1fr; }
  .form-panel { position: static; }
  .cash-admin-panel { align-items: stretch; flex-direction: column; }
  .cash-form { flex-basis: auto; }
  .total-card-head { align-items: flex-start; flex-direction: column; padding-right: 78px; }
  .live-highlights { align-items: flex-start; width: 100%; }
  .cash-live,
  .market-live { align-items: flex-start; }
  .cash-flow-values > div { align-items: flex-start; }
  .product-summary-list,
  .live-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .auth-card { border-radius: 18px; padding: 30px 22px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar nav { width: 100%; }
  .topbar nav a { background: rgba(255,255,255,.07); flex: 1; text-align: center; }
  .admin-shell { padding-top: 28px; }
  .panel { border-radius: 16px; padding: 20px 16px; }
  .button-row .button { flex: 1; }
  .admin-product { grid-template-columns: 38px minmax(0,1fr) auto; }
  .admin-price { grid-column: 2; }
  .row-actions { grid-column: 3; grid-row: 1 / span 2; }
  .password-form { align-items: stretch; grid-template-columns: 1fr; }
  .cash-form { grid-template-columns: 1fr; }
  .live-highlights { flex-direction: column; gap: 8px; }
  .live-header { padding-bottom: 12px; }
  .live-status span { display: none; }
  .live-status { padding: 11px; }
  .live-actions { align-items: stretch; flex-direction: column-reverse; }
  .register-link { padding: 9px 12px; text-align: center; }
  .live-shell { padding-top: 34px; }
  .hero h1 { font-size: clamp(55px, 20vw, 90px); }
  .total-card { border-radius: 22px; }
  .summary-logo { height: 42px; right: 18px; top: 16px; width: 74px; }
  .product-summary-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .product-summary-list,
  .live-products { grid-template-columns: 1fr; }
  .total-meta { align-items: flex-start; flex-direction: column; gap: 6px; }
  .live-product { align-items: start; gap: 12px; grid-template-columns: 42px minmax(0,1fr); padding: 15px; }
  .product-number { height: 42px; }
  .live-product > strong { grid-column: 2; }
  .live-footer { margin: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
