/* 共用样式：POS / 后厨 / 管理后台三端的"控制台"外壳（侧边栏 + 卡片 + 表格 + 表单控件）
   都长得像同一个系统的不同页面，而不是三套互不相干的皮肤——三端各自的 layout.html
   只负责自己的侧边栏导航项和页头文案，视觉语言统一放在这一份样式表里，改一处
   全局生效，不用三个文件分别改一遍。原来这段样式是从四端分离之前的 admin/layout.html
   搬过来的，内容不变，只是换了个能被多个模板共用的地方。 */
:root { --accent: #16a34a; --accent-dark: #0f7a37; --accent-bg: #eafaf0; --bg: #f5f6f8; --border: #ebebe8;
        font-size: 14px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
       background: var(--bg); color: #222; }
.shell { display: flex; min-height: 100vh; }

.sidebar { width: 226px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border);
           display: flex; flex-direction: column;
           position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 0.55rem; padding: 1.05rem 1.2rem;
                   border-bottom: 1px solid var(--border); text-decoration: none; color: #1a1a1a; }
.sidebar .brand .logo { width: 25px; height: 25px; border-radius: 6px; background: var(--accent);
                         color: #fff; display: flex; align-items: center; justify-content: center;
                         font-size: 0.85rem; font-weight: 800; letter-spacing: -0.02em; flex-shrink: 0; }
.sidebar .brand .name { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; }

.store-switcher { padding: 0.7rem 1.2rem; border-bottom: 1px solid var(--border); }
.store-switcher-label { font-size: 0.7rem; color: #9c9c96; text-transform: uppercase;
                         letter-spacing: 0.05em; margin-bottom: 0.32rem; }
.store-switcher select { width: 100%; font-size: 0.88rem; padding: 0.34rem 0.4rem; border: 1px solid var(--border);
                          border-radius: 6px; background: #fafafa; color: #333; }

.sidebar nav { padding: 0.5rem 0.55rem; flex: 1; }
.sidebar .nav-group-label { font-size: 0.72rem; color: #9c9c96; text-transform: uppercase;
                             letter-spacing: 0.05em; padding: 0.85rem 0.7rem 0.3rem; }
.sidebar .nav-item { display: flex; align-items: center; gap: 0.55rem; padding: 0.52rem 0.7rem;
                      color: #444; text-decoration: none; font-size: 0.92rem; border-radius: 8px;
                      border-left: 3px solid transparent; margin-bottom: 0.05rem; }
.sidebar .nav-icon { width: 17px; height: 17px; flex-shrink: 0; color: inherit; }
.sidebar .nav-icon svg { width: 100%; height: 100%; display: block; }
.sidebar .nav-item:hover { background: #f4f5f3; }
.sidebar .nav-item.active { color: var(--accent-dark); border-left-color: var(--accent);
                             background: var(--accent-bg); font-weight: 600; }
.sidebar .nav-badge { margin-left: auto; background: #e0342a; color: #fff; font-size: 0.68rem;
                       font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 999px; }

.sidebar-user { padding: 0.75rem 1.2rem; border-top: 1px solid var(--border); font-size: 0.8rem; }
.sidebar-user .who { color: #444; margin-bottom: 0.4rem; }
.sidebar-user .who .role { color: #9c9c96; font-size: 0.74rem; }
.sidebar-user button.btn { width: 100%; }
.sidebar-shortcuts { padding: 0.55rem 1.2rem 0.65rem; border-top: 1px solid var(--border); }
.sidebar-shortcuts .shortcuts-label { font-size: 0.68rem; color: #c0c0b8; text-transform: uppercase;
                                       letter-spacing: 0.05em; margin-bottom: 0.38rem; }
.sidebar-shortcuts a { display: block; font-size: 0.78rem; color: #b0b0a8; text-decoration: none;
                        padding: 0.22rem 0; }
.sidebar-shortcuts a:hover { color: #555; text-decoration: underline; }
.back-to-admin { display: block; padding: 0.55rem 1.2rem; font-size: 0.8rem;
                  color: #3a5a8c; text-decoration: none; border-top: 1px solid var(--border); }
.back-to-admin:hover { background: #f0f4fc; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 0.8rem 1.6rem;
          font-size: 0.88rem; color: #555; }
.content { padding: 1.4rem 1.6rem 3rem; }
.card { background: #fff; border-radius: 8px; padding: 1.15rem 1.4rem; margin-bottom: 1.2rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
h1 { font-size: 1.02rem; margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #eee; }
th { color: #888; font-weight: 500; }
.muted { color: #999; }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.74rem; }
.badge.on { background: #e6f4ea; color: #1e7d34; }
.badge.off { background: #f3f3f0; color: #999; }
/* 门店记账模块（2026-10-21）钱箱核对差额分级，5€/50€ 两档阈值对应的三种颜色 */
.badge.green { background: #e6f4ea; color: #1e7d34; }
.badge.yellow { background: #fff7e0; color: #92720c; }
.badge.red { background: #fdeceb; color: #b3261e; }
.status-pill { display: inline-block; padding: 0.14rem 0.55rem; border-radius: 999px;
                font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.status-pill.s-pending { background: #eef1f5; color: #5b6472; }
.status-pill.s-preparing { background: #fff4e0; color: #a15c00; }
.status-pill.s-served { background: #e6f0ff; color: #1a56b0; }
.status-pill.s-paid { background: #e6f4ea; color: #1e7d34; }
.status-pill.s-cancelled { background: #fdeceb; color: #b3261e; }
.status-pill.s-dining { background: #fff4e0; color: #a15c00; }
.status-pill.s-free { background: #f3f3f0; color: #999; }
form.inline { display: inline; }
.btn { border: 1px solid #ddd; background: #fff; border-radius: 5px; padding: 0.25rem 0.6rem;
       font-size: 0.78rem; cursor: pointer; color: #333; text-decoration: none; display: inline-block; }
.btn:hover { background: #f2f2f0; }
.btn.danger { color: #b3261e; border-color: #f0d0cd; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
select, input[type=text], input[type=number], input[type=password], input[type=date] { padding: 0.4rem 0.5rem; border: 1px solid #ddd;
       border-radius: 5px; font-size: 0.85rem; }
.flash { padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.85rem; }
.flash.success { background: #e6f4ea; color: #1e7d34; }
.flash.error { background: #fdeceb; color: #b3261e; }
.form-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.6rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 1rem; }
.stat-box { background: #fff; border-radius: 8px; padding: 1rem 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stat-box .num { font-size: 1.4rem; font-weight: 700; }
.stat-box .label { font-size: 0.76rem; color: #888; margin-top: 0.2rem; }
.filter-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.9rem; }

/* 结账页找零提示 */
.change-due-row { margin-top: 0.7rem; font-size: 1.15rem; font-weight: 700; }

/* 桌台看板：九宫格卡片，每张卡片自己带状态、金额和操作。左边一条竖条用颜色区分
   三种大类状态：绿色=空闲可用，琥珀色=有台账在用，灰色=已停用。 */
.table-grid-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
                     gap: 0.9rem; margin-top: 0.8rem; }
.table-card { border: 1px solid var(--border); border-left: 4px solid transparent; border-radius: 10px;
              padding: 0.85rem 0.9rem 0.85rem 0.78rem; background: #fff; display: flex;
              flex-direction: column; gap: 0.5rem; min-height: 152px; }
.table-card.tc-free { border-left-color: var(--accent); }
.table-card.tc-occupied { border-left-color: #d97706; }
.table-card.is-disabled { background: #fafaf9; border-left-color: #d8d8d4; }
.table-card.is-disabled .tc-no { color: #aaa; }
.table-card[data-href] { cursor: pointer; }
.table-card[data-href]:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: #d6d6d1; }
.table-card[data-href]:hover.tc-free { border-left-color: var(--accent); }
.table-card[data-href]:hover.tc-occupied { border-left-color: #d97706; }
.tc-head { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; }
.tc-no { font-size: 1.18rem; font-weight: 700; cursor: default; }
.tc-total { font-size: 0.82rem; color: #555; }
.tc-timer { font-size: 0.76rem; color: #999; white-space: nowrap; }
.tc-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tc-actions .btn { flex: 1; text-align: center; padding: 0.32rem 0.4rem; white-space: nowrap; }
.tc-actions form { margin: 0; flex: 1; display: flex; }
.tc-actions form .btn { width: 100%; }

.tc-more { position: relative; }
.tc-more-btn { border: none; background: none; font-size: 1.15rem; line-height: 1; color: #999;
               cursor: pointer; padding: 0.25rem 0.55rem; border-radius: 6px; }
.tc-more-btn:hover { background: #f2f2f0; color: #555; }
.tc-more-menu { display: none; position: absolute; right: 0; top: 100%; margin-top: 0.3rem;
                 background: #fff; border: 1px solid var(--border); border-radius: 8px;
                 box-shadow: 0 4px 14px rgba(0,0,0,0.14); min-width: 96px; z-index: 5; overflow: hidden; }
.tc-more.open .tc-more-menu { display: block; }
.tc-more-menu form { margin: 0; }
.tc-more-item { display: block; width: 100%; text-align: left; border: none; background: none;
                padding: 0.5rem 0.75rem; font-size: 0.8rem; color: #333; cursor: pointer;
                text-decoration: none; }
.tc-more-item:hover { background: #f4f5f3; }

/* 点单页（POS 内嵌 / 后厨看板都会用到类似的分类列表 + 加减号购物车样式） */
.menu-cat-title { font-size: 0.78rem; font-weight: 700; color: #999; text-transform: uppercase;
                   letter-spacing: 0.04em; margin: 1.1rem 0 0.2rem; }
.menu-cat-title:first-of-type { margin-top: 0.1rem; }
.menu-cat-group { border-top: 1px solid #f0f0ed; }
.dish-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
            padding: 0.7rem 0; border-bottom: 1px solid #eee; }
.dish-row:last-child { border-bottom: none; }
.dish-name { font-size: 0.9rem; flex: 1; }
.dish-price { color: #666; font-size: 0.82rem; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.stepper-btn { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid var(--border);
               background: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; color: #333; padding: 0; }
.stepper-btn:hover { background: #f2f2f0; }
.qty-input { width: 1.7rem; padding: 0; border: none; text-align: center; font-size: 0.92rem;
             background: transparent; color: #222; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.order-submit-bar { display: flex; justify-content: space-between; align-items: center;
                     margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }

/* 后厨看板：单张订单卡片，比桌台卡片更强调"菜品明细"而不是金额——厨房要看到
   具体做什么，不是收多少钱。 */
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 1rem; margin-top: 0.8rem; }
.kds-card { border: 1px solid var(--border); border-left: 5px solid #d97706; border-radius: 10px;
            background: #fff; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.kds-card.s-submitted { border-left-color: #5b6472; }
.kds-card .kds-head { display: flex; justify-content: space-between; align-items: baseline; }
.kds-card .kds-table { font-size: 1.1rem; font-weight: 700; }
.kds-card .kds-items { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.kds-card .kds-items li { display: flex; justify-content: space-between; padding: 0.2rem 0; }
.kds-card .kds-items .qty { color: #888; margin-left: 0.4rem; }

@media (max-width: 720px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; overflow-x: auto; border-right: none;
               border-bottom: 1px solid var(--border); }
    .sidebar .brand, .store-switcher, .sidebar .nav-group-label { display: none; }
    .sidebar nav { display: flex; padding: 0.4rem; }
    .sidebar .nav-item { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap;
                          border-radius: 6px; }
    .sidebar .nav-item.active { border-left-color: transparent; border-bottom-color: var(--accent); }
}
