﻿/* =====================================================================================
 * Telemetry 2026.11.04.3 BCB: 雲端平台版面 (Leader Cloud 風格)
 *   1. 整體: 深色底 / 灰藍卡片 / 藍色主色, 跟點餐機後台 (Items / Inventory / Machine status) 同一種感覺
 *   2. 頁首: Logo + 名稱 + 版本; 右邊 語言 / About / 使用者
 *   3. 側邊選單: 分組標題, 目前頁面左側藍條
 *   4. 共用樣式 lc-* : 頁面 (lc-page) / 標題 / 卡片 / 按鈕 / 輸入框 / 狀態標籤 / 開關 / 表格 / 數字卡 / 存檔列
 *   原本的設定 (Radzen 表格等) 保留在最下面
 * ===================================================================================== */
:root {
    --lc-bg: #0b0f16;
    --lc-surface: #121824;
    --lc-surface-2: #182030;
    --lc-border: #263043;
    --lc-border-soft: rgba(127,140,160,.18);
    --lc-text: #e6ebf2;
    --lc-muted: #8d99ab;
    --lc-primary: #3b82f6;
    --lc-primary-hover: #2f6fe0;
    --lc-primary-soft: rgba(59,130,246,.14);
    --lc-success: #22c55e;
    --lc-success-soft: rgba(34,197,94,.14);
    --lc-warn: #f2b263;
    --lc-warn-soft: rgba(242,178,99,.14);
    --lc-danger: #ef4444;
    --lc-danger-soft: rgba(239,68,68,.14);
    --lc-radius: 10px;
    --lc-header-h: 56px;
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, 'Microsoft JhengHei', sans-serif;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body { background-color: var(--lc-bg); color: var(--lc-text); }
:root:has(.rz-layout) body { background-color: var(--lc-bg); }

#_main {
    background-color: var(--lc-bg);
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ---------- 頁首 ---------- */
#_main .rz-header {
    padding: 0;
    height: var(--lc-header-h);
    background: #0f141d;
    border-bottom: 1px solid var(--lc-border);
    box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.lc-brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; text-decoration: none; color: var(--lc-text); }
.lc-brand:hover { color: var(--lc-text); }
.lc-logo { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%); }
.lc-brand-name { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.lc-brand-sub { font-size: 12px; color: var(--lc-muted); }
.lc-ver { font-size: 11px; font-weight: 600; color: var(--lc-muted); border: 1px solid var(--lc-border); border-radius: 999px; padding: 1px 8px; }
.lc-user { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lc-muted); }
.lc-avatar { width: 28px; height: 28px; border-radius: 14px; background: var(--lc-surface-2); border: 1px solid var(--lc-border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--lc-text); font-size: 12px; text-transform: uppercase; }
#_main .rz-header .rz-menu { background: transparent; border: 0; }
#_main .rz-header .rz-menu .rz-navigation-item-link { color: var(--lc-text); }

/* ---------- 側邊選單 ---------- */
#_main .rz-sidebar {
    background: #0f141d;
    background-image: none;
    border-right: 1px solid var(--lc-border);
}
#_main .rz-panel-menu,
#_main .rz-body {
    padding: 0;
    background-color: transparent;
}
#_main .rz-panel-menu { padding: 8px 0; }
#_main .rz-panel-menu .rz-navigation-item-wrapper { background-color: transparent; border-radius: 8px; margin: 1px 8px; }
#_main .rz-panel-menu .rz-navigation-item-link { color: #c7d0dc; min-height: 38px; font-size: 14px; }
#_main .rz-panel-menu .rz-navigation-item-wrapper:hover { background-color: rgba(255,255,255,.05); }
#_main .active,
#_main .rz-navigation-item-wrapper-active {
    background-color: var(--lc-primary-soft) !important;
    box-shadow: inset 3px 0 0 var(--lc-primary);
}
#_main .rz-navigation-item-wrapper-active > .rz-navigation-item-link { color: #fff; font-weight: 600; }
.rz-navigation-item .rz-navigation-item { padding-left: .75rem; }
#_main .rz-body { background: var(--lc-bg); }
/* Telemetry 2026.11.04.9 BCB: 新版頁面 (lc-page) 可以往下捲 (RadzenBody 原本 overflow: hidden 給舊版表格頁用, 新版頁面內容太長會被切掉) */
#_main .rz-body:has(.lc-page) { overflow-y: auto !important; overflow-x: hidden !important; }
/* Telemetry 2026.11.04.9 BCB: 右上角帳號選單 */
#_main .rz-header .lc-user-menu { background: transparent; border: 0; padding: 0; }
#_main .rz-header .lc-user-menu .rz-navigation-item-link { padding: 4px 8px; }
#_main .rz-header .lc-user-menu .rz-navigation-menu { min-width: 180px; }

/* ---------- 頁面 ---------- */
.lc-page { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 120px; max-width: 1440px; }
.lc-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.lc-title { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: .01em; }
.lc-sub { font-size: 13px; color: var(--lc-muted); }
.lc-muted { color: var(--lc-muted); font-size: 13px; }
.lc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lc-grow { flex: 1 1 auto; }

.lc-card { background: var(--lc-surface); border: 1px solid var(--lc-border); border-radius: var(--lc-radius); }
.lc-card-pad { padding: 16px 18px; }
.lc-card-title { font-weight: 700; font-size: 15px; }
.lc-card.warn { border-color: var(--lc-warn); }

