/* ═══════════════════════════════════════════
   WCO Admin Panel — App-like UI
   Mobile First · Full Screen · Animated
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-dark:     #1c1917;
    --bg-dark2:    #292524;
    --bg-dark3:    #3c2415;
    --accent:      #f59e0b;
    --accent-dim:  #b45309;
    --accent-bg:   rgba(245,158,11,.12);
    --surface:     #ffffff;
    --surface2:    #f8f7f5;
    --text:        #1c1917;
    --text-muted:  #78716c;
    --text-light:  #a8a29e;
    --border:      #e7e5e4;
    --success:     #22c55e;
    --warning:     #f59e0b;
    --danger:      #ef4444;
    --info:        #3b82f6;
    --radius-sm:   8px;
    --radius:      14px;
    --radius-lg:   20px;
    --shadow:      0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
    --shadow-md:   0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:   0 12px 40px rgba(0,0,0,.18);
    --bottom-h:    68px;
    --top-h:       56px;
    --sb-w:        256px;
    --transition:  .28s cubic-bezier(.4,0,.2,1);
}

/* ── Root 全螢幕 App 容器 ── */
#wco-panel-root {
    position: fixed; inset: 0; z-index: 99999;
    font-family: -apple-system, 'Noto Sans TC', BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 15px; color: var(--text); line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    background: var(--bg-dark);
}

/* ══════════════════════════════
   SPLASH / LOGIN
══════════════════════════════ */
.wco-login-screen {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #1c1917 0%, #3c2415 60%, #1c1917 100%);
    padding: 24px;
    z-index: 10;
}
.wco-login-box {
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-lg);
    padding: 36px 28px 32px;
    width: 100%; max-width: 360px;
    box-shadow: var(--shadow-lg);
}
.wco-login-logo { text-align: center; margin-bottom: 32px; }
.wco-login-icon {
    display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.wco-login-icon svg {
    width: 52px; height: 52px; color: var(--accent);
    filter: drop-shadow(0 4px 12px rgba(245,158,11,.4));
}
.wco-login-logo h1 { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.wco-login-logo p  { color: var(--text-light); font-size: 13px; margin-top: 4px; }
.wco-login-box .wco-form-group label { color: rgba(255,255,255,.7); }
.wco-login-box .wco-input {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
    color: #fff;
}
.wco-login-box .wco-input::placeholder { color: rgba(255,255,255,.3); }
.wco-login-box .wco-input:focus { border-color: var(--accent); background: rgba(255,255,255,.12); }

/* ══════════════════════════════
   MAIN APP LAYOUT
══════════════════════════════ */
#wco-main-app {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    background: var(--surface2);
    overflow: hidden;
}

/* ── Top Header ── */
.wco-top-header {
    position: relative; z-index: 100;
    height: var(--top-h);
    background: var(--bg-dark);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0);
    flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.wco-top-header-left  { display: flex; align-items: center; gap: 10px; }
.wco-top-logo  { display:flex; align-items:center; color: var(--accent); filter: drop-shadow(0 2px 6px rgba(245,158,11,.5)); }
.wco-top-title { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
.wco-top-header-right { display: flex; align-items: center; gap: 6px; }
.wco-user-chip { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.08); border-radius: 20px; padding: 4px 10px 4px 4px; }
.wco-user-avatar-sm {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px;
}
#wco-user-name { color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600; }
.wco-icon-btn {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,.08); border: none;
    color: rgba(255,255,255,.7); cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.wco-icon-btn:active { background: rgba(255,255,255,.15); }

/* ── Sidebar (Desktop only) ── */
.wco-sidebar {
    display: none;
    width: var(--sb-w); flex-shrink: 0;
    background: var(--bg-dark);
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.05);
}
.wco-sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.wco-sidebar-logo { display:flex; align-items:center; color: var(--accent); filter: drop-shadow(0 2px 8px rgba(245,158,11,.5)); }
.wco-sidebar-title { color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wco-sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; scrollbar-width: none; }
.wco-sidebar-nav::-webkit-scrollbar { display: none; }
.wco-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 13px; border-radius: var(--radius-sm);
    color: var(--text-light); text-decoration: none; font-size: 14px;
    margin-bottom: 2px; transition: background var(--transition), color var(--transition);
    cursor: pointer; user-select: none; position: relative;
}
.wco-nav-item:hover  { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.wco-nav-item.active {
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 600;
}
.wco-nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
    width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
}
.wco-nav-icon { width: 22px; display:flex; align-items:center; justify-content:center; flex-shrink: 0; }
.wco-badge-dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; margin-left: auto; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

