/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --border: #d0d0d0;
  --border-light: #e8e8e8;
  --header-bg: #f5f6f7;
  --bg: #ffffff;
  --text: #1a1a1a;
  --primary: #217346;
  --primary-hover: #1a5e38;
  --danger: #e74c3c;
  --green: #2ecc71;
  --red: #e74c3c;
  --shadow: rgba(0, 0, 0, 0.12);
}

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: var(--text);
  background: #fafafa;
  overflow: hidden;
  height: 100vh;
}

.hidden { display: none !important; }

/* ===== 登录页 ===== */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #217346 0%, #1a5e38 50%, #144a2c 100%);
}
.login-card {
  background: #fff; padding: 48px 40px; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center;
  width: 400px; max-width: 90vw;
}
.login-icon { color: var(--primary); margin-bottom: 16px; display: flex; justify-content: center; }
.login-card h1 { font-size: 28px; color: var(--text); margin-bottom: 6px; }
.login-sub { color: #888; font-size: 13px; margin-bottom: 28px; }
#username-input {
  width: 100%; padding: 14px 16px; font-size: 16px;
  border: 2px solid #e0e0e0; border-radius: 10px; outline: none;
  transition: border-color 0.2s; margin-bottom: 12px;
}
#username-input:focus { border-color: var(--primary); }
#password-input {
  width: 100%; padding: 14px 16px; font-size: 16px;
  border: 2px solid #e0e0e0; border-radius: 10px; outline: none;
  transition: border-color 0.2s; margin-bottom: 16px;
}
#password-input:focus { border-color: var(--primary); }
#join-btn {
  width: 100%; padding: 14px; font-size: 16px; background: var(--primary);
  color: #fff; border: none; border-radius: 10px; cursor: pointer;
  font-weight: 600; transition: background 0.2s;
}
#join-btn:hover { background: var(--primary-hover); }
#join-btn:active { transform: scale(0.98); }
.login-tip { margin-top: 20px; color: #aaa; font-size: 12px; }

/* ===== 顶栏 ===== */
.topbar {
  display: flex; align-items: center; height: 48px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 0 12px; gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.logo { font-size: 16px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.view-tabs { display: flex; gap: 4px; }
.tab-btn {
  padding: 6px 14px; border: 1px solid var(--border); background: var(--bg);
  border-radius: 6px; cursor: pointer; font-size: 13px; color: #555;
}
.tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  padding: 7px 16px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-export {
  padding: 7px 16px; background: #2f6fb0; color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-export:hover { background: #27598f; }
.btn-export:disabled { background: #c2cdd8; cursor: not-allowed; }
.btn-danger {
  padding: 6px 14px; background: var(--danger); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.btn-danger:hover { opacity: 0.85; }

.online-users { display: flex; gap: 6px; align-items: center; }
.user-badge {
  width: 30px; height: 30px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff; font-size: 12px;
  font-weight: 700; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ===== 主区域布局 ===== */
#app { display: flex; flex-direction: column; height: 100vh; }
.view { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.sidebar {
  position: absolute; right: 0; top: 48px; bottom: 28px; width: 230px;
  background: var(--bg); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 20;
}
/* 主视图右侧给侧栏留白 */
.view, .topbar { padding-right: 0; }
#view-dashboard, #view-detail { margin-right: 230px; }

/* ===== 看板 ===== */
.dash-scroll { overflow: auto; flex: 1; background: #fff; }
.dash-table { border-collapse: collapse; width: max-content; min-width: 100%; }
.dash-table th, .dash-table td {
  border: 1px solid var(--border-light); padding: 5px 8px;
  text-align: center; white-space: nowrap; font-size: 12px;
}
.dash-table thead th {
  position: sticky; top: 0; z-index: 10; background: var(--header-bg);
  font-weight: 600; color: #444;
}
.dash-table .col-fixed { position: sticky; background: var(--header-bg); }
.dash-table th.col-fixed { z-index: 11; }
.dash-table td.col-fixed { z-index: 5; background: #fff; }

.dash-table .cell-ship { width: 110px; }
.dash-table .cell-id { width: 120px; }
/* 生产编号编辑输入框(右键修改) */
.id-edit-input {
  width: 100%; box-sizing: border-box; padding: 4px 6px;
  border: 1px solid var(--primary); border-radius: 4px; font-size: 13px; outline: none;
}
/* 右键菜单 */
.ctx-menu {
  position: fixed; z-index: 200; min-width: 150px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.14); padding: 4px;
}
.ctx-menu .ctx-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: none; background: none; border-radius: 6px;
  font-size: 13px; cursor: pointer; color: #333; white-space: nowrap;
}
.ctx-menu .ctx-item:hover { background: #eef6f0; color: #217346; }
.dash-table .cell-weight { width: 90px; font-weight: 600; color: #333; }
.dash-table .cell-box { min-width: 96px; }
.dash-table td.cell-box { overflow: hidden; text-overflow: ellipsis; }

/* 勾选列 */
.dash-table .col-check { width: 34px; padding: 4px 6px; }
.dash-table th.col-check { z-index: 11; }
.dash-table td.col-check { z-index: 5; background: #fff; }
.dash-table .col-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.dash-table tr.row-selected { background: #eef6f0; }
.dash-table tr.row-selected td.col-fixed { background: #eef6f0; }

.ship-input {
  width: 100%; border: 1px solid transparent; border-radius: 4px;
  padding: 3px 5px; font-size: 12px; text-align: center; background: transparent;
}
.ship-input:focus { border-color: var(--primary); background: #fff; outline: none; }

.id-link {
  color: var(--primary); cursor: pointer; font-weight: 700; text-decoration: underline;
}
.id-link:hover { color: var(--primary-hover); }

.box-done { background: var(--green) !important; color: #fff; font-weight: 600; }
.box-undone { background: var(--red) !important; color: #fff; }
.box-none { background: #f0f0f0 !important; color: #bbb; }
/* 已发走：灰底(优先级最高，覆盖完成/未完成色) */
.box-shipped { background: #c9ccd1 !important; color: #555 !important; font-weight: 400 !important; }

.dash-hint {
  padding: 6px 14px; background: var(--header-bg); border-top: 1px solid var(--border);
  font-size: 12px; color: #888;
}

/* 看板搜索条(生产编号) */
.dash-search {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--header-bg); border-bottom: 1px solid var(--border);
}
.dash-search .search-icon { font-size: 13px; color: #888; }
.dash-search input {
  flex: 1; max-width: 380px; padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; outline: none; background: #fff;
}
.dash-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(33,115,70,.12); }
.dash-search .search-clear {
  border: none; background: none; color: #999; font-size: 15px; cursor: pointer;
  padding: 4px 6px; line-height: 1;
}
.dash-search .search-clear:hover { color: #333; }
.dash-search .search-only {
  border: 1px solid var(--border); background: #fff; color: #555;
  padding: 6px 12px; border-radius: 6px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.dash-search .search-only:hover { border-color: var(--primary); color: var(--primary); }
.dash-search .search-only.active {
  background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600;
}
.search-dropdown {
  position: absolute; top: calc(100% - 4px); left: 16px; z-index: 60;
  max-width: 380px; min-width: 240px; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 4px; margin: 0; list-style: none;
}
.search-dropdown li {
  padding: 7px 12px; font-size: 13px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #333;
}
.search-dropdown li:hover { background: #eef6f0; color: #217346; }
.search-dropdown li.sd-empty { color: #aaa; cursor: default; }
.search-dropdown li.sd-empty:hover { background: none; color: #aaa; }

/* 勾选订单实时汇总 */
.dash-summary {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 9px 16px; background: #fffbe6; border-top: 1px solid var(--border);
  font-size: 13px; color: #555;
}
.dash-summary .sum-item { color: #555; }
.dash-summary .sum-item b { color: #217346; font-size: 15px; margin: 0 2px; }
.dash-summary .sum-sep { color: #ddd; }
.dash-summary:not(.hidden) + .dash-hint { border-top: none; }

/* 可排序表头 */
.dash-table th.cell-sort { cursor: pointer; user-select: none; }
.dash-table th.cell-sort:hover { background: #eef1f3; }
.dash-table th.cell-sort .sort-arrow { color: var(--primary); font-size: 11px; }
.dash-table td.cell-sort, .dash-table th.cell-sort { min-width: 110px; }
.ship-input[type="date"] { cursor: pointer; }

/* 角色标签 */
.role-tag {
  display: inline-block; font-size: 10px; line-height: 1; padding: 2px 5px;
  border-radius: 4px; color: #fff; margin-left: 4px; vertical-align: middle;
}
.role-admin { background: #c0392b; }
.role-editor { background: #2f6fb0; }
.role-viewer { background: #7f8c8d; }

/* 只读输入禁用样式 */
input:disabled, select:disabled { cursor: not-allowed; background: #f7f7f7; color: #888; }

/* ===== 详情多标签 ===== */
.detail-tabbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 6px 12px 0; background: var(--bg); border-bottom: 1px solid var(--border);
  min-height: 38px;
}
.detail-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px 5px 12px; background: #eef1f3; border: 1px solid var(--border);
  border-bottom: none; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 12px; color: #555;
  max-width: 220px;
}
.detail-tab.active { background: #fff; color: var(--primary); font-weight: 700; border-color: var(--primary); }
.detail-tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-tab-close {
  width: 16px; height: 16px; border-radius: 50%; text-align: center; line-height: 14px;
  font-size: 14px; color: #999; background: rgba(0,0,0,0.06);
}
.detail-tab-close:hover { background: var(--danger); color: #fff; }

/* ===== 修改记录(替换原聊天) ===== */
.audit-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.audit-list {
  flex: 1; overflow-y: auto; padding: 4px 0; display: flex; flex-direction: column; gap: 7px;
}
.audit-row {
  font-size: 11.5px; line-height: 1.45; padding: 6px 8px; background: #fafafa;
  border: 1px solid var(--border-light); border-radius: 6px;
}
.audit-row:first-child { box-shadow: 0 0 0 2px #fff7d6; }
.audit-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.audit-user { font-weight: 700; color: #333; }
.audit-role { display: inline-block; font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 4px; color: #fff; }
.audit-time { margin-left: auto; color: #aaa; font-size: 10px; }
.audit-action { color: #217346; font-weight: 600; }
.audit-detail { color: #666; word-break: break-word; }

/* ===== 详情 ===== */
.detail-bar {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.btn-back {
  padding: 6px 14px; background: #eee; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
.btn-back:hover { background: #e0e0e0; }
.detail-title { font-size: 15px; font-weight: 700; color: var(--text); }
.detail-meta { font-size: 12px; color: #888; }
.detail-export { margin-left: auto; }

.detail-scroll { overflow: auto; flex: 1; background: #fff; padding: 0 14px 10px; }
.detail-table { border-collapse: collapse; width: 100%; }
.detail-table th, .detail-table td {
  border: 1px solid var(--border-light); padding: 0; text-align: center;
  font-size: 13px; height: 32px;
}
/* 详情表头冻结：上下滚动时标题行始终在最上面(与看板一致) */
.detail-table thead th { position: sticky; top: 0; z-index: 10; background: var(--header-bg); font-weight: 600; color: #444; padding: 6px; }
.detail-table td .cell-content {
  padding: 5px 8px; width: 100%; min-height: 30px; line-height: 20px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: cell;
}
.detail-table td .cell-content:hover { background: #f5f9f6; }
.detail-table td.editing .cell-content { display: none; }
.detail-table td .cell-edit {
  width: 100%; height: 100%; border: none; outline: 2px solid var(--primary);
  outline-offset: -2px; padding: 5px 8px; font-size: 13px; font-family: inherit; text-align: center;
}
.detail-table td.status-done { background: var(--green); }
.detail-table td.status-done .cell-content { color: #fff; font-weight: 600; }
.detail-table td.status-undone { background: #fdecea; }
.status-select {
  width: 100%; height: 100%; border: none; background: transparent;
  text-align: center; font-size: 13px; cursor: pointer; outline: none; padding: 5px;
}
.status-select.done { background: var(--green); color: #fff; font-weight: 600; }
/* 发货情况(详情页) */
.detail-table td.ship-done { background: #c9ccd1; }
.ship-select.shipped { background: #c9ccd1; color: #333; font-weight: 600; }

/* 看板首列：发货状态(订单级) */
.dash-table td.cell-ordership { width: 86px; padding: 4px 6px; text-align: center; }
.dash-table th.cell-ordership { text-align: center; }
.order-ship-select { width: 72px; padding: 3px 4px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; cursor: pointer; }
.order-ship-select.shipped { background: #c9ccd1; color: #333; font-weight: 600; }
/* 已发货的整行：浅灰底，视觉上与未发货区分并默认沉底 */
.dash-table tr.row-shipped td { background: #f0f1f3; }
.dash-table tr.row-shipped td.col-fixed,
.dash-table tr.row-shipped td.col-check { background: #f0f1f3; }
.dash-table tr.row-shipped.row-selected td { background: #e4e7ea; }
.detail-table td.cell-time { color: #666; font-size: 12px; padding: 0; }
.detail-table td.cell-time .time-input {
  width: 100%; height: 38px; border: none; background: transparent;
  font-size: 13px; color: #333; padding: 0 6px; box-sizing: border-box; cursor: pointer;
}
.detail-table td.cell-time .time-input:focus { outline: 2px solid #ff9800; background: #fffdf7; }

/* ===== 侧栏聊天 ===== */
.sidebar-section { padding: 12px 14px; border-bottom: 1px solid var(--border-light); }
.sidebar-section h3 { font-size: 13px; color: #555; margin-bottom: 10px; font-weight: 600; }
#user-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
#user-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
#user-list li .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chat-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 4px 0; display: flex; flex-direction: column;
  gap: 6px; min-height: 120px;
}
.chat-msg { font-size: 12px; line-height: 1.5; }
.chat-msg .chat-name { font-weight: 700; }
.chat-msg .chat-time { color: #aaa; font-size: 10px; margin-left: 4px; }
.chat-msg .chat-text { color: #333; word-break: break-word; }
.chat-input-wrap { display: flex; gap: 4px; margin-top: 8px; }
#chat-input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; outline: none; }
#chat-input:focus { border-color: var(--primary); }
#chat-send { padding: 6px 12px; background: var(--primary); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; }
#chat-send:hover { background: var(--primary-hover); }

/* ===== 状态栏 ===== */
.statusbar {
  display: flex; align-items: center; height: 28px; padding: 0 14px;
  background: var(--header-bg); border-top: 1px solid var(--border);
  font-size: 12px; color: #666;
}

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 50px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); color: #fff; padding: 10px 24px; border-radius: 8px;
  font-size: 13px; z-index: 9999; animation: toast-in 0.3s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 滚动条 */
.dash-scroll::-webkit-scrollbar, .detail-scroll::-webkit-scrollbar, .chat-messages::-webkit-scrollbar { width: 8px; height: 8px; }
.dash-scroll::-webkit-scrollbar-track, .detail-scroll::-webkit-scrollbar-track, .chat-messages::-webkit-scrollbar-track { background: #f0f0f0; }
.dash-scroll::-webkit-scrollbar-thumb, .detail-scroll::-webkit-scrollbar-thumb, .chat-messages::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 4px; }
.dash-scroll::-webkit-scrollbar-thumb:hover, .detail-scroll::-webkit-scrollbar-thumb:hover, .chat-messages::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-card {
  background: #fff; border-radius: 12px; padding: 26px 28px; width: 380px; max-width: 90vw;
  box-shadow: 0 16px 50px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 12px;
}
.modal-card h3 { font-size: 18px; color: var(--text); }
.modal-sub { font-size: 13px; color: #666; line-height: 1.6; }
.modal-sub span { color: var(--primary); font-weight: 700; }
.modal-btn {
  padding: 11px; border-radius: 8px; font-size: 14px; cursor: pointer; border: none; font-weight: 600;
}
.modal-btn-primary { background: var(--primary); color: #fff; }
.modal-btn-primary:hover { background: var(--primary-hover); }
.modal-btn-ghost { background: #eee; color: #555; }
.modal-btn-ghost:hover { background: #e0e0e0; }
.modal-wide { width: 560px; max-width: 94vw; }

/* 管理员账户入口按钮 */
.btn-account {
  padding: 7px 16px; background: #6c4fb0; color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-account:hover { background: #5a3f93; }

/* ===== 修改记录(按人, 点击展开按天) ===== */
.audit-users { flex: 1; overflow-y: auto; padding: 2px 0; display: flex; flex-direction: column; gap: 6px; }
.audit-user-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  background: #fafafa; border: 1px solid var(--border-light); border-radius: 6px; cursor: pointer;
}
.audit-user-row:hover { background: #f0f4f8; border-color: #cfd8e0; }
.audit-user-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.audit-user-name { font-size: 12.5px; font-weight: 600; color: #333; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-user-count {
  font-size: 11px; color: #fff; background: var(--primary); border-radius: 10px;
  padding: 1px 7px; min-width: 20px; text-align: center;
}
.audit-empty { color: #aaa; font-size: 12px; padding: 10px 6px; text-align: center; }

.audit-detail-body { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.audit-day { border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; }
.audit-day-head {
  background: var(--header-bg); padding: 7px 12px; font-size: 13px; font-weight: 700; color: #333;
  display: flex; align-items: center; gap: 8px;
}
.audit-day-count { font-size: 11px; font-weight: 600; color: #fff; background: #8a8a8a; border-radius: 10px; padding: 1px 8px; }
.audit-day-list { padding: 4px 0; display: flex; flex-direction: column; gap: 2px; }
.audit-day-item { padding: 5px 12px; font-size: 12px; border-top: 1px solid #f0f0f0; }
.audit-day-item:first-child { border-top: none; }
.audit-time2 { color: #999; font-size: 11px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.audit-action2 { color: #217346; font-weight: 600; }
.audit-detail2 { color: #666; word-break: break-word; padding-left: 52px; margin-top: 1px; }

/* ===== 账户管理弹窗 ===== */
.account-list { display: flex; flex-direction: column; gap: 8px; max-height: 34vh; overflow-y: auto; }
.account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; background: #fafafa; border: 1px solid var(--border-light); border-radius: 8px;
}
.account-info { display: flex; align-items: center; gap: 10px; }
.account-name { font-size: 13px; font-weight: 600; color: #333; }
.account-name small { color: #999; font-weight: 400; }
.account-role { padding: 4px 6px; border: 1px solid var(--border); border-radius: 5px; font-size: 12px; background: #fff; cursor: pointer; }
.account-actions { display: flex; gap: 6px; }
.account-mini-btn {
  padding: 5px 10px; border: 1px solid var(--border); background: #fff; border-radius: 5px;
  cursor: pointer; font-size: 12px; color: #555;
}
.account-mini-btn:hover { background: #f0f0f0; }
.account-mini-btn.danger { color: var(--danger); border-color: #f0c0bb; }
.account-mini-btn.danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.account-mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.account-add { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--border); }
.account-add h4 { font-size: 13px; color: #555; margin-bottom: 8px; }
.account-add-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.account-add-row input, .account-add-row select {
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none;
}
.account-add-row input:focus, .account-add-row select:focus { border-color: var(--primary); }
.account-add-row input#acc-username { width: 110px; }
.account-add-row input#acc-display { width: 110px; }
.account-add-row input#acc-password { width: 110px; }
.account-add-row select { width: 90px; }

/* 账户：逐列权限 */
.account-row { align-items: center; flex-wrap: wrap; }
.account-perms { flex-basis: 100%; margin-top: 4px; padding-top: 8px; border-top: 1px dashed #e2e2e2; }
.perm-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.perm-item { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #444; cursor: pointer; }
.perm-item input { width: 14px; height: 14px; cursor: pointer; }
.perm-note { font-size: 12px; color: #999; padding: 2px 0; }

/* 详情：手动添加箱 */
.detail-addbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--header-bg); border-top: 1px solid var(--border);
}
.addbar-label { font-size: 13px; font-weight: 600; color: #444; }
.add-input {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none;
}
.add-input:focus { border-color: var(--primary); }
.add-input.add-name { width: 200px; }
.add-input[type="number"] { width: 80px; }
.addbar-tip { font-size: 12px; color: #999; }

/* 可编辑序号单元格 */
.detail-table td.editable { cursor: text; }
.detail-table td.editable:hover { background: #f5f9f6; }

/* 详情：删除整行 */
.detail-table td.cell-del { width: 60px; padding: 4px; }
.row-del-btn {
  padding: 5px 10px; border: 1px solid #f0c0bb; background: #fff; color: var(--danger);
  border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.row-del-btn:hover:not(:disabled) { background: var(--danger); color: #fff; }
.row-del-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger:disabled { background: #e7b3ad; cursor: not-allowed; }

/* ===== 详情单元格键盘导航(Excel 式) ===== */
.detail-table td:focus { outline: 2px solid #2e7d32; outline-offset: -2px; background: #eef7ee; }
.detail-table td.editing:focus { outline: 2px solid #f0a500; background: #fffbe6; }
.detail-table td.nav-cell { cursor: cell; }
.detail-nav-hint { font-size: 12px; color: #999; padding: 0 4px; }
