/* Website Admin FOODBEST — CSS thuần, không cần build. Tông xanh lá theo mockup. */
:root {
  --primary-dark: #0f3b23; --primary: #17803f; --accent: #f2c94c; --surface: #f3f8f4; --mint: #ddebe1;
  --border: #d5e3d9; --muted: #5b6b60; --danger: #b93815; --danger-bg: #fbe3dc; --warn-bg: #faf3dc; --text: #16251b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; background: var(--surface); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 232px; background: var(--primary-dark); color: #fff; padding: 18px 12px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .5px; padding: 4px 10px 18px; }
.brand small { display: block; font-weight: 400; font-size: 12px; opacity: .7; letter-spacing: 0; }
.nav a { display: block; color: #d9ebe0; padding: 9px 12px; border-radius: 10px; margin-bottom: 2px; font-weight: 600; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }
.nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .55; padding: 14px 12px 4px; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--border); }
.topbar .who { color: var(--muted); font-size: 14px; } .topbar .who strong { color: var(--text); }
.content { padding: 24px; max-width: 1180px; }
h1 { font-size: 22px; margin: 0 0 4px; color: var(--primary-dark); } .sub { color: var(--muted); margin: 0 0 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.grid { display: grid; gap: 14px; } .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], input[type=date], input[type=datetime-local], select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(23,128,63,.35); border-color: var(--primary); }
textarea { min-height: 72px; resize: vertical; }
.field { margin-bottom: 12px; } .hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.error { color: var(--danger); font-size: 13px; margin-top: 3px; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; background: var(--primary); color: #fff; }
.btn:hover { filter: brightness(1.08); text-decoration: none; } .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--mint); color: var(--primary-dark); } .btn.danger { background: var(--danger); } .btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; background: #fff; }
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow-x: auto; margin-bottom: 16px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: #fafcfa; } tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--mint); color: var(--primary-dark); }
.badge.warn { background: var(--accent); } .badge.danger { background: var(--danger-bg); color: var(--danger); } .badge.muted { background: #eceeed; color: var(--muted); }
.alert { padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; background: var(--mint); color: var(--primary-dark); } .alert.error { background: var(--danger-bg); color: var(--danger); } .alert.warn { background: var(--warn-bg); color: #6b5100; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; } .toolbar > * { flex: 0 1 auto; } .toolbar .grow { flex: 1 1 240px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,59,35,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 720px; padding: 22px; } .modal h2 { margin: 0 0 14px; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 12px 0; } .pager .info { color: var(--muted); font-size: 13px; padding: 0 8px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--primary-dark); }
.login-card { background: #fff; border-radius: 20px; padding: 28px; width: 100%; max-width: 380px; } .login-card h1 { text-align: center; margin-bottom: 18px; }
.muted { color: var(--muted); } .right { text-align: right; } .mt { margin-top: 14px; } .nowrap { white-space: nowrap; }
@media (max-width: 860px) {
  .layout { flex-direction: column; } .sidebar { width: 100%; height: auto; position: static; padding: 10px; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; } .nav a { margin: 0; } .nav .group { display: none; }
  .content { padding: 14px; } .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; } .tabs button { border: 1px solid var(--border); background: #fff; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; } .tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rule-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface); border-radius: 8px; padding: 8px; font-size: 12px; margin: 4px 0 0; }
.lang-switch { display: inline-block; margin: 0 8px 0 0; } .lang-switch select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.login-wrap { flex-direction: column; gap: 12px; } .login-wrap .lang-switch { margin: 0; }

/* ---- Tổng quan: thẻ chỉ số có biểu tượng và biểu đồ SVG ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--primary); }
.kpi .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi .ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi .label { font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--muted); text-transform: uppercase; }
.kpi .num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.ico.green { background: #e3f3e8; color: #17803f; } .ico.amber { background: #fdf3d6; color: #8a6a12; } .ico.blue { background: #e1edf9; color: #2563a8; }
.ico.purple { background: #ece6fb; color: #6d3fd1; } .ico.red { background: #fbe4e4; color: #c23b3b; } .ico.teal { background: #dff3f1; color: #1b7f78; }
.chart-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 16px; margin-bottom: 16px; }
.chart-grid.even { grid-template-columns: 1fr 1fr; }
.card .chart-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; } .card .chart-sub { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.donut { width: 210px; max-width: 100%; transform: none; }
.donut circle[data-key] { transition: stroke-width .15s; } .donut circle[data-key]:hover { stroke-width: 6.5; }
.donut .donut-total { font-size: 7px; font-weight: 800; fill: #1b2a21; } .donut .donut-sub { font-size: 2.6px; fill: #6b7a72; }
.legend { list-style: none; margin: 0; padding: 0; width: 100%; border-top: 1px dashed var(--border); padding-top: 10px; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; }
.legend .name { flex: 1; } .legend .val { font-weight: 700; font-variant-numeric: tabular-nums; } .legend .val small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend.inline { display: flex; flex-wrap: wrap; gap: 14px; border: 0; padding: 4px 0 0; width: auto; font-size: 13px; } .legend.inline span { display: inline-flex; align-items: center; gap: 6px; }
.chart-wrap { width: 100%; } .columns { width: 100%; height: auto; display: block; }
.columns .grid { stroke: #e3e9e5; stroke-width: 1; stroke-dasharray: 3 3; } .columns .axis { font-size: 11px; fill: #6b7a72; } .columns .val { font-size: 11px; font-weight: 700; fill: #3b4a42; }
.columns rect { transition: opacity .15s; } .columns rect:hover { opacity: .8; }
@media (max-width: 900px) { .chart-grid, .chart-grid.even { grid-template-columns: 1fr; } }

/* Ô nhập cùng chiều cao với ô tìm kiếm (ô ngày của trình duyệt mặc định thấp hơn); nhãn và ô thẳng hàng trong thanh lọc. */
input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], input[type=date], input[type=datetime-local], select { min-height: 44px; }
input[type=date], input[type=datetime-local] { font-family: inherit; line-height: 1.4; }
.toolbar input[type=date] { min-width: 170px; }
.toolbar > div > label { display: block; margin-bottom: 4px; }

/* ---- POS bán hàng ---- */
.pos-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.pos-tab { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pos-tab.active { background: var(--primary); border-color: var(--primary); } .pos-tab.active .tab-main, .pos-tab.active .tab-x { color: #fff; }
.pos-tab .tab-main { border: 0; background: none; padding: 9px 12px; font-weight: 700; cursor: pointer; color: inherit; font: inherit; font-weight: 700; }
.pos-tab .tab-main .badge { margin-left: 4px; }
.pos-tab.add { padding: 9px 14px; font-weight: 700; cursor: pointer; color: var(--primary); }
.tab-x { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 6px 10px; color: var(--muted); }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 16px; align-items: start; }
.pos-search input { margin-bottom: 10px; }
.pos-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; color: inherit; font: inherit; font-weight: 600; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pos-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pos-card { position: relative; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 104px; font: inherit; color: inherit; }
.pos-card:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(23,128,63,.15); }
.pos-card .n { font-weight: 700; } .pos-card .s { color: var(--muted); font-size: 12px; } .pos-card .p { margin-top: auto; color: var(--primary); font-weight: 800; font-size: 17px; }
.pos-card .inq { position: absolute; top: 8px; right: 8px; background: var(--primary); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: 12px; font-weight: 700; padding: 0 6px; }
.pos-empty { color: var(--muted); text-align: center; padding: 40px 18px; }
.pos-cart { position: sticky; top: 12px; }
.pos-cart h2 { margin: 0 0 10px; }
.pos-match { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 10px 12px; margin-top: 8px; cursor: pointer; font: inherit; color: inherit; }
.pos-match:hover { border-color: var(--primary); }
.pos-customer { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px dashed var(--border); margin-bottom: 8px; }
.pos-lines { max-height: 300px; overflow-y: auto; margin-bottom: 10px; }
.pos-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef2ef; }
.pos-line.bad { background: #fdf1f1; } .pos-line .info { min-width: 0; } .pos-line .sum { font-weight: 700; min-width: 70px; text-align: right; }
.pos-line .qty { display: flex; align-items: center; gap: 4px; } .pos-line .qty input { width: 62px; min-height: 34px; text-align: center; padding: 4px; }
.pos-empty-lines { text-align: center; padding: 24px 0; }
.pos-form .field { margin-bottom: 8px; }
.pos-totals > div { display: flex; justify-content: space-between; padding: 3px 0; } .pos-totals .grand { font-size: 20px; font-weight: 800; color: var(--primary); border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.pos-actions { display: flex; gap: 8px; margin-top: 12px; } .pos-actions .btn { flex: 1; padding: 13px; font-size: 16px; } .pos-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 1000px) { .pos-grid { grid-template-columns: 1fr; } .pos-cart { position: static; } }
.pos-cards .pos-none { grid-column: 1 / -1; padding: 8px 2px; } .pos-none ul { margin: 8px 0 0; padding-left: 18px; }
.pos-prepaid { border-top: 1px dashed var(--border); padding-top: 10px; } .inline-input { display: flex; gap: 6px; align-items: center; } .inline-input input { flex: 1; } .pos-totals .remain { font-weight: 700; color: var(--danger); }
.pw-wrap { position: relative; display: block; } .pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--primary); background: var(--surface); } .pw-toggle .slash { display: none; } .pw-toggle.on .slash { display: inline; }

/* ---- Logo ---- */
.brand { display: block; text-align: center; color: inherit; text-decoration: none; padding: 6px 10px 16px; }
.brand img { display: block; width: 150px; max-width: 100%; height: auto; margin: 0 auto 8px; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.brand small { display: block; margin-top: 2px; }
.login-logo { text-align: center; margin: -6px 0 6px; } .login-logo img { width: 200px; max-width: 70%; height: auto; border-radius: 16px; }
.login-card h1 { font-size: 20px; margin-bottom: 14px; }