/* 按鈕 */
.lc-btn { height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--lc-border); background: var(--lc-surface-2); color: var(--lc-text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.lc-btn:hover { background: #202a3d; color: var(--lc-text); }
.lc-btn:disabled, .lc-btn.disabled { opacity: .45; cursor: default; pointer-events: none; }
.lc-btn-primary { background: var(--lc-primary); border-color: var(--lc-primary); color: #fff; font-weight: 600; }
.lc-btn-primary:hover { background: var(--lc-primary-hover); color: #fff; }
.lc-btn-ghost { background: transparent; }
.lc-btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.lc-seg { display: inline-flex; border: 1px solid var(--lc-border); border-radius: 8px; overflow: hidden; background: var(--lc-surface); }
.lc-seg button { height: 36px; padding: 0 13px; border: 0; border-left: 1px solid var(--lc-border); background: transparent; color: var(--lc-text); font: inherit; font-size: 13px; cursor: pointer; }
.lc-seg button:first-child { border-left: 0; }
.lc-seg button.on { background: var(--lc-primary); color: #fff; font-weight: 600; }

/* 輸入 */
.lc-input { height: 38px; box-sizing: border-box; padding: 0 10px; border-radius: 8px; border: 1px solid var(--lc-border); background: #0d121b; color: var(--lc-text); font: inherit; font-size: 14px; }
.lc-input:focus { outline: 2px solid rgba(59,130,246,.55); outline-offset: 0; border-color: var(--lc-primary); }
.lc-input.changed { border-color: var(--lc-warn); box-shadow: 0 0 0 1px var(--lc-warn); }
select.lc-input { cursor: pointer; }
select.lc-input option { background-color: #1b2230; color: var(--lc-text); }

/* 狀態 */
.lc-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.lc-chip-on { background: var(--lc-success-soft); color: #86efac; }
.lc-chip-off { background: rgba(127,140,160,.18); color: #c7d0dc; }
.lc-chip-warn { background: var(--lc-warn-soft); color: #f6c98f; }
.lc-chip-err { background: var(--lc-danger-soft); color: #fca5a5; }
.lc-chip-info { background: var(--lc-primary-soft); color: #93c5fd; }
.lc-dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex: none; background: #4a5568; }
.lc-dot.on { background: var(--lc-success); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.lc-dot.warn { background: var(--lc-warn); }
.lc-dot.err { background: var(--lc-danger); }
.lc-msg-ok { color: #86efac; font-weight: 600; }
.lc-msg-err { color: #fca5a5; font-weight: 600; }
.lc-note { padding: 10px 14px; border-radius: 8px; background: var(--lc-primary-soft); color: #c9dcff; font-size: 13px; }
.lc-note.warn { background: var(--lc-warn-soft); color: #f6c98f; }

/* 開關 */
.lc-switch { width: 46px; height: 26px; border-radius: 13px; border: 1px solid var(--lc-border); background: #2a3344; padding: 2px; display: inline-flex; justify-content: flex-start; cursor: pointer; flex: none; }
.lc-switch span { width: 20px; height: 20px; border-radius: 10px; background: #c9cdd6; display: block; }
.lc-switch.on { background: var(--lc-primary); border-color: var(--lc-primary); justify-content: flex-end; }
.lc-switch.on span { background: #fff; }
.lc-switch:disabled { opacity: .5; cursor: default; }

/* 表格 */
.lc-table-wrap { overflow-x: auto; }
.lc-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--lc-text); }
.lc-table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--lc-muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--lc-border); white-space: nowrap; background: var(--lc-surface); }
.lc-table td { padding: 10px 14px; border-bottom: 1px solid var(--lc-border-soft); vertical-align: middle; }
.lc-table tr:last-child td { border-bottom: 0; }
.lc-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.lc-table tr.edited td { background: rgba(59,130,246,.07); }
.lc-table tr.low td:first-child { box-shadow: inset 3px 0 0 var(--lc-danger); }
.lc-num { text-align: right; font-variant-numeric: tabular-nums; }

/* 數字卡 */
.lc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.lc-kpi { background: var(--lc-surface); border: 1px solid var(--lc-border); border-radius: var(--lc-radius); padding: 14px 16px; }
.lc-kpi .k { font-size: 12px; color: var(--lc-muted); text-transform: uppercase; letter-spacing: .04em; }
.lc-kpi .v { font-size: 26px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.lc-kpi .s { font-size: 12px; color: var(--lc-muted); }

/* 下方存檔列 */
.lc-savebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; width: min(1100px, calc(100% - 48px)); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: #1b2230; border: 1px solid #3a465c; box-shadow: 0 -6px 24px rgba(0,0,0,.35); }

/* 機器選擇列 */
.lc-machinebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 24px; border-bottom: 1px solid var(--lc-border); background: #0f141d; }
.lc-machinebar .lc-input { min-width: 320px; }

/* 登入 */
.lc-login { min-height: calc(100vh - var(--lc-header-h) - 40px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lc-login .lc-card { width: min(420px, 100%); }

/* ---------- 原本的設定 ---------- */
.rz-grid-table thead th .rz-column-title {
    text-transform: unset;
}

.rz-group-header:has(.rz-custom-header) {
    padding: 0;
}
.rz-custom-header,
.rz-custom-footer {
    width: 100%;
}

.rz-data-grid {
    height: 100%;
}
