/* Judi — Shopping & Delivery App prototype. Yellow/black UI, four live roles. */
.jd {
    --jd-yellow: #F6A821;
    --jd-yellow-d: #E2951A;
    --jd-ink: #1A1A1A;
    --jd-bg: #F4F5F7;
    --jd-card: #ffffff;
    --jd-line: #e7e8ec;
    --jd-muted: #7c7c85;
    --jd-ok: #16a34a;
    --jd-blue: #2563eb;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--jd-bg);
    color: var(--jd-ink);
    min-height: 100vh;
    padding: 1rem clamp(.6rem, 3vw, 2rem) 2rem;
}

/* ── Top bar ─────────────────────────────────────────────────────────── */
.jd-topbar {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: .7rem 1rem; margin-bottom: 1rem;
    background: var(--jd-yellow); border-radius: 16px;
    box-shadow: 0 6px 20px rgba(246, 168, 33, .28);
}
.jd-brand { display: flex; flex-direction: column; line-height: 1.1; }
.jd-brand small { font-size: .72rem; color: #5a4408; font-weight: 600; }
.jd-logo {
    font-weight: 800; font-size: 1.4rem; letter-spacing: -.04em;
    color: var(--jd-ink); font-family: "Trebuchet MS", Inter, sans-serif;
}
.jd-logo.big { font-size: 2.6rem; }
.jd-focus { display: flex; gap: .35rem; flex-wrap: wrap; margin-left: auto; }
.jd-focus button {
    border: 0; cursor: pointer; font: 600 .8rem/1 Inter, sans-serif;
    padding: .5rem .8rem; border-radius: 999px;
    background: rgba(0, 0, 0, .12); color: var(--jd-ink);
}
.jd-focus button.active { background: var(--jd-ink); color: #fff; }
.jd-live {
    font: 700 .68rem/1 Inter, sans-serif; letter-spacing: .12em;
    background: var(--jd-ink); color: var(--jd-yellow);
    padding: .35rem .6rem; border-radius: 6px;
}

/* ── Wall layout ─────────────────────────────────────────────────────── */
.jd-wall {
    display: grid; gap: 1rem; align-items: start;
    grid-template-columns: repeat(3, minmax(0, 320px)) minmax(0, 1fr);
}
.jd-pane {
    background: var(--jd-card); border: 1px solid var(--jd-line);
    border-radius: 18px; padding: .8rem; overflow: hidden;
}
.jd-pane-hd {
    display: flex; align-items: center; gap: .45rem;
    font: 700 .8rem/1 Inter, sans-serif; margin-bottom: .7rem;
}
.jd-pane-hd .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--jd-ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }

@media (max-width: 1180px) {
    .jd-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .jd-wall { grid-template-columns: 1fr; }
    /* On small screens the Focus buttons become the primary way through. */
    .jd[data-focus=""] .jd-pane ~ .jd-pane { display: none; }
}
/* Desktop "Focus <role>" — hide the other panes, blow one up. */
.jd[data-focus="customer"]  .jd-pane:not([data-role="customer"]),
.jd[data-focus="restaurant"].jd .jd-pane:not([data-role="restaurant"]),
.jd[data-focus="driver"]    .jd-pane:not([data-role="driver"]),
.jd[data-focus="admin"]     .jd-pane:not([data-role="admin"]) { display: none; }
.jd:not([data-focus=""]) .jd-wall { grid-template-columns: minmax(0, 1fr); }
.jd:not([data-focus=""]) .jd-phone { transform: none; }
.jd:not([data-focus=""]) .jd-pane[data-role="customer"] .jd-phone,
.jd:not([data-focus=""]) .jd-pane[data-role="restaurant"] .jd-phone,
.jd:not([data-focus=""]) .jd-pane[data-role="driver"] .jd-phone { max-width: 380px; margin: 0 auto; }

/* ── Phone frame ─────────────────────────────────────────────────────── */
.jd-phone { width: 100%; }
.jd-screen-frame {
    position: relative; background: var(--jd-card);
    border: 8px solid var(--jd-ink); border-radius: 30px;
    height: 560px; overflow: hidden; display: flex; flex-direction: column;
}
.jd-notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 90px; height: 16px; background: var(--jd-ink); border-radius: 0 0 12px 12px; z-index: 5; }
.jd-statusbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: .5rem .9rem .3rem; font: 600 .7rem/1 Inter, sans-serif;
    background: var(--jd-yellow); color: var(--jd-ink);
}
.jd-scroll { flex: 1; overflow-y: auto; background: #fbfbfc; }
.jd-scroll::-webkit-scrollbar { width: 4px; }
.jd-scroll::-webkit-scrollbar-thumb { background: #d5d6db; border-radius: 4px; }
.jd-screen { padding: .8rem .8rem 1rem; }

/* ── App chrome bits ────────────────────────────────────────────────── */
.jd-apphd { display: flex; justify-content: space-between; align-items: center; margin-bottom: .7rem; }
.jd-apphd b { font-size: 1rem; }
.jd-apphd .bell { font-size: 1rem; }
.jd-open-pill { font: 700 .66rem/1 Inter, sans-serif; color: var(--jd-ok); }
.jd-backrow { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; font-weight: 700; }
.jd-backrow .back { cursor: pointer; font-size: 1.1rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; background: #f0f0f2; border-radius: 8px; }
.jd-secthd { display: flex; justify-content: space-between; align-items: baseline; margin: .9rem 0 .5rem; }
.jd-secthd h4 { font-size: .82rem; margin: 0; }
.jd-secthd span { font-size: .7rem; color: var(--jd-yellow-d); font-weight: 700; }
.jd-search input { width: 100%; padding: .6rem .8rem; border: 1px solid var(--jd-line); border-radius: 12px; font: inherit; font-size: .8rem; background: #fff; }

.jd-primary {
    width: 100%; border: 0; cursor: pointer; margin-top: .6rem;
    background: var(--jd-yellow); color: var(--jd-ink);
    font: 700 .85rem/1 Inter, sans-serif; padding: .8rem; border-radius: 12px;
}
.jd-primary:hover { background: var(--jd-yellow-d); }
.jd-primary.ghost { background: #f0f0f2; }
.jd-primary:disabled { opacity: .5; cursor: not-allowed; }

/* Onboard */
.jd-onboard { text-align: center; padding: 2rem .5rem; }
.jd-onboard p { color: var(--jd-muted); font-size: .82rem; margin: .4rem 0 1.2rem; }
.jd-langs { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .4rem; }
.jd-lang { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border: 1px solid var(--jd-line); border-radius: 12px; font-size: .82rem; text-align: left; }

/* Categories */
.jd-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .8rem 0; }
.jd-cat { text-align: center; font-size: .64rem; color: var(--jd-muted); }
.jd-cat i { display: grid; place-items: center; width: 100%; aspect-ratio: 1; background: #fff5e2; border-radius: 14px; font-size: 1.1rem; margin-bottom: .25rem; font-style: normal; }
.jd-promo { background: var(--jd-yellow); color: var(--jd-ink); font-weight: 700; font-size: .82rem; padding: 1rem .9rem; border-radius: 14px; margin: .4rem 0 .2rem; }

/* Restaurant + menu cards */
.jd-rcard { display: flex; gap: .6rem; padding: .55rem; border: 1px solid var(--jd-line); border-radius: 14px; margin-bottom: .5rem; cursor: pointer; align-items: center; background: #fff; }
.jd-rcard:hover { border-color: var(--jd-yellow); }
.jd-rcard .thumb { width: 46px; height: 46px; border-radius: 10px; background: var(--jd-yellow); display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.jd-rcard .t { font-weight: 700; font-size: .82rem; }
.jd-rcard .m { font-size: .68rem; color: var(--jd-muted); }
.jd-rest-hero { height: 84px; border-radius: 14px; background: linear-gradient(135deg, var(--jd-yellow), var(--jd-yellow-d)); display: grid; place-items: center; color: var(--jd-ink); font-weight: 800; margin-bottom: .6rem; }
.jd-tabs { display: flex; gap: .4rem; margin-bottom: .3rem; }
.jd-tabs button { flex: 1; border: 0; background: #f0f0f2; font: 600 .72rem/1 Inter, sans-serif; padding: .5rem; border-radius: 9px; cursor: pointer; }
.jd-tabs button.active { background: var(--jd-ink); color: #fff; }
.jd-mitem { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--jd-line); }
.jd-mitem .t { font-weight: 700; font-size: .8rem; }
.jd-mitem .p { font-size: .72rem; color: var(--jd-muted); }
.jd-mitem .add { margin-left: auto; width: 1.7rem; height: 1.7rem; border-radius: 8px; border: 0; background: var(--jd-yellow); font-weight: 800; cursor: pointer; font-size: 1rem; }
.jd-mitem .qty { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.jd-mitem .qty button { width: 1.5rem; height: 1.5rem; border: 0; border-radius: 7px; background: #f0f0f2; cursor: pointer; font-weight: 800; }

/* Cart + totals */
.jd-cline { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px dashed var(--jd-line); font-size: .8rem; }
.jd-cart-tot { display: flex; justify-content: space-between; font-weight: 800; margin-top: .6rem; font-size: .9rem; }
.jd-addr-card, .jd-track-card { background: #fff5e2; border-radius: 12px; padding: .7rem .8rem; font-size: .78rem; margin-top: .7rem; }
.jd-track-card b { display: block; font-size: .9rem; }

/* Timeline */
.jd-timeline { margin-top: .8rem; }
.jd-tl-step { display: flex; gap: .6rem; padding: .35rem 0; font-size: .78rem; color: var(--jd-muted); }
.jd-tl-step .k { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--jd-line); flex: none; margin-top: .1rem; }
.jd-tl-step.done { color: var(--jd-ink); font-weight: 600; }
.jd-tl-step.done .k { background: var(--jd-ok); border-color: var(--jd-ok); }
.jd-tl-step.current .k { border-color: var(--jd-yellow); background: var(--jd-yellow); }

/* Action bar / tab bar */
.jd-actionbar { padding: .6rem .8rem; background: #fff; border-top: 1px solid var(--jd-line); }
.jd-actionbar .jd-primary { margin: 0; }
.jd-tabbar { display: flex; background: #fff; border-top: 1px solid var(--jd-line); }
.jd-tabbar button { flex: 1; border: 0; background: none; cursor: pointer; padding: .5rem 0; font: 600 .6rem/1.4 Inter, sans-serif; color: var(--jd-muted); position: relative; }
.jd-tabbar button span { display: block; font-size: 1rem; }
.jd-tabbar button.active { color: var(--jd-yellow-d); }
.jd-badge { position: absolute; top: .2rem; right: 50%; transform: translateX(1.2rem); background: #ef4444; color: #fff; font-size: .58rem; font-style: normal; padding: .05rem .3rem; border-radius: 999px; }

/* Restaurant / driver shared */
.jd-stat-row, .jd-earn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .6rem; }
.jd-stat-row .c, .jd-earn-card { background: #fff5e2; border-radius: 12px; padding: .6rem .7rem; }
.jd-stat-row .c small, .jd-earn-card small { font-size: .64rem; color: var(--jd-muted); display: block; }
.jd-stat-row .c b, .jd-earn-card b { font-size: 1rem; }
.jd-ocard { border: 1px solid var(--jd-line); border-radius: 14px; padding: .7rem; margin-bottom: .55rem; }
.jd-ocard .top { display: flex; justify-content: space-between; font-weight: 700; font-size: .82rem; }
.jd-ocard .items { font-size: .72rem; color: var(--jd-muted); margin: .25rem 0 .5rem; }
.jd-ocard .status { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.jd-ocard .row-btns { display: flex; gap: .4rem; margin-top: .5rem; }
.jd-ocard .row-btns button { flex: 1; border: 0; cursor: pointer; padding: .5rem; border-radius: 9px; font: 700 .72rem/1 Inter, sans-serif; background: var(--jd-yellow); }
.jd-ocard .row-btns button.ghost { background: #f0f0f2; }
.jd-chip { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .64rem; font-weight: 800; }
.s-PLACED { background: #fef3c7; color: #92610a; }
.s-ACCEPTED, .s-PREPARING { background: #dbeafe; color: #1e40af; }
.s-READY { background: #ede9fe; color: #5b21b6; }
.s-PICKED_UP { background: #fae8ff; color: #86198f; }
.s-DELIVERED { background: #dcfce7; color: #166534; }

.jd-route { height: 60px; border-radius: 12px; background: repeating-linear-gradient(90deg, #fff5e2 0 14px, #ffe9c2 14px 20px); display: grid; place-items: center; font-size: .74rem; font-weight: 700; color: var(--jd-yellow-d); margin-bottom: .6rem; }
.jd-mrow { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px dashed var(--jd-line); font-size: .8rem; }
.jd-mrow .av { font-size: .66rem; font-weight: 800; }
.jd-mrow .av.off { color: var(--jd-muted); }

/* ── Admin ──────────────────────────────────────────────────────────── */
.jd-pane.wide { min-width: 0; }
.jd-admin { display: flex; border: 1px solid var(--jd-line); border-radius: 14px; overflow: hidden; min-height: 560px; }
.jd-admin-side { width: 150px; flex: none; background: var(--jd-ink); color: #cfd0d6; padding: .8rem .6rem; }
.jd-admin-side .brand { display: flex; flex-direction: column; margin-bottom: 1rem; }
.jd-admin-side .brand .jd-logo { color: var(--jd-yellow); }
.jd-admin-side .brand small { font-size: .62rem; }
.jd-admin-side nav { display: flex; flex-direction: column; gap: .2rem; }
.jd-admin-side button { text-align: left; border: 0; background: none; color: inherit; cursor: pointer; font: 600 .74rem/1 Inter, sans-serif; padding: .55rem .6rem; border-radius: 8px; }
.jd-admin-side button.active { background: var(--jd-yellow); color: var(--jd-ink); }
.jd-admin-main { flex: 1; padding: 1rem 1.1rem; overflow-x: auto; }
.jd-admin-main h3 { margin: 0 0 .8rem; font-size: 1rem; }
.jd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.jd-stat { background: #fff5e2; border-radius: 12px; padding: .7rem .8rem; }
.jd-stat small { font-size: .66rem; color: var(--jd-muted); display: block; }
.jd-stat b { font-size: 1.25rem; }
.jd-stat.up b::after { content: " ▲"; color: var(--jd-ok); font-size: .7rem; }
.jd-charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: .8rem; }
.jd-chart-card { border: 1px solid var(--jd-line); border-radius: 12px; padding: .8rem; }
.jd-chart-card h4 { margin: 0 0 .6rem; font-size: .78rem; }
#jd-area { width: 100%; height: 150px; }
#jd-area path.area { fill: rgba(246, 168, 33, .18); }
#jd-area path.line { fill: none; stroke: var(--jd-yellow-d); stroke-width: 2.5; }
.jd-topcat { display: flex; align-items: center; gap: .5rem; font-size: .74rem; margin-bottom: .5rem; }
.jd-topcat .bar { flex: 1; height: 8px; border-radius: 4px; background: #f0f0f2; overflow: hidden; }
.jd-topcat .bar i { display: block; height: 100%; background: var(--jd-yellow); }
.jd-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.jd-table th, .jd-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--jd-line); white-space: nowrap; }
.jd-table th { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--jd-muted); }
.jd-table tr.flash { animation: jdflash 1.4s ease; }
@keyframes jdflash { from { background: #fff0cf; } to { background: transparent; } }
.jd-set-list { border: 1px solid var(--jd-line); border-radius: 12px; overflow: hidden; }
.jd-set-row { display: flex; justify-content: space-between; padding: .7rem .9rem; border-bottom: 1px solid var(--jd-line); font-size: .8rem; }
.jd-set-row:last-child { border-bottom: 0; }
.jd-earn-grid { grid-template-columns: 1fr 1fr; }

@media (max-width: 1180px) {
    .jd-charts { grid-template-columns: 1fr; }
    .jd-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Toast + feed ───────────────────────────────────────────────────── */
.jd-toast {
    position: absolute; left: 50%; bottom: 4.2rem; transform: translate(-50%, 1rem);
    background: var(--jd-ink); color: #fff; font: 600 .72rem/1.3 Inter, sans-serif;
    padding: .55rem .8rem; border-radius: 10px; max-width: 80%; text-align: center;
    opacity: 0; pointer-events: none; transition: .25s;
}
.jd-toast.show { opacity: 1; transform: translate(-50%, 0); }
.jd-feed { margin-top: 1rem; background: var(--jd-card); border: 1px solid var(--jd-line); border-radius: 14px; padding: .8rem 1rem; }
.jd-feed-hd { font: 700 .78rem/1 Inter, sans-serif; color: var(--jd-yellow-d); }
.jd-feed ul { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; max-height: 160px; overflow-y: auto; }
.jd-feed li { font-size: .76rem; color: var(--jd-ink); padding: .3rem .5rem; background: #fafafb; border-radius: 8px; }
.jd-feed li time { color: var(--jd-muted); font-size: .68rem; margin-right: .5rem; }
.jd-feed li.new { animation: jdflash 1.4s ease; }
