:root {
    --navy-950: #071a2b;
    --navy-900: #0a2237;
    --navy-800: #10324d;
    --teal-500: #13b8a6;
    --teal-400: #28d2bd;
    --cyan-100: #dffaf6;
    --ink-900: #122234;
    --ink-700: #405267;
    --ink-500: #748398;
    --line: #e4eaf0;
    --surface: #ffffff;
    --canvas: #f3f6f9;
    --danger: #d84545;
    --warning: #d68a12;
    --success: #0b9c6d;
    --shadow: 0 14px 40px rgba(23, 48, 71, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100%; color: var(--ink-900); background: var(--canvas); font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 272px; padding: 26px 18px; display: flex; flex-direction: column; color: #dce8f2; background: linear-gradient(170deg, var(--navy-950) 0%, var(--navy-900) 62%, #0c3547 100%); box-shadow: 10px 0 40px rgba(4, 25, 40, .12); }
.sidebar::before { content: ""; position: absolute; width: 190px; height: 190px; right: -95px; bottom: 110px; border-radius: 50%; background: rgba(19, 184, 166, .08); pointer-events: none; }
.sidebar-brand { display: flex; align-items: center; gap: 13px; padding: 3px 10px 30px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.sidebar-brand-logo { width: auto; max-width: 155px; height: 44px; display: block; object-fit: contain; object-position: left center; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: #062a31; background: linear-gradient(145deg, var(--teal-400), #9cf7e9); font-size: 15px; font-weight: 900; letter-spacing: -.5px; box-shadow: 0 8px 22px rgba(19, 184, 166, .25); }
.brand-name { color: #fff; font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.brand-subtitle { margin-top: 3px; color: #7fa2b9; font-size: 9px; letter-spacing: 1.8px; }
.sidebar-section-label { padding: 26px 15px 10px; color: #66879d; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; }
.sidebar-nav { display: grid; gap: 7px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 8px 13px; border-radius: 13px; color: #a9bfce; text-decoration: none; font-weight: 700; font-size: 14px; transition: .18s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); transform: translateX(2px); }
.nav-link.active { color: #fff; background: linear-gradient(100deg, rgba(19,184,166,.23), rgba(19,184,166,.06)); box-shadow: inset 3px 0 var(--teal-400); }
.nav-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; color: #8fb1c2; background: rgba(255,255,255,.04); font-size: 13px; font-weight: 800; }
.nav-link.active .nav-icon { color: #062d34; border-color: transparent; background: var(--teal-400); }
.sidebar-footer { margin-top: auto; padding: 20px 14px 5px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-version, .sidebar-brand-name { color: var(--teal-400); font-size: 12px; font-weight: 800; }
.sidebar-company { margin-top: 4px; color: #66879d; font-size: 11px; }

.workspace { min-height: 100vh; margin-left: 272px; display: flex; flex-direction: column; }
.workspace-header { min-height: 92px; padding: 18px clamp(22px, 4vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.91); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 25; }
.header-left { display: flex; align-items: center; gap: 14px; }
.page-eyebrow { margin-bottom: 4px; color: var(--teal-500); font-size: 10px; font-weight: 900; letter-spacing: 1.7px; }
.workspace-header h1 { margin: 0; font-size: clamp(21px, 2.3vw, 29px); letter-spacing: -.7px; }
.header-user { display: flex; align-items: center; gap: 11px; }
.user-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, var(--navy-800), #1b6380); font-weight: 800; }
.user-copy { display: grid; line-height: 1.25; }
.user-copy strong { font-size: 13px; }
.user-copy span { color: var(--ink-500); font-size: 11px; }
.logout-link { margin-left: 6px; padding: 8px 10px; border-radius: 9px; color: var(--ink-700); text-decoration: none; font-size: 12px; font-weight: 700; }
.logout-link:hover { color: var(--danger); background: #fff0f0; }
.mobile-menu-button { display: none; width: 43px; height: 43px; padding: 11px; border: 0; border-radius: 12px; background: var(--navy-900); }
.mobile-menu-button span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: #fff; }

.workspace-content { width: 100%; max-width: 1540px; margin: 0 auto; padding: 34px clamp(22px, 4vw, 48px) 54px; flex: 1; }
.workspace-footer { padding: 18px 30px 26px; color: #8a98a8; text-align: center; font-size: 11px; }
.content-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.content-heading h2 { margin: 0 0 5px; font-size: 21px; }
.content-heading p { margin: 0; color: var(--ink-500); font-size: 13px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 25px; }
.kpi-card { position: relative; min-height: 148px; padding: 23px; overflow: hidden; border: 1px solid rgba(221,230,237,.9); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.kpi-card::after { content: ""; position: absolute; width: 92px; height: 92px; top: -30px; right: -22px; border-radius: 50%; background: var(--kpi-accent, #e5f7f4); }
.kpi-icon { position: relative; z-index: 1; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--kpi-color, var(--teal-500)); background: var(--kpi-accent, #e5f7f4); font-weight: 900; }
.kpi-number { margin-top: 16px; font-size: 30px; font-weight: 850; letter-spacing: -1px; }
.kpi-label { margin-top: 3px; color: var(--ink-500); font-size: 12px; font-weight: 650; }
.kpi-card.blue { --kpi-color: #2879cf; --kpi-accent: #e7f2ff; }
.kpi-card.orange { --kpi-color: #d67a16; --kpi-accent: #fff1df; }
.kpi-card.purple { --kpi-color: #7e59d0; --kpi-accent: #f1ebff; }

.panel-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 20px; }
.panel { border: 1px solid rgba(221,230,237,.95); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { min-height: 67px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 0; font-size: 16px; }
.panel-header p { margin: 4px 0 0; color: var(--ink-500); font-size: 12px; }
.panel-body { padding: 22px; }
.panel-body.no-padding { padding: 0; }
.stack { display: grid; gap: 18px; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.quick-action { min-height: 105px; padding: 17px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 15px; color: var(--ink-900); background: #fbfcfd; text-decoration: none; transition: .18s ease; }
.quick-action:hover { border-color: #91dcd2; background: #f2fffc; transform: translateY(-2px); box-shadow: 0 10px 25px rgba(18,70,78,.08); }
.quick-action span { color: var(--teal-500); font-size: 12px; font-weight: 850; }
.quick-action strong { font-size: 14px; }

.alert { position: relative; margin-bottom: 20px; padding: 14px 45px 14px 16px; border: 1px solid; border-radius: 13px; font-size: 13px; line-height: 1.55; }
.alert-success { color: #08704f; border-color: #b8ead8; background: #eafff7; }
.alert-error { color: #a62e2e; border-color: #f2c2c2; background: #fff0f0; }
.alert-warning { color: #966016; border-color: #f0d3a1; background: #fff8e9; }
.alert-info { color: #285f8b; border-color: #c3deef; background: #eef8ff; }
.alert-close { position: absolute; top: 7px; right: 10px; width: 30px; height: 30px; border: 0; color: currentColor; background: transparent; font-size: 20px; }

.toolbar { margin-bottom: 20px; padding: 16px; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 25px rgba(23,48,71,.05); }
.toolbar .field { flex: 1 1 210px; margin: 0; }
.toolbar .field.small { flex: 0 1 190px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; color: var(--ink-700); font-size: 12px; font-weight: 750; }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid #ccd7e0; border-radius: 11px; outline: none; color: var(--ink-900); background: #fff; transition: .18s ease; }
.textarea { min-height: 105px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(19,184,166,.12); }
.input-xl { min-height: 61px; padding: 13px 17px; font-size: 21px; font-weight: 750; letter-spacing: .5px; }
.field-hint { margin-top: 6px; color: var(--ink-500); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }

.btn { min-height: 42px; padding: 9px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 11px; text-decoration: none; font-size: 12px; font-weight: 800; transition: .17s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, #0da897, #0c887d); box-shadow: 0 8px 20px rgba(13,168,151,.19); }
.btn-dark { color: #fff; background: var(--navy-900); }
.btn-soft { color: var(--ink-700); border-color: var(--line); background: #f7f9fb; }
.btn-danger { color: #bd3030; border-color: #f0caca; background: #fff4f4; }
.btn-small { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 11px; }
.button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-form { display: inline-flex; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 12px 15px; color: #718094; background: #f7f9fb; text-align: left; font-size: 10px; font-weight: 850; letter-spacing: .6px; }
.data-table td { padding: 14px 15px; border-top: 1px solid #edf1f4; color: var(--ink-700); font-size: 12px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfefd; }
.data-table strong { color: var(--ink-900); }
.data-table.details-collapsed .detail-column { display: none; }
.package-list-summary { line-height: 1.7; }
.package-data-table .remark-cell { min-width: 150px; max-width: 280px; white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
.status-dot { width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; background: #c4ced8; }
.status-dot.success { background: var(--success); box-shadow: 0 0 0 4px rgba(11,156,109,.09); }
.badge { padding: 5px 8px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 10px; font-weight: 850; }
.badge-success { color: #08704f; background: #e4faf2; }
.badge-warning { color: #9b6112; background: #fff2dc; }
.badge-muted { color: #647588; background: #edf1f5; }
.badge-danger { color: #b53131; background: #ffebeb; }
.empty-state { padding: 44px 22px; color: var(--ink-500); text-align: center; }

.upload-drop { position: relative; min-height: 190px; padding: 28px; display: grid; place-items: center; border: 2px dashed #c8d6df; border-radius: 17px; background: #f9fbfc; text-align: center; transition: .18s ease; }
.upload-drop:hover { border-color: var(--teal-500); background: #f3fffd; }
.upload-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-visual { width: 53px; height: 53px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; color: var(--teal-500); background: var(--cyan-100); font-size: 19px; font-weight: 900; }
.upload-title { font-weight: 850; }
.upload-name { margin-top: 7px; color: var(--teal-500); font-size: 12px; }
.mapping-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mapping-item { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfd; }
.mapping-item b { display: block; margin-bottom: 4px; color: var(--teal-500); font-size: 15px; }
.mapping-item span { color: var(--ink-500); font-size: 11px; }

.scan-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .65fr); gap: 20px; }
.scan-panel { position: relative; overflow: hidden; background: linear-gradient(145deg, #fff, #f8fffd); }
.scan-panel::after { content: ""; position: absolute; width: 180px; height: 180px; right: -90px; bottom: -90px; border-radius: 50%; background: rgba(19,184,166,.07); }
.customer-summary-panel .empty-state { padding: 35px 12px; }
.selected-customer-name { margin-bottom: 16px; padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-radius: 13px; background: linear-gradient(135deg, #effffb, #f7fcfd); }
.selected-customer-name span { color: var(--ink-500); font-size: 11px; }
.selected-customer-name strong { font-size: 18px; }
.selected-customer-name .cabinet-name { max-width: 78%; overflow-wrap: anywhere; text-align: right; font-size: 14px; line-height: 1.45; }
.customer-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.customer-stat-grid > div { padding: 14px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfd; }
.customer-stat-grid > div.full { grid-column: 1 / -1; border-color: #bfe9e2; background: #f0fffb; }
.customer-stat-grid span { color: var(--ink-500); font-size: 10px; font-weight: 750; }
.customer-stat-grid strong { font-size: 17px; }
.customer-packages-panel, .quick-customer-bottom { margin-top: 20px; }
.customer-weight-area { display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, #f7fffd, #fff); }
.customer-weight-area h4 { margin: 0 0 6px; font-size: 15px; }
.customer-weight-area p { margin: 0; color: var(--ink-500); font-size: 11px; }
.customer-weight-form { min-width: min(100%, 420px); display: flex; align-items: flex-end; gap: 10px; }
.customer-weight-form .field { min-width: 220px; margin: 0; }
.quick-customer-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto; align-items: end; gap: 14px; }
.quick-customer-form .field { margin: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.camera-input-wrap { position: relative; }
.camera-scan-input { padding-right: 145px; cursor: pointer; }
.camera-scan-input.scan-filled { border-color: var(--success); background: #effff8; box-shadow: 0 0 0 4px rgba(11,156,109,.14); }
.camera-open-button { position: absolute; top: 7px; right: 7px; min-height: 47px; padding: 8px 13px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; color: #fff; background: var(--navy-900); font-size: 11px; font-weight: 800; }
.camera-open-button:hover { background: #12425e; }
.camera-button-icon { position: relative; width: 19px; height: 14px; display: inline-block; border: 2px solid currentColor; border-radius: 4px; }
.camera-button-icon::before { content: ""; position: absolute; width: 7px; height: 7px; left: 4px; top: 2px; border: 2px solid currentColor; border-radius: 50%; }
.camera-button-icon::after { content: ""; position: absolute; width: 8px; height: 3px; left: 3px; top: -5px; border-radius: 3px 3px 0 0; background: currentColor; }
.camera-modal-open { overflow: hidden; }
.barcode-modal { position: fixed; z-index: 1000; inset: 0; padding: 20px; display: grid; place-items: center; opacity: 0; transition: opacity .18s ease; }
.barcode-modal[hidden] { display: none; }
.barcode-modal.open { opacity: 1; }
.barcode-modal-backdrop { position: absolute; inset: 0; background: rgba(2,15,25,.78); backdrop-filter: blur(5px); }
.barcode-dialog { position: relative; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; color: #fff; background: #071d2f; box-shadow: 0 30px 90px rgba(0,0,0,.42); transform: translateY(18px) scale(.98); transition: transform .2s ease; }
.barcode-modal.open .barcode-dialog { transform: translateY(0) scale(1); }
.barcode-dialog-header { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid rgba(255,255,255,.1); }
.barcode-dialog-header h3 { margin: 2px 0 0; font-size: 19px; }
.camera-eyebrow { color: var(--teal-400); font-size: 9px; font-weight: 900; letter-spacing: 1.6px; }
.camera-close-button { width: 39px; height: 39px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; color: #fff; background: rgba(255,255,255,.06); font-size: 24px; line-height: 1; }
.barcode-dialog-body { padding: 18px 20px 10px; }
.camera-status { margin-bottom: 12px; color: #b5c8d5; font-size: 12px; text-align: center; }
.camera-status.ready { color: var(--teal-400); }
.camera-status.success { color: #67e8b8; font-weight: 800; }
.camera-status.warning { color: #ffd27d; font-weight: 800; }
.camera-status.error { color: #ff9999; }
.camera-session-summary { width: fit-content; margin: -2px auto 12px; padding: 7px 12px; display: flex; align-items: center; gap: 7px; border: 1px solid rgba(40,210,189,.2); border-radius: 999px; color: #a9c4d2; background: rgba(19,184,166,.08); font-size: 10px; }
.camera-session-summary strong { color: var(--teal-400); font-size: 15px; }
.barcode-reader-shell { position: relative; min-height: 330px; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: #020d14; }
#barcodeReader { width: 100%; min-height: 330px; }
#barcodeReader video { width: 100% !important; min-height: 330px; object-fit: cover; }
#barcodeReader img { display: none !important; }
.camera-guide { position: absolute; z-index: 5; inset: 50% auto auto 50%; width: 86%; height: 34%; max-height: 160px; pointer-events: none; transform: translate(-50%,-50%); border: 2px solid rgba(40,210,189,.82); border-radius: 13px; box-shadow: 0 0 0 999px rgba(2,13,20,.26), inset 0 0 25px rgba(19,184,166,.08); }
.camera-guide::before, .camera-guide::after, .camera-guide span::before, .camera-guide span::after { content: ""; position: absolute; width: 22px; height: 22px; border-color: #fff; }
.camera-guide::before { left: -2px; top: -2px; border-left: 4px solid; border-top: 4px solid; border-radius: 8px 0 0; }
.camera-guide::after { right: -2px; top: -2px; border-right: 4px solid; border-top: 4px solid; border-radius: 0 8px 0 0; }
.camera-guide span::before { left: -2px; bottom: -2px; border-left: 4px solid; border-bottom: 4px solid; border-radius: 0 0 0 8px; }
.camera-guide span::after { right: -2px; bottom: -2px; border-right: 4px solid; border-bottom: 4px solid; border-radius: 0 0 8px; }
.camera-help { margin: 13px 0 8px; color: #91aabb; font-size: 11px; line-height: 1.6; text-align: center; }
.camera-error { margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(255,126,126,.3); border-radius: 11px; color: #ffb5b5; background: rgba(216,69,69,.13); font-size: 12px; line-height: 1.55; }
.barcode-dialog-footer { padding: 12px 20px 18px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.barcode-dialog-footer .btn-soft { color: #dce8f2; border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.07); }
.camera-finish-button { min-width: 120px; }
.weight-confirm-modal { position: fixed; z-index: 1100; inset: 0; padding: 20px; display: grid; place-items: center; }
.weight-confirm-backdrop { position: absolute; inset: 0; background: rgba(2,15,25,.78); backdrop-filter: blur(5px); }
.weight-confirm-dialog { position: relative; width: min(480px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.32); text-align: center; }
.weight-confirm-icon { width: 48px; height: 48px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; color: #9b6411; background: #fff3d8; font-size: 24px; font-weight: 900; }
.weight-confirm-dialog h3 { margin: 0 0 13px; font-size: 19px; }
.weight-confirm-dialog p { margin: 8px 0; color: var(--ink-500); font-size: 12px; line-height: 1.7; }
.weight-confirm-dialog p strong { color: var(--ink-900); overflow-wrap: anywhere; }
.weight-confirm-actions { margin-top: 20px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.weight-confirm-actions form { margin: 0; }
.result-card { margin-bottom: 18px; padding: 18px; border-radius: 14px; font-size: 14px; font-weight: 700; }
.result-card.success { color: #08704f; background: #e8fff7; }
.result-card.error { color: #a62e2e; background: #fff0f0; }
.result-card.warning { color: #966016; background: #fff7e5; }
.detail-list { display: grid; gap: 12px; }
.detail-row { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 11px; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-row span { color: var(--ink-500); }
.detail-row strong { text-align: right; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 680px) minmax(260px, 1fr); gap: 22px; align-items: start; }
.setting-price-form { display: grid; gap: 18px; }
.setting-price-form .field { max-width: 470px; }
.price-input-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; overflow: hidden; border: 1px solid #cbd9e3; border-radius: 11px; background: #fff; }
.price-input-wrap:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(19,184,162,.11); }
.price-input-wrap .input { border: 0; border-radius: 0; box-shadow: none; }
.price-input-wrap span { padding: 0 16px; color: var(--ink-500); font-size: 12px; font-weight: 800; white-space: nowrap; }
.setting-rate-preview { padding: 26px; border: 1px solid rgba(16,177,157,.25); border-radius: 18px; background: linear-gradient(145deg, #effffb, #f8fffd); box-shadow: var(--shadow-sm); }
.setting-rate-preview span { display: block; color: var(--teal-700); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.setting-rate-preview strong { display: block; margin-top: 10px; color: var(--ink-900); font-size: 22px; }
.setting-rate-preview p { margin: 12px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.7; }
.customer-management-grid { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .55fr); }
.customer-management-grid > *,
.customer-management-grid .panel-body,
.admin-account-panel,
.admin-account-layout,
.admin-account-layout > * { min-width: 0; }
.customer-management-grid .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.customer-data-table { min-width: 920px; }
.admin-account-panel { margin-top: 20px; }
.admin-account-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 24px; align-items: start; }
.admin-account-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.admin-account-summary > div { min-height: 82px; padding: 14px; display: grid; align-content: center; gap: 7px; border: 1px solid #d8e7e4; border-radius: 13px; background: #f7fcfb; }
.admin-account-summary span { color: var(--ink-500); font-size: 10px; font-weight: 750; }
.admin-account-summary strong { overflow-wrap: anywhere; font-size: 15px; }
.admin-password-form { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfd; }
.admin-password-form .field { margin-bottom: 12px; }
.admin-password-form .btn { width: 100%; }
.customer-search-toolbar { box-shadow: none; margin-top: -5px; }
.customer-edit-row { cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.customer-data-table tbody .customer-edit-row:hover { background: #f0fbf8; box-shadow: inset 3px 0 var(--teal-400); }
.customer-edit-row:focus { outline: 2px solid rgba(19,184,166,.35); outline-offset: -2px; background: #f5fffc; }
.customer-id-badge { padding: 5px 8px; display: inline-flex; border-radius: 8px; color: #1b6680; background: #edf8fc; font-size: 10px; font-weight: 850; letter-spacing: .3px; }
.login-status { padding: 5px 8px; display: inline-flex; border-radius: 999px; color: #647588; background: #edf1f5; font-size: 10px; font-weight: 850; white-space: nowrap; }
.login-status.active { color: #08704f; background: #e4faf2; }
.login-status.disabled { color: #a45e14; background: #fff2dc; }
.setting-check { display: flex; align-items: center; gap: 10px; color: var(--ink-700); font-size: 12px; font-weight: 800; cursor: pointer; }
.setting-check input { width: 20px; height: 20px; accent-color: var(--teal-500); }
.customer-login-check { margin: 4px 0 18px; }
.customer-modal-open { overflow: hidden; }
.edit-customer-modal { position: fixed; z-index: 1200; inset: 0; padding: 20px; display: grid; place-items: center; opacity: 0; transition: opacity .18s ease; }
.edit-customer-modal[hidden] { display: none; }
.edit-customer-modal.open { opacity: 1; }
.edit-customer-backdrop { position: absolute; inset: 0; background: rgba(2,15,25,.72); backdrop-filter: blur(4px); }
.edit-customer-dialog { position: relative; width: min(650px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.34); transform: translateY(14px) scale(.985); transition: transform .18s ease; }
.edit-customer-modal.open .edit-customer-dialog { transform: translateY(0) scale(1); }
.edit-customer-dialog header { padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.edit-customer-dialog header h3 { margin: 0; font-size: 18px; }
.modal-close-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-700); background: #f7f9fb; font-size: 22px; }
.edit-customer-dialog form { padding: 22px; }
.edit-customer-code { margin-bottom: 20px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border: 1px solid #cbe9e4; border-radius: 13px; background: #f2fffb; }
.edit-customer-code span, .edit-customer-code small { color: var(--ink-500); font-size: 10px; }
.edit-customer-code strong { font-size: 16px; }
.notification-batch-panel .field:last-child { margin-bottom: 0; }
.notification-template-input { min-height: 122px; }
.notification-list-panel { margin-top: 20px; overflow: hidden; }
.notification-template-panel { margin-top: 20px; }
.notification-settings-form { display: grid; gap: 18px; }
.notification-share-settings { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr); gap: 22px; border: 1px solid #cce8e3; border-radius: 15px; background: #f5fffc; }
.notification-share-settings .field { margin: 0; }
.notification-summary { max-width: 920px; line-height: 1.75; }
.notification-summary strong { color: var(--ink-700); }
.notification-formula { padding: 7px 10px; border-radius: 9px; color: #08705f; background: #eafbf7; font-size: 11px; font-weight: 800; }
.notification-feedback { margin: 14px 20px 0; padding: 11px 13px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.notification-feedback.success { color: #08704f; background: #e8fff7; }
.notification-feedback.error { color: #a62e2e; background: #fff0f0; }
.notification-pushed { color: #08704f; border-color: #b8ead8; background: #eafff7; }
.notification-customer-id { margin-top: 4px; display: block; color: var(--ink-500); font-size: 9px; font-weight: 600; }
.paid-toggle { min-width: 108px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.paid-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.paid-toggle span { position: relative; width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid #b9c7d2; border-radius: 6px; background: #fff; transition: .18s ease; }
.paid-toggle span::after { content: "✓"; color: #fff; font-size: 15px; font-weight: 900; line-height: 1; opacity: 0; transform: scale(.6); transition: .15s ease; }
.paid-toggle input:checked + span { border-color: var(--teal-500); background: var(--teal-500); }
.paid-toggle input:checked + span::after { opacity: 1; transform: scale(1); }
.paid-toggle input:focus-visible + span { box-shadow: 0 0 0 3px rgba(19,184,166,.2); }
.paid-toggle input:disabled + span { opacity: .55; }
.paid-toggle em { color: var(--ink-500); font-size: 10px; font-style: normal; font-weight: 750; }
.customer-dashboard-heading { margin-bottom: 18px; }
.customer-dashboard-panel { overflow: hidden; }
.customer-dashboard-table { min-width: 850px; }
.customer-dashboard-table td:nth-child(2) { font-size: 13px; }

.pagination-note { color: var(--ink-500); font-size: 11px; }
.danger-zone { border-color: #f0d2d2; }

.login-body { min-height: 100vh; background: #f7f9fa; }
.login-shell { min-height: 100vh; display: grid; place-items: center; }
.login-form-side { width: 100%; min-height: 100vh; padding: clamp(24px, 5vw, 56px); display: grid; place-items: center; background: #f7f9fa; }
.login-card { width: min(440px, 100%); }
.login-card-logo { margin: 0 auto 30px; display: flex; justify-content: center; }
.login-brand-logo { width: min(280px, 82vw); height: auto; max-height: 96px; display: block; object-fit: contain; object-position: center; }
.login-card h2 { margin: 0 0 34px; text-align: center; font-size: clamp(24px, 4vw, 30px); }
.login-card .input { min-height: 51px; }
.login-submit { width: 100%; min-height: 51px; margin-top: 5px; }
.login-version { margin-top: 28px; color: #98a4b1; text-align: center; font-size: 10px; }

@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-grid, .scan-layout, .customer-management-grid { grid-template-columns: 1fr; }
    .settings-layout { grid-template-columns: 1fr; }
    .admin-account-layout { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
    body.menu-open { overflow: hidden; }
    .sidebar { transform: translateX(-105%); transition: transform .24s ease; box-shadow: 20px 0 60px rgba(3,20,32,.28); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { position: fixed; z-index: 35; inset: 0; background: rgba(4,20,31,.56); backdrop-filter: blur(2px); }
    .workspace { margin-left: 0; }
    .mobile-menu-button { display: block; }
    .workspace-header { min-height: 79px; }
    .login-form-side { padding: 25px; }
}

@media (max-width: 680px) {
    .workspace-header { padding: 14px 16px; }
    .workspace-content { padding: 24px 14px 42px; }
    .user-copy { display: none; }
    .logout-link { margin-left: 0; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
    .kpi-card { min-height: 125px; padding: 17px; border-radius: 15px; }
    .kpi-number { margin-top: 12px; font-size: 24px; }
    .panel { border-radius: 15px; }
    .panel-header, .panel-body { padding: 17px; }
    .content-heading { align-items: flex-start; flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
    .mapping-grid { grid-template-columns: 1fr 1fr; }
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar .field, .toolbar .field.small { width: 100%; flex: none; }
    .toolbar .btn { width: 100%; }
    .customer-management-grid { width: 100%; max-width: 100%; }
    .customer-management-grid .panel,
    .admin-account-panel { width: 100%; max-width: 100%; overflow: hidden; }
    .customer-management-grid .panel-body,
    .admin-account-panel .panel-body { padding: 15px; }
    .customer-search-toolbar { width: 100%; max-width: 100%; padding: 13px; }
    .customer-search-toolbar .input { min-width: 0; }
    .customer-data-table { min-width: 880px; }
    .header-user .user-avatar { display: none; }
    .camera-scan-input { padding-right: 68px; }
    .camera-open-button { width: 49px; padding: 8px; justify-content: center; }
    .camera-open-button > span:last-child { display: none; }
    .barcode-modal { padding: 0; align-items: end; }
    .barcode-dialog { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
    .barcode-reader-shell, #barcodeReader, #barcodeReader video { min-height: 390px; }
    .customer-weight-area { align-items: stretch; flex-direction: column; gap: 18px; }
    .customer-weight-form { min-width: 0; align-items: stretch; flex-direction: column; }
    .customer-weight-form .field { min-width: 0; }
    .quick-customer-form { grid-template-columns: 1fr; align-items: stretch; }
    .edit-customer-modal { padding: 0; align-items: end; }
    .edit-customer-dialog { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
    .edit-customer-code { grid-template-columns: 1fr; gap: 4px; }
    .admin-account-summary { grid-template-columns: 1fr 1fr; }
    .admin-account-summary > div { min-width: 0; padding: 12px; }
    .admin-password-form { min-width: 0; padding: 14px; }
    .notification-share-settings { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .kpi-grid, .quick-actions { grid-template-columns: 1fr; }
    .kpi-card { min-height: 115px; }
    .mapping-grid { grid-template-columns: 1fr; }
    .admin-account-summary { grid-template-columns: 1fr; }
}