.wco-sidebar-footer {
    padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: center; gap: 8px;
}
.wco-user-info { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.wco-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.wco-user-name-sb { color: rgba(255,255,255,.9); font-size: 13px; font-weight: 600; }
.wco-user-role    { color: var(--text-light); font-size: 11px; }
.wco-logout-btn {
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(255,255,255,.06); border: none;
    color: var(--text-light); cursor: pointer; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.wco-logout-btn:hover { background: rgba(239,68,68,.15); color: var(--danger); }

/* ── Content Area ── */
.wco-content {
    flex: 1; overflow: hidden;
    display: flex; flex-direction: column; position: relative;
}

/* ── Section (page) ── */
.wco-section-content {
    position: absolute; inset: 0;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px calc(var(--bottom-h) + 12px + env(safe-area-inset-bottom, 0));
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.wco-section-content::-webkit-scrollbar { width: 4px; }
.wco-section-content::-webkit-scrollbar-track { background: transparent; }
.wco-section-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* 頁面切換動畫 */
.wco-section-content.slide-in-right  { animation: slideInRight var(--transition) forwards; }
.wco-section-content.slide-in-left   { animation: slideInLeft var(--transition) forwards; }
.wco-section-content.slide-out-right { animation: slideOutRight var(--transition) forwards; }
.wco-section-content.slide-out-left  { animation: slideOutLeft var(--transition) forwards; }

@keyframes slideInRight  { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideInLeft   { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOutRight { from { transform: none; opacity: 1; } to { transform: translateX(40px); opacity: 0; } }
@keyframes slideOutLeft  { from { transform: none; opacity: 1; } to { transform: translateX(-40px); opacity: 0; } }

/* ── Bottom Nav ── */
.wco-bottom-nav {
    position: relative; z-index: 100;
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0));
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--bg-dark);
    display: flex; align-items: stretch;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.wco-bottom-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4px;
    color: var(--text-light); cursor: pointer;
    border: none; background: none;
    font-size: 10px; font-weight: 600; letter-spacing: .2px;
    padding: 6px 4px;
    transition: color var(--transition);
    position: relative; -webkit-tap-highlight-color: transparent;
}
.wco-bn-icon {
    display: flex; align-items: center; justify-content: center;
    transition: transform var(--transition);
}
.wco-bottom-nav-item.active { color: var(--accent); }
.wco-bottom-nav-item.active .wco-bn-icon { transform: translateY(-1px); }
.wco-bottom-nav-item::after {
    content: '';
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 0; height: 3px;
    background: var(--accent); border-radius: 0 0 3px 3px;
    transition: width var(--transition);
}
.wco-bottom-nav-item.active::after { width: 24px; }
.wco-bottom-nav-item .wco-badge-dot { position: absolute; top: 8px; right: calc(50% - 18px); }

/* ══════════════════════════════
   DESKTOP OVERRIDES ≥1024px
══════════════════════════════ */
@media (min-width: 1024px) {
    .wco-top-header { display: none; }
    .wco-bottom-nav { display: none; }
    .wco-sidebar    { display: flex; }
    #wco-main-app   { flex-direction: row; }
    .wco-content    { flex: 1; }
    .wco-section-content { padding: 28px 32px; }
}

/* ══════════════════════════════
   CARDS
══════════════════════════════ */
.wco-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px;
}
.wco-card-header {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.wco-card-title { font-size: 15px; font-weight: 700; }
.wco-card-body  { padding: 16px; }

/* ── Page Header ── */
.wco-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.wco-page-title  { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }

/* ── Stats Grid ── */
.wco-stats-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 10px; margin-bottom: 14px;
}
.wco-stat-card {
    background: var(--surface); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.wco-stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--accent);
}
.wco-stat-card.warning::before { background: var(--warning); }
.wco-stat-card.success::before { background: var(--success); }
.wco-stat-card.info::before    { background: var(--info); }
.wco-stat-number { font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.wco-stat-label  { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
@media (min-width: 600px) { .wco-stats-grid { grid-template-columns: repeat(4, 1fr); } }

/* ══════════════════════════════
   SKELETON LOADING
══════════════════════════════ */
.wco-skeleton {
    background: linear-gradient(90deg, #f0eeec 25%, #e8e5e2 50%, #f0eeec 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.wco-skeleton-card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.wco-sk-title { height: 18px; width: 40%; margin-bottom: 12px; }
.wco-sk-line  { height: 12px; width: 100%; margin-bottom: 8px; }
.wco-sk-line.w70 { width: 70%; }
.wco-sk-line.w50 { width: 50%; }

/* ══════════════════════════════
   TABLE
══════════════════════════════ */
.wco-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wco-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
.wco-table th { background: var(--surface2); color: var(--text-muted); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px; }
.wco-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wco-table tr:last-child td { border-bottom: none; }
.wco-table tr:active td { background: var(--surface2); }
.wco-table-row-warning td { background: #fffbeb !important; }

/* ══════════════════════════════
   BADGES
══════════════════════════════ */
.wco-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.wco-badge-success { background: #dcfce7; color: #15803d; }
.wco-badge-warning { background: #fef3c7; color: #92400e; }
.wco-badge-danger  { background: #fee2e2; color: #b91c1c; }
.wco-badge-info    { background: #dbeafe; color: #1d4ed8; }
.wco-badge-neutral { background: #f3f4f6; color: #374151; }
.wco-badge-manager { background: #ede9fe; color: #6d28d9; }
.wco-badge-staff   { background: #e0f2fe; color: #0369a1; }

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */
.wco-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 20px; border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: transform .1s, opacity .15s, background .15s;
    white-space: nowrap; min-height: 46px;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -.1px;
}
.wco-btn:active:not(:disabled) { transform: scale(.97); }
.wco-btn:disabled { opacity: .45; cursor: not-allowed; }
.wco-btn-primary   { background: var(--accent); color: #1c1917; }
.wco-btn-primary:active:not(:disabled)   { background: #e09009; }
.wco-btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.wco-btn-secondary:active:not(:disabled) { background: var(--surface2); }
.wco-btn-danger    { background: var(--danger); color: #fff; }
.wco-btn-success   { background: var(--success); color: #fff; }
.wco-btn-sm { padding: 8px 13px; font-size: 12px; min-height: 36px; border-radius: var(--radius-sm); }
.wco-btn-full { width: 100%; }
.wco-btn-icon { padding: 10px; min-height: 44px; min-width: 44px; }
.wco-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ══════════════════════════════
   FORMS
══════════════════════════════ */
.wco-form-group { margin-bottom: 16px; }
.wco-form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: var(--text); }
.wco-input, .wco-select, .wco-textarea {
    width: 100%; padding: 13px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 15px; color: var(--text); background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
    outline: none; -webkit-appearance: none; appearance: none;
}
.wco-input:focus, .wco-select:focus, .wco-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.wco-input-sm { padding: 9px 11px; font-size: 13px; }
.wco-textarea  { resize: vertical; min-height: 90px; font-family: inherit; line-height: 1.6; }
.wco-form-row  { display: flex; gap: 12px; flex-wrap: wrap; }
.wco-form-row .wco-form-group { flex: 1; min-width: 130px; }
.wco-form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.wco-checkbox-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; padding: 6px 0; }
.wco-checkbox-label input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.wco-radio-group { display: flex; gap: 14px; flex-wrap: wrap; }
.wco-radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; padding: 6px 0; }
.wco-radio-label input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ══════════════════════════════
   MODAL (Bottom Sheet on Mobile)
══════════════════════════════ */
.wco-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 400; backdrop-filter: blur(2px); }
.wco-global-modal {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    z-index: 500; max-height: 94svh;
    display: flex; flex-direction: column;
    box-shadow: 0 -12px 48px rgba(0,0,0,.25);
    animation: sheetUp .3s cubic-bezier(.4,0,.2,1);
}
.wco-global-modal::before {
    content: ''; display: block; width: 36px; height: 4px;
    background: var(--border); border-radius: 2px;
    margin: 10px auto 0; flex-shrink: 0;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

.wco-global-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px 12px;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.wco-global-modal-header h3 { font-size: 17px; font-weight: 800; }
#wco-modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; padding-bottom: calc(env(safe-area-inset-bottom, 0) + 18px); }
.wco-close-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--surface2); border: none; cursor: pointer;
    color: var(--text-muted); font-size: 16px;
    display: flex; align-items: center; justify-content: center;
}
.wco-close-btn:active { background: var(--border); }

@media (min-width: 600px) {
    .wco-global-modal {
        left: 50%; bottom: auto; top: 50%;
        transform: translate(-50%, -50%);
        width: min(560px, 95vw); border-radius: var(--radius-lg);
        max-height: 90vh; animation: none;
    }
    .wco-global-modal::before { display: none; }
}

/* ══════════════════════════════
   ALERT / TOAST
══════════════════════════════ */
.wco-alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; font-weight: 500; }
.wco-alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.wco-alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.wco-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.wco-alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.wco-toast {
    position: fixed;
    bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0) + 12px);
    left: 50%; transform: translateX(-50%);
    background: #1c1917; color: #fff;
    padding: 12px 22px; border-radius: 24px;
    font-size: 14px; font-weight: 600; z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    white-space: nowrap; max-width: 90vw;
    animation: toastIn .25s cubic-bezier(.4,0,.2,1);
}
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(12px) scale(.95); } to { opacity:1; transform: translateX(-50%) translateY(0) scale(1); } }
@media (min-width: 1024px) {
    .wco-toast { bottom: 24px; left: auto; right: 24px; transform: none; border-radius: var(--radius-sm); }
    @keyframes toastIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: none; } }
}

/* ── Loading ── */
.wco-loading-full { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-muted); gap: 12px; }
.wco-spinner { width: 28px; height: 28px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tabs ── */
.wco-tabs { display: flex; border-bottom: 1.5px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.wco-tabs::-webkit-scrollbar { display: none; }
.wco-tab { flex-shrink: 0; padding: 10px 18px; border: none; background: none; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1.5px; transition: color .15s; }
.wco-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── New order banner ── */
.wco-new-order-banner {
    display: flex; align-items: center; gap: 12px;
    background: #fef3c7; border: 1.5px solid #f59e0b; border-radius: var(--radius);
    padding: 10px 16px; margin-bottom: 12px; font-weight: 600; font-size: 14px; color: #92400e;
    animation: pulse 1.5s ease infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

/* ── 桌位卡片格（active orders）── */
.wco-tables-order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 4px;
}
.wco-tcard {
    background: var(--surface); border-radius: var(--radius);
    border: 1.5px solid var(--border);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.wco-tcard-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px 10px;
    border-bottom: 1.5px solid var(--border);
    background: var(--surface2);
}
.wco-tcard-table { font-size: 16px; font-weight: 700; }
.wco-tcard-time  { font-size: 12px; color: var(--text-muted); }
.wco-tcard-items { padding: 10px 16px; flex: 1; }
.wco-tcard-row   { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.wco-tcard-row:last-child { border-bottom: none; }
.wco-tcard-row-name  { flex: 1; font-size: 13px; line-height: 1.4; }
.wco-tcard-row-price { font-size: 13px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.wco-tcard-total {
    text-align: right; padding: 10px 16px;
    font-size: 15px; font-weight: 700; color: var(--accent);
    border-top: 1.5px solid var(--border);
}
.wco-tcard-actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.wco-tcard-checkout-btn {
    flex: 1; padding: 10px; background: var(--accent); color: #fff;
    border: none; border-radius: 8px; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: opacity .15s;
}
.wco-tcard-checkout-btn:active { opacity: .8; }

/* ── Filter ── */
.wco-filter-bar { display: flex; gap: 8px; flex-wrap: nowrap; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.wco-filter-bar::-webkit-scrollbar { display: none; }
.wco-filter-btn { flex-shrink: 0; padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 700; min-height: 38px; transition: .15s; }
.wco-filter-btn.active { background: var(--accent); color: #1c1917; border-color: var(--accent); }

/* ══════════════════════════════
   ORDERS
══════════════════════════════ */
.wco-order-card {
    background: var(--surface); border-radius: var(--radius);
    margin-bottom: 10px; overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.wco-order-card-header {
    padding: 14px 16px; display: flex; align-items: center;
    justify-content: space-between; gap: 8px; cursor: pointer;
    transition: background .15s;
}
.wco-order-card-header:active { background: var(--surface2); }
.wco-order-card-chevron { color: var(--text-muted); transition: transform var(--transition); font-size: 12px; }
.wco-order-card.expanded .wco-order-card-chevron { transform: rotate(180deg); }
.wco-order-card-body { padding: 0 16px 14px; border-top: 1px solid var(--border); }
.wco-order-card-body.collapsed { display: none; }
.wco-order-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wco-order-id    { font-weight: 800; font-size: 16px; }
.wco-order-table { color: var(--text-muted); font-size: 13px; }
.wco-order-total { font-weight: 800; font-size: 16px; }
.wco-order-actions-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.wco-item-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wco-item-row:last-child { border-bottom: none; }
.wco-item-row-name { flex: 1; min-width: 120px; font-size: 14px; line-height: 1.4; }
.wco-item-row-controls { display: flex; align-items: center; gap: 5px; }
.wco-item-row-price { font-weight: 700; font-size: 14px; min-width: 52px; text-align: right; align-self: center; color: var(--accent-dim); }

/* ══════════════════════════════
   MENU IMPORT
══════════════════════════════ */
.wco-import-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 44px 20px; text-align: center; background: var(--surface2);
    cursor: pointer; transition: border-color .15s;
}
.wco-import-zone:active, .wco-import-zone.drag-over { border-color: var(--accent); background: var(--accent-bg); }
.wco-import-zone-icon { font-size: 48px; margin-bottom: 12px; }
.wco-import-zone p { color: var(--text-muted); font-size: 14px; }

/* ══════════════════════════════
   TABLES (桌位)
══════════════════════════════ */
.wco-tables-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px)  { .wco-tables-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .wco-tables-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.wco-table-card-item {
    background: var(--surface); border-radius: var(--radius); border: 2px solid var(--border);
    padding: 14px; text-align: center; box-shadow: var(--shadow);
    transition: border-color .2s;
}
.wco-table-card-item.occupied { border-color: var(--info); }
.wco-table-card-item.free     { border-color: var(--success); }
.wco-table-card-name   { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.wco-table-card-status { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.wco-table-card-qr     { width: 100%; max-width: 130px; aspect-ratio: 1; border: 1px solid var(--border); border-radius: 8px; margin: 0 auto 10px; display: block; }
.wco-table-card-actions { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }

/* ══════════════════════════════
   INVENTORY
══════════════════════════════ */
.wco-stock-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.wco-stock-bar-fill { height: 100%; border-radius: 3px; background: var(--success); transition: width .4s; }
.wco-stock-bar-fill.low      { background: var(--warning); }
.wco-stock-bar-fill.critical { background: var(--danger); }
.wco-inv-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .wco-inv-grid { grid-template-columns: 3fr 2fr; } }

/* ══════════════════════════════
   STAFF
══════════════════════════════ */
.wco-staff-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px)  { .wco-staff-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .wco-staff-grid { grid-template-columns: repeat(3, 1fr); } }
.wco-staff-card {
    background: var(--surface); border-radius: var(--radius); padding: 18px;
    border: 1px solid var(--border); box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 12px;
}
.wco-staff-card-top { display: flex; align-items: center; gap: 12px; }
.wco-staff-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 20px; color: #fff; flex-shrink: 0;
}
.wco-staff-avatar.manager { background: linear-gradient(135deg,#7c3aed,#a855f7); }
.wco-staff-avatar.staff   { background: linear-gradient(135deg,#0284c7,#38bdf8); }
.wco-staff-info-name     { font-weight: 700; font-size: 15px; }
.wco-staff-info-username { font-size: 12px; color: var(--text-muted); }
.wco-staff-card-actions  { display: flex; gap: 8px; }

/* ══════════════════════════════
   ACTIVITY LOG
══════════════════════════════ */
.wco-log-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.wco-log-row:last-child { border-bottom: none; }
.wco-log-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; background: var(--accent-bg); }
.wco-log-body  { flex: 1; min-width: 0; }
.wco-log-action { font-weight: 700; font-size: 13px; }
.wco-log-detail { font-size: 12px; color: var(--text-muted); }
.wco-log-meta   { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* Mobile modal form-row stacking */
@media (max-width: 480px) { .wco-form-row { flex-direction: column; } }

/* Payment method pills */
.wco-pay-pill { padding: 8px 18px; border-radius: 20px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; }
.wco-pay-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Stock preset rows */
.wco-preset-row { display: flex; gap: 6px; align-items: center; }
/* Report stat cards in inline layout */
#wco-rpt-body .wco-stat-card { padding: 12px 16px; }

/* ── SVG Icon System ── */
.wco-icon {
    display: inline-block; vertical-align: middle;
    flex-shrink: 0; pointer-events: none;
}
.wco-btn .wco-icon, button .wco-icon {
    vertical-align: middle; position: relative; top: -1px;
}
/* Button with icon + text gap */
.wco-btn .wco-icon + span, .wco-btn .wco-icon ~ * { margin-left: 2px; }

/* Status dot (replaces 🔴🟡🟢 emoji) */
.wco-status-dot {
    display: inline-block; width: 7px; height: 7px;
    border-radius: 50%; vertical-align: middle;
    margin-right: 3px; position: relative; top: -1px;
}
.wco-badge-danger   .wco-status-dot { background: currentColor; }
.wco-badge-warning  .wco-status-dot { background: currentColor; }
.wco-badge-success  .wco-status-dot { background: currentColor; }

/* Import zone icon */
.wco-import-zone-icon { color: var(--text-muted); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }

/* Log icon refined */
.wco-log-icon svg { display: block; }
