/* SoftSunrise Demo Platform */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0d2340;
  --navy-2: #123f70;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f3f6fa;
  --accent: #f2643b;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #b45309;
  --radius: 12px;
}

body { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }

a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.warn { color: var(--warn); font-weight: 700; }
.bad { color: var(--danger); font-weight: 700; }
.r { text-align: right; }

/* ── Demo strip ── */
.demo-strip { background: linear-gradient(90deg, var(--navy), var(--navy-2)); color: #fff; font-size: .8rem; }
.demo-strip-in { max-width: 1280px; margin: 0 auto; padding: .5rem 1.25rem; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.demo-pulse { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.55);} 70% { box-shadow: 0 0 0 9px rgba(74,222,128,0);} 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0);} }
.demo-strip-link { margin-left: auto; color: #ffd9c9; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: .3rem; }
.demo-strip-link:hover { color: #fff; }

/* ── Layout ── */
.app { display: flex; min-height: calc(100vh - 33px); }
.sidebar { width: 246px; background: var(--navy); color: #fff; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: calc(100vh - 33px); overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), #e11d48); color: #fff; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.side-title { font-weight: 800; font-size: .95rem; }
.side-sub { font-size: .68rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .08em; }

.product-pill { display: flex; align-items: center; gap: .7rem; margin: 1rem 1.1rem .4rem; padding: .7rem .8rem; background: rgba(255,255,255,.06); border-radius: var(--radius); }
.pp-ico { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.pp-name { font-weight: 800; font-size: .8rem; line-height: 1.25; }
.pp-ws { font-size: .7rem; color: rgba(255,255,255,.6); }

.side-nav { padding: .4rem .75rem .8rem; flex: 1; }
.sn-item { display: flex; align-items: center; gap: .65rem; padding: .62rem .85rem; border-radius: 9px; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 600; font-size: .85rem; margin-bottom: 2px; transition: background .18s, color .18s; }
.sn-item i { width: 18px; text-align: center; font-size: .95rem; }
.sn-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.sn-item.active { background: var(--accent); color: #fff; }
.sn-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 800; padding: 1px 7px; border-radius: 20px; }

.side-foot { padding: .8rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .8rem; }
.side-foot a { color: rgba(255,255,255,.6); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.side-foot a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar-d { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 50; }
.tb-title { font-size: 1.05rem; font-weight: 800; color: var(--navy); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.tb-switch { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); }
.tb-switch select { padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-size: .8rem; font-weight: 700; color: var(--navy); background: #fff; cursor: pointer; }
.menu-btn { display: none; background: none; border: none; font-size: 1.3rem; color: var(--navy); cursor: pointer; }
.side-overlay { display: none; }

.content { padding: 1.5rem; max-width: 1240px; width: 100%; margin: 0 auto; }

/* ── Buttons / inputs ── */
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.1rem; border-radius: 9px; border: 1px solid transparent; font-weight: 700; font-size: .83rem; cursor: pointer; text-decoration: none; transition: all .18s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #e14f28; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn-ghost.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: .75rem 1.4rem; font-size: .95rem; }
.btn-sm { padding: .38rem .75rem; font-size: .76rem; }
.btn-reset { background: rgba(242,100,59,.12); color: var(--accent); border-color: rgba(242,100,59,.35); }
.btn-reset:hover { background: var(--accent); color: #fff; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); }

.inp { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,100,59,.15); }

.fld { display: block; margin-bottom: .85rem; }
.fld > span { display: block; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: .3rem; }
.fld-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.fld-wide { grid-column: 1 / -1; }

/* ── Panels / cards ── */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: 0 1px 3px rgba(13,35,64,.04); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .95rem; gap: .6rem; }
.panel-head h3 { font-size: .95rem; font-weight: 800; color: var(--navy); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.link { color: var(--accent); font-weight: 700; text-decoration: none; font-size: .8rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; display: flex; align-items: center; gap: .9rem; }
.kpi-ico { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.kpi-val { font-size: 1.35rem; font-weight: 900; color: var(--navy); line-height: 1.1; }
.kpi-lab { font-size: .72rem; color: var(--muted); font-weight: 600; }

.alert { padding: .8rem 1rem; border-radius: 9px; font-size: .85rem; margin-bottom: 1rem; display: flex; gap: .5rem; align-items: center; }
.alert-ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Tables ── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .83rem; }
.tbl th { text-align: left; padding: .55rem .7rem; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .6rem .7rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .r { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .85rem; line-height: 1.7; }

.row-actions { white-space: nowrap; text-align: right; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: .95rem; padding: .25rem .4rem; border-radius: 6px; text-decoration: none; }
.icon-btn:hover { background: #f1f5f9; color: var(--navy); }

.badge { background: var(--navy); color: #fff; font-size: .68rem; font-weight: 800; padding: 2px 9px; border-radius: 20px; }

.alert-sec-title { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .6rem 0 .3rem; }

.feed { list-style: none; }
.feed li { display: flex; gap: .7rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.feed li:last-child { border-bottom: none; }
.feed-ico { color: var(--accent); margin-top: 2px; }

/* ── Bill (POS) ── */
.bill-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1.25rem; align-items: start; }
.search-row { display: flex; gap: .5rem; }
.search-results { margin-top: .8rem; }
.sr-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 9px; margin-bottom: .5rem; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.sr-item:hover { border-color: var(--accent); background: #fff7f4; }
.sr-name { font-weight: 700; font-size: .83rem; }
.sr-meta { font-size: .72rem; color: var(--muted); }
.sr-add { margin-left: auto; color: var(--accent); font-size: 1.2rem; }

.bill-lines { max-height: 320px; overflow-y: auto; }
.bill-line { display: grid; grid-template-columns: 1fr 64px 96px 30px; gap: .5rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.bl-name { font-weight: 600; font-size: .8rem; }
.bl-price { font-size: .75rem; color: var(--muted); }
.bill-line .inp { padding: .35rem .5rem; font-size: .8rem; }
.bl-remove { background: none; border: none; color: #dc2626; cursor: pointer; font-size: 1rem; }
.bill-rows { display: none; }

.bill-sum { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; margin: .9rem 0; }
.bs-row { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); padding: .15rem 0; }
.bs-total { font-size: 1.05rem; font-weight: 900; color: var(--navy); border-top: 1px dashed var(--line); margin-top: .3rem; padding-top: .4rem; }
.bill-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .8rem; }

/* ── Tabs ── */
.tabs { display: flex; gap: .5rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.tab { padding: .5rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 9px; font-size: .8rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Toolbar / reports ── */
.toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }
.stat-inline { font-size: .82rem; color: var(--muted); }
.stat-inline b { color: var(--navy); font-size: .95rem; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: .5rem; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.chart-bar { width: 70%; max-width: 44px; background: linear-gradient(180deg, var(--accent), #e11d48); border-radius: 6px 6px 0 0; min-height: 2px; transition: height .4s; }
.chart-lab { font-size: .65rem; color: var(--muted); }

/* ── Attendance ── */
.radio-pill { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 20px; padding: .3rem .75rem; font-size: .78rem; font-weight: 700; color: var(--muted); cursor: pointer; margin-right: .4rem; background: #fff; }
.radio-pill input { display: none; }
.radio-pill.on { background: #dcfce7; color: #15803d; border-color: #86efac; }
.radio-pill.bad.on { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

/* ── Reset ── */
.reset-card { max-width: 460px; margin: 2rem auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2rem; text-align: center; box-shadow: 0 12px 40px rgba(13,35,64,.1); }
.reset-ico { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: #fef2f2; color: var(--danger); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.reset-card h2 { font-size: 1.3rem; color: var(--navy); margin-bottom: .6rem; }
.reset-card p { color: var(--muted); font-size: .88rem; line-height: 1.6; margin-bottom: 1.2rem; }
.reset-stats { display: flex; justify-content: center; gap: 1.4rem; margin-bottom: 1.3rem; }
.reset-stats div { font-size: .78rem; color: var(--muted); }
.reset-stats b { display: block; font-size: 1.3rem; color: var(--navy); }

/* ── Receipt ── */
.receipt-wrap { max-width: 640px; margin: 0 auto; }
.receipt { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; box-shadow: 0 10px 30px rgba(13,35,64,.08); }
.rc-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.rc-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--navy); }
.rc-brand .side-logo { width: 32px; height: 32px; font-size: .8rem; }
.rc-ref { margin-left: auto; font-weight: 800; color: var(--accent); }
.rc-party { font-size: .9rem; margin-bottom: .6rem; }
.rc-lines { width: 100%; border-collapse: collapse; font-size: .83rem; margin-bottom: .8rem; }
.rc-lines th { text-align: left; padding: .45rem .4rem; color: var(--muted); font-size: .7rem; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.rc-lines td { padding: .5rem .4rem; border-bottom: 1px dashed var(--line); }
.rc-lines .r { text-align: right; }
.rc-sum { max-width: 260px; margin-left: auto; }
.rc-sum > div { display: flex; justify-content: space-between; padding: .2rem 0; font-size: .84rem; color: var(--muted); }
.rc-total { font-size: 1.1rem; font-weight: 900; color: var(--navy); border-top: 2px solid var(--navy); margin-top: .3rem; padding-top: .5rem; }
.rc-due { color: var(--danger); font-weight: 800; }
.rc-foot { margin-top: 1rem; text-align: center; font-size: .78rem; border-top: 1px dashed var(--line); padding-top: .8rem; }
.receipt-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }

/* ── KDS board ── */
.kds-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.kds-clock { font-size: 1.5rem; font-weight: 900; color: var(--navy); font-variant-numeric: tabular-nums; }
.kds-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.kds-card { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 12px; padding: 1rem; box-shadow: 0 2px 8px rgba(13,35,64,.06); }
.kds-new { border-left-color: #eab308; }
.kds-cooking { border-left-color: #f2643b; }
.kds-ready { border-left-color: #16a34a; }
.kds-head { display: flex; align-items: center; gap: .5rem; }
.kds-table { font-weight: 900; font-size: 1rem; color: var(--navy); }
.kds-status { font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 20px; background: #f1f5f9; }
.kds-new .kds-status { background: #fef3c7; color: #b45309; }
.kds-cooking .kds-status { background: #ffe4d6; color: #c2410c; }
.kds-ready .kds-status { background: #dcfce7; color: #15803d; }
.kds-age { margin-left: auto; font-weight: 800; font-size: .85rem; color: var(--muted); }
.kds-age.kds-late { color: var(--danger); }
.kds-ref { font-size: .7rem; }
.kds-lines { list-style: none; margin: .6rem 0 .8rem; }
.kds-lines li { padding: .3rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.kds-next { width: 100%; padding: .6rem; border: none; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 800; font-size: .85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .4rem; transition: background .15s; }
.kds-next:hover { background: var(--navy-2); }

/* ── Landing ── */
.landing-body { background: radial-gradient(1200px 500px at 80% -10%, rgba(242,100,59,.14), transparent 60%), radial-gradient(900px 500px at 0% 0%, rgba(18,63,112,.18), transparent 55%), #f3f6fa; min-height: 100vh; }
.landing { max-width: 1080px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; }
.landing-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2.4rem; }
.landing-brand { display: flex; align-items: center; gap: .8rem; }
.landing-title { font-size: 1.25rem; font-weight: 900; color: var(--navy); }
.landing-title span { color: var(--accent); }
.landing-sub { font-size: .82rem; color: var(--muted); }
.landing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.landing-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem; text-decoration: none; display: flex; flex-direction: column; transition: transform .25s cubic-bezier(.165,.84,.44,1), box-shadow .25s, border-color .25s; }
.landing-card:hover { transform: translateY(-5px); box-shadow: 0 18px 44px rgba(13,35,64,.13); border-color: rgba(242,100,59,.4); }
.lc-ico { width: 54px; height: 54px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 1rem; }
.lc-name { font-size: 1rem; font-weight: 800; color: var(--navy); margin-bottom: .4rem; }
.lc-desc { font-size: .8rem; color: var(--muted); line-height: 1.55; flex: 1; margin-bottom: 1rem; }
.lc-cta { color: var(--accent); font-weight: 800; font-size: .83rem; display: flex; align-items: center; gap: .35rem; }
.landing-foot { text-align: center; margin-top: 2.5rem; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.landing-foot a { color: var(--accent); font-weight: 700; }

.hint { font-size: .75rem; color: var(--muted); line-height: 1.5; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .bill-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; top: 33px; z-index: 200; transition: left .25s ease; height: calc(100vh - 33px); }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex; }
  .side-overlay.show { display: block; position: fixed; inset: 33px 0 0 0; background: rgba(13,35,64,.45); z-index: 150; }
  .tb-switch-label { display: none; }
  .bill-fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .content { padding: 1rem; }
  .bill-fields { grid-template-columns: 1fr; }
  .fld-2 { grid-template-columns: 1fr; }
  .kpi { padding: .8rem; }
  .demo-strip-in { justify-content: center; text-align: center; }
  .demo-strip-link { margin-left: 0; }
}

@media print {
  .demo-strip, .sidebar, .topbar-d, .receipt-actions, .menu-btn { display: none !important; }
  .app { min-height: auto; }
  .main { margin: 0; }
  .content { max-width: 100%; padding: 0; }
  .receipt { border: none; box-shadow: none; }
}
