/* Ăn trưa công ty - giao diện theo bản thiết kế "Thiết kế lại Ăn trưa công ty"
   Nền giấy ấm, mực đậm, một màu nhấn ớt. Không emoji. Mobile trước, máy tính từ 900px. */
:root {
  --paper: #F5F1EA; --card: #fff; --ink: #1F1B16; --ink2: #5E574D; --ink3: #6B6458;
  --line: #E4DDD0; --line2: #D2C8B6; --sand: #EFE8DA;
  --chili: #C23B12; --chili-hi: #E9552B; --leaf: #24543D; --leaf-soft: #DDEBE2;
  --star: #B4690E; --star-off: #DDD5C6;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--chili) 45%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink3); }
.muted { color: var(--ink2); } .sm { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
h1 { font-size: 31px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.page-title { margin-top: 26px; }
.page-title .lbl { display: block; margin-bottom: 8px; }
.page-title p.sub { margin-top: 8px; color: var(--ink2); font-size: 14px; line-height: 1.45; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }

/* ---------- khung trang ---------- */
.top-in { display: flex; align-items: center; gap: 12px; max-width: 1160px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--chili); color: #fff; display: grid; place-items: center; flex: none; }
.wordmark { font-size: 17px; font-weight: 800; letter-spacing: -.01em; line-height: 1; } .wordmark span { font-weight: 500; color: var(--ink3); }
.topnav, .who, .top-in .logout { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 700; border: 0; padding: 0; }
button.avatar { cursor: pointer; background: var(--leaf-soft); color: var(--leaf); }
.top { position: relative; }
.pop { position: absolute; right: 20px; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 30; min-width: 190px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(31,27,22,.18); display: none; }
.pop.open { display: block; } .pop .who-m { padding: 8px 10px; font-weight: 700; } .pop .btn { width: 100%; }
main { max-width: 1160px; margin: 0 auto; padding: 0 20px calc(110px + var(--safe-b)); }

.tabbar { display: none; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 6px 8px calc(10px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
body.authed .tabbar { display: flex; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-radius: 12px; font-size: 11.5px; font-weight: 600; color: var(--ink3); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.tab.on { color: var(--chili); background: color-mix(in srgb, var(--chili) 9%, transparent); font-weight: 700; }

/* ---------- nút, chip, ô nhập ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 13px; border: 1.5px solid var(--line2); background: #fff; color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--ink); }
.btn.pri { background: var(--chili); border-color: var(--chili); color: #fff; } .btn.pri:hover { background: #A93110; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.line { border-color: var(--ink); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.lg { min-height: 54px; font-size: 16px; border-radius: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.link { min-height: 32px; padding: 0 6px; border: 0; background: none; color: var(--ink3); font-weight: 600; font-size: 13px; }
.btn.link:hover { color: var(--chili); }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #DCD3C3; background: #fff; font-size: 13.5px; font-weight: 600; color: #3B352C; white-space: nowrap; text-decoration: none; cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.off { color: var(--ink3); text-decoration: line-through; opacity: .7; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 6px; background: var(--leaf-soft); color: var(--leaf); font-size: 12.5px; font-weight: 600; }
.tag.solid { background: var(--leaf); color: #fff; font-size: 11px; font-weight: 700; }

label { display: block; font-size: 13px; font-weight: 600; color: #3B352C; margin: 0 0 6px; }
.fg { margin-top: 14px; } .hint { margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: var(--ink2); }
input:not([type=checkbox]):not([type=file]), select, textarea { width: 100%; min-height: 50px; padding: 0 15px; border-radius: 13px; border: 1px solid var(--line2); background: #fff; font-size: 16px; }
textarea { padding: 12px 15px; min-height: 84px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #8A8274; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--chili); box-shadow: 0 0 0 4px rgba(194,59,18,.14); }
.err { min-height: 1.2em; margin-top: 10px; font-size: 14px; color: #B42318; }
.row2 { display: flex; gap: 12px; flex-wrap: wrap; } .row2 > * { flex: 1 1 160px; }
.switch { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 14.5px; font-weight: 400; color: var(--ink); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { flex: none; width: 46px; height: 27px; border-radius: 14px; background: #CFC6B6; position: relative; transition: background .15s; }
.switch .tr::after { content: ''; position: absolute; left: 3px; top: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .tr { background: var(--leaf); } .switch input:checked + .tr::after { transform: translateX(19px); }
.switch input:focus-visible + .tr { outline: 3px solid color-mix(in srgb, var(--chili) 45%, transparent); outline-offset: 2px; }

/* ---------- thẻ, ô chữ cái, sao ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.pad { padding: 16px; }
.tile { display: grid; place-items: center; flex: none; border-radius: 14px; font-weight: 800; letter-spacing: -.02em; object-fit: cover; }
.tile.s-sm { width: 52px; height: 52px; font-size: 18px; border-radius: 13px; }
.tile.s-md { width: 76px; height: 76px; font-size: 24px; }
.tile.s-lg { width: 92px; height: 92px; font-size: 28px; border-radius: 16px; }
.tone0 { background: #F3D9CC; color: #8A2E0C; } .tone1 { background: #D9E6DC; color: #24543D; } .tone2 { background: #F1E3B8; color: #7A5200; }
.tone3 { background: #DCE4EE; color: #274A6B; } .tone4 { background: #EBD3DB; color: #7A2F4A; }
.star { display: inline-block; width: 13px; height: 13px; background: var(--star); clip-path: polygon(50% 0,62% 36%,100% 38%,70% 60%,80% 100%,50% 76%,20% 100%,30% 60%,0 38%,38% 36%); }
.star.off { background: var(--star-off); }
.stars { display: inline-flex; gap: 2px; align-items: center; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; } .rating b { font-weight: 700; font-variant-numeric: tabular-nums; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--ink2); }
.ico { display: inline-flex; align-items: center; gap: 5px; } .ico .i { width: 15px; height: 15px; }
.empty { padding: 36px 16px; text-align: center; color: var(--ink2); }
.avatar.sm { width: 32px; height: 32px; font-size: 11.5px; }

/* ---------- danh sách quán ---------- */
.banner { display: block; margin-top: 18px; padding: 16px 18px; border-radius: 18px; background: var(--ink); color: #fff; text-decoration: none; }
.banner .top-l { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.banner .lbl { color: #E8C9B5; } .banner .when { font-size: 12.5px; font-weight: 600; color: #CFC6B6; }
.banner .mid { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.banner .big { font-size: 17px; font-weight: 700; letter-spacing: -.01em; } .banner .sub { margin-top: 3px; font-size: 13px; color: #CFC6B6; }
.banner .go { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 12px; background: var(--chili-hi); color: #fff; font-size: 14px; font-weight: 700; }
.bar { height: 6px; border-radius: 3px; background: var(--sand); overflow: hidden; } .bar > span { display: block; height: 100%; border-radius: 3px; background: var(--chili); }
.banner .bar { background: #3A342B; margin-top: 14px; } .banner .bar > span { background: var(--chili-hi); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.search { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line2); color: var(--ink3); }
.search:focus-within { border-color: var(--chili); box-shadow: 0 0 0 4px rgba(194,59,18,.14); }
.search input { border: 0 !important; box-shadow: none !important; min-height: 46px !important; padding: 0 !important; background: none !important; color: var(--ink); }
.toolbar .chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; } .toolbar .chips::-webkit-scrollbar { display: none; }
.desk { display: none !important; }
.plist { display: grid; gap: 10px; margin-top: 14px; }
.pcard { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color .12s, transform .12s; }
.pcard:hover { border-color: var(--line2); transform: translateY(-1px); }
.pcard h3 { font-size: 16.5px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pcard .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.pcard .addr { font-size: 12.5px; color: var(--ink3); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fab { position: fixed; z-index: 19; right: 20px; bottom: calc(96px + var(--safe-b)); width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--chili); color: #fff; display: grid; place-items: center; padding: 0; box-shadow: 0 8px 20px rgba(194,59,18,.35); cursor: pointer; }
.fab .i { width: 26px; height: 26px; }

/* ---------- chi tiết quán ---------- */
.pd-coverwrap { position: relative; margin: 0 -20px; height: 220px; }
.pd-cover { width: 100%; height: 100%; display: grid; place-items: center; font-size: 84px; font-weight: 800; letter-spacing: -.04em; object-fit: cover; }
.back-fab { position: absolute; left: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); width: 44px; height: 44px; border-radius: 14px; background: #fff; color: var(--ink); display: grid; place-items: center; text-decoration: none; box-shadow: 0 2px 8px rgba(31,27,22,.15); }
.back-link { display: none; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink2); text-decoration: none; margin-bottom: 14px; }
.pd-info { position: relative; margin: -26px -20px 0; padding: 24px 20px 0; border-radius: 26px 26px 0 0; background: var(--paper); }
.pd-info h1 { font-size: 29px; }
.pd-info .lines { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 14px; color: #3B352C; }
.pd-info .lines .i { width: 17px; height: 17px; color: var(--ink3); }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; } .pd-actions .btn { flex: 1 1 150px; padding: 0 12px; font-size: 14.5px; white-space: nowrap; }
body[data-page=place] .top { display: none; }
.photos { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0; margin-top: 16px; scrollbar-width: thin; }
.photos.in { margin-top: 12px; }
.photo { position: relative; flex: none; } .photo img { display: block; width: 88px; height: 88px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.photo-del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(31,27,22,.7); color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; }
.photo-del .i { width: 15px; height: 15px; }
.photo-add { flex: none; width: 88px; height: 88px; border-radius: 14px; border: 1.5px dashed #CFC6B6; background: none; color: var(--ink3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.photo-add:hover { border-color: var(--ink); color: var(--ink); }
.photos.in .photo img, .photos.in .photo-add { width: 68px; height: 68px; border-radius: 12px; }

.pd-cols { display: grid; gap: 14px; margin-top: 18px; grid-template-columns: minmax(0, 1fr); }
.statrow { display: flex; padding: 14px 0; } .statrow > div { flex: 1; text-align: center; } .statrow > div + div { border-left: 1px solid var(--line); }
.statrow b { display: block; font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.statrow b.leaf { color: var(--leaf); } .statrow span { display: block; margin-top: 2px; font-size: 12px; color: var(--ink2); }
.note { padding: 12px 14px; border-radius: 12px; background: var(--sand); font-size: 14px; line-height: 1.5; color: #3B352C; white-space: pre-wrap; overflow-wrap: anywhere; }
.menu { padding: 6px 16px; }
.dish { padding: 18px 0; border-top: 1px solid var(--line); } .dish:first-child { border-top: 0; }
.dish-line { display: flex; align-items: baseline; gap: 8px; }
.dname { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.leader { flex: 1; min-width: 12px; height: 0; border-bottom: 2px dotted #CFC6B6; transform: translateY(-4px); }
.price { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dish .sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.review { display: flex; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--paper); }
.review .head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; } .review .who-n { font-size: 13.5px; font-weight: 700; } .review .star { width: 11px; height: 11px; }
.review .when { margin-left: auto; font-size: 12px; color: var(--ink3); }
.review .text, .comment .text { margin-top: 4px; font-size: 14px; line-height: 1.45; color: #2B261F; white-space: pre-wrap; overflow-wrap: anywhere; }
details.rf { margin-top: 12px; } details.rf > summary { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line2); background: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; list-style: none; }
details.rf > summary::-webkit-details-marker { display: none; } details.rf[open] > summary { margin-bottom: 12px; border-color: var(--ink); }
.star-input { display: flex; gap: 4px; margin-bottom: 10px; }
.star-input button { width: 40px; height: 40px; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
.star-input .star { width: 28px; height: 28px; background: var(--star-off); transition: background .1s; } .star-input button.on .star { background: var(--star); }
.adddish { margin-top: 12px; padding: 16px; border-radius: 18px; border: 1.5px dashed #CFC6B6; display: flex; flex-direction: column; gap: 10px; }
.adddish .r { display: flex; gap: 8px; } .adddish .r input:last-child { width: 120px; flex: none; }
.comment { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.comment .head { font-size: 13.5px; font-weight: 700; } .comment .when { font-weight: 400; color: var(--ink3); margin-left: 6px; font-size: 12.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------- bình chọn, thống kê ---------- */
.panel2 { display: flex; margin-top: 18px; padding: 14px 0; } .panel2 > div { flex: 1; padding-left: 16px; } .panel2 > div + div { border-left: 1px solid var(--line); }
.panel2 b { display: block; margin-top: 6px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .panel2 b.leaf { color: var(--leaf); }
.opts { display: grid; gap: 10px; margin-top: 14px; }
.opt { padding: 14px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.opt.mine { border: 2px solid var(--chili); padding: 13px; } .opt.win { border-color: var(--leaf); border-width: 2px; padding: 13px; }
.opt .head { display: flex; align-items: center; gap: 12px; }
.opt h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; } .opt h3 a { text-decoration: none; }
.opt .votes { margin-top: 3px; font-size: 13px; color: var(--ink2); } .opt .votes b { color: var(--ink); }
.opt .bar { margin-top: 12px; } .opt.mine .bar > span { background: var(--chili); }
.opt .voters { display: flex; align-items: center; margin-top: 10px; min-height: 24px; padding-left: 7px; font-size: 12.5px; color: var(--ink2); }
.opt .voters .avatar { width: 24px; height: 24px; margin-left: -7px; border: 2px solid #fff; font-size: 9.5px; }
.opt .voters .names { margin-left: 10px; }
.btn.picked { background: var(--leaf-soft); border-color: var(--leaf-soft); color: var(--leaf); }
.dark-panel { display: flex; flex-wrap: wrap; margin-top: 18px; border-radius: 18px; background: var(--ink); color: #fff; overflow: hidden; }
.dark-panel > div { flex: 1 1 0; min-width: 110px; padding: 16px 18px; } .dark-panel > div + div { border-left: 1px solid #3A342B; }
.dark-panel b { display: block; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; } .dark-panel span { display: block; margin-top: 2px; font-size: 12px; color: #CFC6B6; }
.dark-panel b.hot { color: #F0A58A; }
.rank-list { padding: 6px 16px; }
.rank { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; } .rank:first-child { border-top: 0; }
.rank .n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; background: var(--sand); color: #3B352C; }
.rank:first-child .n { background: var(--chili); color: #fff; }
.rank .nm { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 700; letter-spacing: -.01em; }
.rank .bar { margin-top: 8px; } .rank .bar > span { background: #8F8470; } .rank:first-child .bar > span { background: var(--chili); }
.rank .sub { margin-top: 6px; font-size: 12.5px; color: var(--ink2); }
.hist-list { padding: 4px 16px; }
.hist { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); } .hist:first-child { border-top: 0; }
.hist .d { flex: none; width: 56px; } .hist .d b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; } .hist .d span { font-size: 11.5px; color: var(--ink3); }
.hist .nm { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; } .hist .nm a { text-decoration: none; }
.st-cols { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }

/* ---------- vòng quay ---------- */
.wheel-layout { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
.wheel-col { display: flex; flex-direction: column; align-items: center; }
.wheel-wrap { position: relative; margin-top: 18px; line-height: 0; }
.wheel-wrap canvas { display: block; border-radius: 50%; filter: drop-shadow(0 10px 22px rgba(31,27,22,.22)); touch-action: manipulation; }
.pointer { position: absolute; z-index: 2; left: 50%; top: -6px; margin-left: -11px; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 26px solid var(--ink); }
.wheel-col .info { margin-top: 12px; font-size: 13px; color: var(--ink2); text-align: center; }
.spin { margin-top: 12px; width: 100%; max-width: 440px; font-weight: 800; letter-spacing: .02em; font-size: 17px; min-height: 58px; border-radius: 16px; box-shadow: 0 8px 20px rgba(194,59,18,.3); }
.result { margin-top: 18px; padding: 18px; border-radius: 20px; background: #fff; border: 2px solid var(--leaf); animation: pop .3s ease-out; }
.result .lbl { color: var(--leaf); } .result h2 { margin-top: 8px; font-size: 26px; letter-spacing: -.025em; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.filters { margin-top: 16px; padding: 16px 18px; }
.filters .hd { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 700; }
.filters .reset { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--chili); cursor: pointer; }
.filters .sep { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.filters .sep .t { margin-bottom: 10px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.filters .chip { background: var(--ink); border-color: var(--ink); color: #fff; min-height: 34px; font-size: 13px; }
.filters .chip.off { background: #fff; border-color: var(--line2); color: var(--ink3); }
.sel { position: relative; } .sel select { appearance: none; padding-right: 38px; } .sel .i { position: absolute; right: 13px; top: 17px; width: 16px; height: 16px; color: var(--ink3); pointer-events: none; }

/* ---------- đăng nhập ---------- */
body:not(.authed) main { padding: 0 0 40px; max-width: none; }
.auth { max-width: 460px; margin: 0 auto; }
.auth-hero { position: relative; overflow: hidden; padding: calc(28px + env(safe-area-inset-top, 0px)) 28px 40px; border-radius: 0 0 36px 36px; background: var(--chili); color: #fff; }
.auth-hero .c1, .auth-hero .c2, .auth-hero .c3 { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-hero .c1 { right: -90px; top: -70px; width: 300px; height: 300px; border: 1.5px solid rgba(255,255,255,.22); }
.auth-hero .c2 { right: -30px; top: -10px; width: 180px; height: 180px; border: 1.5px solid rgba(255,255,255,.22); }
.auth-hero .c3 { right: 30px; top: 50px; width: 60px; height: 60px; background: rgba(255,255,255,.12); }
.auth-hero .mark { background: #fff; color: var(--chili); width: 36px; height: 36px; border-radius: 11px; }
.auth-hero .brand { position: relative; color: #fff; } .auth-hero .wordmark span { color: rgba(255,255,255,.8); }
.auth-hero h1 { position: relative; margin-top: 56px; font-size: 41px; line-height: 1.05; letter-spacing: -.03em; }
.auth-hero p { position: relative; margin-top: 14px; max-width: 300px; font-size: 15px; line-height: 1.5; color: #FBE3D8; }
.auth-card { padding: 26px 28px 0; }
.seg { display: flex; padding: 4px; border-radius: 14px; background: #E9E2D4; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 11px; background: none; font-size: 14.5px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(31,27,22,.12); }
.field-pw { position: relative; } .field-pw input { padding-right: 70px; }
.field-pw button { position: absolute; right: 8px; top: 7px; min-height: 36px; padding: 0 10px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--chili); cursor: pointer; }
.auth-card .note2 { margin-top: 18px; text-align: center; font-size: 13px; line-height: 1.5; color: var(--ink2); }

/* ---------- hộp thoại thêm quán ---------- */
dialog { border: 0; padding: 10px 20px calc(20px + var(--safe-b)); width: 100%; max-width: none; max-height: 92vh; margin: auto 0 0; overflow-y: auto; border-radius: 26px 26px 0 0; background: #FBF9F5; color: var(--ink); box-shadow: 0 -10px 50px rgba(0,0,0,.25); animation: sheet .25s ease-out; }
dialog::backdrop { background: rgba(31,27,22,.55); }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
dialog .grab { width: 40px; height: 5px; border-radius: 3px; background: #CFC6B6; margin: 0 auto 14px; }
dialog .dh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
dialog .dh h2 { font-size: 22px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #DCD3C3; background: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; }
dialog .foot { display: flex; gap: 10px; margin-top: 20px; } dialog .foot .btn:first-child { flex: none; width: 110px; } dialog .foot .btn:last-child { flex: 1; }

#toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 30px); opacity: 0; visibility: hidden; pointer-events: none; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; transition: transform .25s, opacity .25s, visibility .25s; max-width: 90vw; z-index: 60; text-align: center; }
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- máy tính ---------- */
@media (min-width: 900px) {
  body.authed .tabbar, .fab, .back-fab { display: none !important; }
  .desk { display: inline-flex !important; }
  .top { background: #fff; border-bottom: 1px solid var(--line); }
  body:not(.authed) .top { display: none; }
  .top-in { padding: 14px 32px; gap: 28px; }
  .mark { width: 36px; height: 36px; } .wordmark { font-size: 18px; }
  .topnav { display: flex; gap: 4px; margin-right: auto; margin-left: 0; }
  .brand { margin-right: 0; }
  .navlink { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink2); text-decoration: none; }
  .navlink .i { width: 18px; height: 18px; } .navlink:hover { background: var(--paper); } .navlink.on { background: var(--ink); color: #fff; }
  .who { display: block; font-size: 14px; font-weight: 600; } .top-in .logout { display: inline-flex; }
  button.avatar { cursor: pointer; }
  .pop { display: none !important; }
  main { padding: 0 32px 64px; }
  h1 { font-size: 46px; line-height: 1.06; letter-spacing: -.03em; }
  .page-title { margin-top: 44px; } .page-title p.sub { font-size: 16px; line-height: 1.55; max-width: 460px; }
  h2 { font-size: 26px; letter-spacing: -.025em; }
  .sec-head { margin-top: 40px; }

  .home-hero { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 40px; align-items: stretch; }
  .home-hero .page-title { flex: 1 1 420px; margin-top: 0; display: flex; flex-direction: column; justify-content: center; }
  .home-hero h1 { font-size: 52px; }
  .banner { flex: 1 1 440px; margin-top: 0; padding: 24px 26px; border-radius: 22px; }
  .banner .big { font-size: 26px; letter-spacing: -.02em; } .banner .sub { font-size: 14px; } .banner .go { min-height: 48px; padding: 0 24px; border-radius: 14px; font-size: 15px; }
  .toolbar { margin-top: 36px; gap: 12px; }
  .search { flex: 1 1 220px; min-height: 50px; }
  .toolbar .chips { flex: 0 1 auto; margin: 0; padding: 0; overflow: visible; flex-wrap: wrap; } .toolbar .chip { min-height: 38px; padding: 0 16px; font-size: 14px; }
  .toolbar .btn { min-height: 50px; padding: 0 22px; border-radius: 14px; }
  .plist { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-top: 22px; }
  .pcard { padding: 16px; gap: 16px; border-radius: 20px; } .pcard h3 { font-size: 18px; }
  .tile.s-md { width: 92px; height: 92px; font-size: 28px; border-radius: 16px; }

  .back-link { display: inline-flex; margin-top: 28px; }
  .pd-head { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; margin-top: 0; }
  .pd-coverwrap { flex: none; width: 200px; height: 200px; margin: 0; border-radius: 24px; overflow: hidden; } .pd-cover { font-size: 64px; }
  .pd-info { flex: 1 1 420px; margin: 0; padding: 0; background: none; border-radius: 0; }
  .pd-info h1 { font-size: 46px; } .pd-info .lines { flex-direction: row; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
  body[data-page=place] .top { display: block; }
  .pd-actions { margin-top: 20px; } .pd-actions .btn { flex: 0 0 auto; min-height: 50px; padding: 0 24px; border-radius: 14px; font-size: 15px; }
  .photo img, .photo-add { width: 132px; height: 96px; } .photos { margin-top: 24px; }
  .a-stats { grid-area: stats; } .a-note { grid-area: note; } .a-menu { grid-area: menu; } .a-comments { grid-area: comments; }
  .pd-cols { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "menu stats" "menu note" "menu comments"; grid-template-rows: auto auto 1fr; column-gap: 32px; margin-top: 40px; align-items: start; }
  .statrow { padding: 18px 0; } .statrow b { font-size: 28px; }
  .menu { padding: 6px 24px; } .dish { padding: 22px 0; } .dname { font-size: 19px; } .price { font-size: 17px; }
  .a-menu .sec-head { margin-top: 0; } .a-comments { margin-top: 2px; }

  .panel2 > div { padding-left: 20px; }
  .opts { max-width: 760px; }
  .dark-panel { margin-top: 28px; border-radius: 22px; } .dark-panel > div { padding: 26px 30px; } .dark-panel b { font-size: 48px; letter-spacing: -.04em; } .dark-panel span { font-size: 14px; margin-top: 8px; }
  .st-cols { grid-template-columns: minmax(0, 1fr) 420px; column-gap: 32px; align-items: start; }
  .rank-list { padding: 6px 24px; } .rank { gap: 16px; padding: 20px 0; } .rank .n { width: 36px; height: 36px; font-size: 16px; } .rank .nm { font-size: 17.5px; } .rank .bar { height: 7px; }
  .hist-list { padding: 6px 22px; } .hist { padding: 16px 0; gap: 14px; } .hist .d { width: 62px; }

  .wheel-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; align-items: start; margin-top: 32px; }
  .wheel-wrap { margin-top: 24px; } .pointer { border-left-width: 13px; border-right-width: 13px; border-top-width: 30px; margin-left: -13px; }
  .spin { min-height: 60px; font-size: 18px; } .wheel-side .result { margin-top: 0; padding: 26px; border-radius: 24px; } .result h2 { font-size: 36px; }
  .filters { padding: 22px 24px; border-radius: 24px; }

  .auth { max-width: 940px; margin: 8vh auto 0; display: grid; grid-template-columns: 1fr 1fr; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
  .auth-hero { border-radius: 0; padding: 40px 40px 48px; } .auth-hero h1 { font-size: 52px; margin-top: 110px; } .auth-hero p { max-width: 340px; font-size: 16px; }
  .auth-card { padding: 40px 44px; align-self: center; }
  dialog { width: 520px; max-width: calc(100vw - 32px); margin: auto; border-radius: 24px; padding: 24px 28px; animation: pop .2s ease-out; } dialog .grab { display: none; }
  #toast { bottom: 28px; }
}

/* ---------- hồ sơ nhân viên, danh bạ ---------- */
img.avatar { display: block; object-fit: cover; background: var(--sand); flex: none; }
button.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
button.avatar { overflow: hidden; }
.avatar.md { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }
.profile-grid { display: grid; gap: 14px; margin-top: 18px; grid-template-columns: minmax(0, 1fr); }
.profile-photo { display: flex; gap: 16px; align-items: center; }
.team { display: grid; gap: 10px; margin-top: 12px; }
.person { display: flex; gap: 14px; align-items: center; padding: 14px; }
.pname { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tel { color: var(--chili); font-weight: 600; text-decoration: none; } .tel:hover { text-decoration: underline; }
.seg button { font-family: inherit; }
@media (min-width: 900px) {
  .profile-grid { grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 28px; }
  .profile-photo { flex-direction: column; text-align: center; padding: 28px 24px; }
  .profile-photo .actions { justify-content: center; }
  .team { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; }
  .person { padding: 18px; gap: 16px; }
  .avatar.md { width: 64px; height: 64px; font-size: 20px; }
  .toolbar .search { max-width: 520px; }
}

/* header máy tính: không để tên dài làm vỡ bố cục, rút gọn khi màn hình vừa */
@media (min-width: 900px) {
  .who { white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  .navlink { white-space: nowrap; }
  .topnav { flex-wrap: nowrap; }
}
@media (min-width: 900px) and (max-width: 1279px) {
  .top-in { gap: 14px; padding-left: 20px; padding-right: 20px; }
  .navlink { padding: 0 11px; gap: 6px; }
  .who { display: none; }
}
@media (min-width: 900px) and (max-width: 1019px) {
  .wordmark span { display: none; }
}

/* ---------- tổng kết chi tiêu, ngân hàng ---------- */
.tag.warn { background: #FBE9DD; color: #9A3412; }
.seg[role=tablist] { max-width: 420px; }
.spend-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.monthnav { display: flex; align-items: center; gap: 10px; } .monthnav b { min-width: 104px; text-align: center; font-size: 16px; }
.iconbtn:disabled { opacity: .4; cursor: default; }
.dark-panel.g4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.dark-panel.g4 > div { padding: 16px 18px; min-width: 0; } .dark-panel.g4 > div:nth-child(2n) { border-left: 1px solid #3A342B; } .dark-panel.g4 > div:nth-child(n+3) { border-top: 1px solid #3A342B; }
.dark-panel.g4 b { font-size: 24px; overflow-wrap: anywhere; }
.sp-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.debt + .debt { margin-top: 10px; }
.debt-head { display: flex; align-items: center; gap: 12px; } .debt-head .pname { font-size: 17px; }
.debt-amt { flex: none; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--chili); } .debt-amt.in { color: var(--leaf); }
.bankbox { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--paper); }
.bank-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; } .bank-info .lbl { display: block; margin-bottom: 2px; } .bank-info b { font-weight: 700; overflow-wrap: anywhere; }
.acct { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .acct b { font-size: 18px; letter-spacing: .02em; }
.qr { display: block; width: 120px; height: 120px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.qr.ph { display: grid; place-items: center; color: var(--ink3); background: var(--paper); border-style: dashed; }
.qr-link { flex: none; line-height: 0; }
.qrbox { display: flex; gap: 14px; align-items: center; }
.qrbox .hint { margin-top: 8px; }
.form-sec { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); } .form-sec h2 { font-size: 18px; }
.meals { display: grid; gap: 10px; }
.meal summary { display: flex; gap: 12px; align-items: center; padding: 14px; cursor: pointer; list-style: none; } .meal summary::-webkit-details-marker { display: none; }
.meal[open] summary { border-bottom: 1px solid var(--line); }
.md-day { flex: none; width: 52px; text-align: center; } .md-day b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; } .md-day span { font-size: 11.5px; color: var(--ink3); }
.mname { font-size: 16px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mamt { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; } .mamt b { font-size: 16px; }
.mbody { padding: 6px 14px 14px; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; } .mrow:first-child { border-top: 0; }
.mn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14.5px; min-width: 120px; }
.pick { max-height: 290px; overflow-y: auto; border: 1px solid var(--line2); border-radius: 13px; background: #fff; }
.pk { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; color: var(--ink); font-size: 14.5px; font-weight: 500; } .pk:first-child { border-top: 0; } .pk.on { background: color-mix(in srgb, var(--leaf-soft) 55%, #fff); }
.pk input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--leaf); }
.pkn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input.amt { width: 120px !important; min-height: 40px !important; padding: 0 10px !important; text-align: right; font-size: 15px !important; }
.sel select, dialog select { min-height: 50px; }
@media (min-width: 900px) {
  .dark-panel.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dark-panel.g4 > div { padding: 24px 26px; } .dark-panel.g4 > div:nth-child(2n) { border-left: 0; } .dark-panel.g4 > div:nth-child(n+3) { border-top: 0; } .dark-panel.g4 > div + div { border-left: 1px solid #3A342B; }
  .dark-panel.g4 b { font-size: 34px; }
  .sp-cols { grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "meals debts" "meals top"; grid-template-rows: auto 1fr; column-gap: 32px; align-items: start; }
  .sp-debts { grid-area: debts; } .sp-meals { grid-area: meals; } .sp-top { grid-area: top; }
  .sp-debts .sec-head, .sp-meals .sec-head, .sp-top .sec-head { margin-top: 32px; }
  .meal summary { padding: 16px 18px; } .mbody { padding: 6px 18px 16px; }
  dialog .row2 > * { flex: 1 1 200px; }
}
@media (min-width: 900px) {
  .top-in { gap: 20px; }
  .navlink { padding: 0 14px; }
  .wordmark, .top-in .logout { white-space: nowrap; }
}
/* màn hình vừa: mục menu không được chọn chỉ hiện icon (nhãn vẫn đọc được bằng trình đọc màn hình) */
@media (min-width: 900px) and (max-width: 1099px) {
  .navlink:not(.on) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .navlink:not(.on) { padding: 0 12px; }
}
