:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-muted: #f7f8f6;
  --ink: #202622;
  --muted: #69726c;
  --line: #dce1dd;
  --line-strong: #c8cfca;
  --sidebar: #202723;
  --sidebar-soft: #2c352f;
  --green: #247a55;
  --green-soft: #e6f3ec;
  --blue: #2f6fad;
  --blue-soft: #e9f1f8;
  --amber: #aa671f;
  --amber-soft: #fff1df;
  --red: #b54646;
  --red-soft: #fbe9e8;
  --violet: #6d5b98;
  --violet-soft: #f0edf7;
  --shadow: 0 12px 30px rgba(28, 37, 32, 0.08);
  --radius: 6px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  min-width: 320px;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #f5f7f5;
  padding: 20px 14px 16px;
  border-right: 1px solid #161b18;
}

.brand-block { display: flex; align-items: center; gap: 11px; padding: 3px 8px 24px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: #eef6f1; color: var(--green); border-radius: 6px; }
.brand-mark img { width: 30px; height: 30px; object-fit: contain; }
.brand-mark svg { width: 21px; height: 21px; stroke-width: 2; }
.brand-block strong { display: block; font-size: 16px; line-height: 1.2; }
.brand-block span { color: #aeb8b1; font-size: 12px; }

.nav-list { display: grid; gap: 4px; }
.nav-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  color: #c8d0ca;
  background: transparent;
  text-align: left;
}
.nav-item:hover { color: #fff; background: #29312c; }
.nav-item.is-active { color: #fff; background: #35433b; box-shadow: inset 3px 0 0 #69bd91; }
.nav-item svg { width: 18px; height: 18px; }
.nav-count { min-width: 22px; padding: 1px 6px; border-radius: 10px; background: #49534d; color: #dfe5e1; font-size: 11px; text-align: center; }
.nav-count-alert { background: #793c3c; color: #fff; }

.sidebar-status { margin-top: auto; border-top: 1px solid #39423d; padding: 16px 8px 0; display: grid; gap: 13px; }
.status-row { display: flex; align-items: flex-start; gap: 9px; }
.status-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #89928d; box-shadow: 0 0 0 3px rgba(137, 146, 141, 0.12); }
.status-dot.connected { background: #6cc695; box-shadow: 0 0 0 3px rgba(108, 198, 149, 0.15); }
.status-dot.syncing { background: #e6a554; animation: pulse 1.4s infinite; }
.status-dot.failed { background: #d75d5d; box-shadow: 0 0 0 3px rgba(215, 93, 93, 0.16); }
.status-row strong, .status-row span { display: block; }
.status-row strong { font-size: 12px; font-weight: 650; }
.status-row span { font-size: 11px; color: #aab4ad; margin-top: 2px; overflow-wrap: anywhere; }
.schedule-row { display: flex; align-items: center; gap: 8px; color: #aab4ad; font-size: 11px; }
.schedule-row svg { width: 15px; height: 15px; }

.main-area { min-width: 0; padding: 0 28px 48px; }
.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.date-control, .top-actions { display: flex; align-items: center; gap: 10px; }
.date-heading { min-width: 158px; }
.date-heading span { display: block; color: var(--muted); font-size: 11px; }
.date-heading h1 { margin: 1px 0 0; font-size: 21px; line-height: 1.25; font-weight: 700; }

.icon-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
}
.icon-button:hover { border-color: #96a39b; background: var(--surface-muted); }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.is-spinning svg { animation: spin 1s linear infinite; }

.command-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #1f6849;
  border-radius: 5px;
  padding: 0 14px;
  color: #fff;
  background: var(--green);
  font-weight: 650;
}
.command-button:hover { background: #1e6d4b; }
.command-button svg { width: 17px; height: 17px; }
.freshness { color: var(--muted); font-size: 12px; }
input[type="date"], input[type="time"], input[type="number"], select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
}
#datePicker { width: 142px; }

.workday-banner { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 12px 14px; background: var(--blue-soft); border-left: 3px solid var(--blue); border-radius: 4px; }
.workday-banner svg { width: 20px; height: 20px; color: var(--blue); }
.workday-banner strong, .workday-banner span { display: block; }
.workday-banner span { color: #52636f; font-size: 12px; }

.view-panel { display: none; }
.view-panel.is-active { display: block; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}
.metric-item { min-height: 104px; padding: 18px 20px; border-right: 1px solid var(--line); }
.metric-item:last-child { border-right: 0; }
.metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.metric-label svg { width: 16px; height: 16px; }
.metric-value { margin-top: 8px; display: flex; align-items: baseline; gap: 5px; }
.metric-value strong { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-value span { color: var(--muted); font-size: 12px; }
.metric-note { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.metric-note.negative { color: var(--red); }
.metric-note.positive { color: var(--green); }
.management-strip { border-left: 3px solid var(--green); }
.management-strip .metric-item { min-height: 94px; padding-top: 15px; padding-bottom: 15px; }
.management-strip .metric-value strong { font-size: 26px; }

.workflow-heading-action { display: flex; align-items: center; gap: 9px; }
.workflow-overall { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 13px; color: #3e6485; background: var(--blue-soft); font-size: 11px; font-weight: 650; }
.workflow-overall.completed { color: #206443; background: var(--green-soft); }
.workflow-overall.failed { color: #993c3c; background: var(--red-soft); }
.workflow-overall.warning { color: #8a4e14; background: var(--amber-soft); }
.workflow-overall.not_applicable { color: #626b66; background: #ecefed; }
.workflow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.workflow-step { position: relative; min-height: 98px; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 10px; padding: 17px 18px; border-right: 1px solid var(--line); }
.workflow-step:last-child { border-right: 0; }
.workflow-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); }
.workflow-index svg { width: 16px; height: 16px; }
.workflow-step.completed .workflow-index { color: var(--green); background: var(--green-soft); }
.workflow-step.failed .workflow-index { color: var(--red); background: var(--red-soft); }
.workflow-step.warning .workflow-index { color: var(--amber); background: var(--amber-soft); }
.workflow-step.not_applicable .workflow-index { color: var(--muted); background: #ecefed; }
.workflow-step.running .workflow-index svg { animation: spin 1s linear infinite; }
.workflow-copy span, .workflow-copy strong, .workflow-copy small { display: block; overflow-wrap: anywhere; }
.workflow-copy span { color: var(--muted); font-size: 10px; }
.workflow-copy strong { margin-top: 2px; font-size: 12px; line-height: 1.35; }
.workflow-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.section-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}
.section-heading { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.section-heading.compact { min-height: 58px; }
.section-heading h2, .page-heading h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.section-kicker { display: block; color: var(--muted); font-size: 10px; margin-bottom: 2px; }
.section-value { color: var(--green); font-size: 13px; font-weight: 700; }
.legend { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.good { background: var(--green); }
.legend-dot.watch { background: var(--amber); }
.legend-dot.critical { background: var(--red); }

.table-shell { overflow-x: auto; }
.score-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.score-table th, .score-table td { padding: 13px 14px; border-bottom: 1px solid #e7ebe8; text-align: left; vertical-align: middle; }
.score-table th:first-child, .score-table td:first-child { width: 160px; }
.score-table th { color: var(--muted); background: #fafbfa; font-size: 11px; font-weight: 650; white-space: nowrap; }
.score-table td { font-size: 13px; }
.score-table tbody tr:last-child td { border-bottom: 0; }
.score-table tbody tr[data-employee] { cursor: pointer; }
.score-table tbody tr[data-employee]:hover { background: #fafcfa; }
.employee-cell { display: flex; align-items: center; gap: 9px; min-width: 118px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #e8ece9; color: #405048; font-weight: 700; font-size: 12px; }
.employee-cell strong, .employee-cell span { display: block; }
.employee-cell span { color: var(--muted); font-size: 10px; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 8px; border-radius: 12px; font-size: 11px; white-space: nowrap; }
.status-chip.on_time { color: #206443; background: var(--green-soft); }
.status-chip.late { color: #8a4e14; background: var(--amber-soft); }
.status-chip.missing, .status-chip.critical { color: #993c3c; background: var(--red-soft); }
.status-chip.pending, .status-chip.submitted, .status-chip.received { color: #3e6485; background: var(--blue-soft); }
.status-chip.draft { color: #626b66; background: #ecefed; }
.status-chip.not_applicable { color: #626b66; background: #ecefed; }
.module-score { display: inline-flex; align-items: baseline; gap: 2px; font-variant-numeric: tabular-nums; }
.module-score strong { font-size: 14px; }
.module-score span { color: #929a95; font-size: 10px; }
.total-score { display: flex; align-items: center; gap: 8px; }
.score-marker { width: 4px; height: 30px; border-radius: 3px; }
.score-marker.good { background: var(--green); }
.score-marker.watch { background: var(--amber); }
.score-marker.critical { background: var(--red); }
.total-score strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.row-action { color: #87918b; }
.row-action svg { width: 17px; height: 17px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr); gap: 18px; }
.chart-wrap { min-height: 250px; padding: 12px 14px 8px; }
.chart-wrap svg { display: block; width: 100%; height: 250px; overflow: visible; }
.chart-grid { stroke: #e5e9e6; stroke-width: 1; }
.chart-axis-label { fill: #7b847f; font-size: 10px; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.employee { stroke: var(--blue); }
.chart-point { fill: var(--surface); stroke: var(--green); stroke-width: 3; }
.chart-point.employee { stroke: var(--blue); }
.chart-value { fill: var(--ink); font-size: 10px; font-weight: 700; }
.chart-transition { stroke: #9aa39d; stroke-width: 1; stroke-dasharray: 4 4; }
.chart-transition-label { fill: #69726c; font-size: 9px; }
.empty-chart { color: var(--muted); display: grid; place-items: center; height: 230px; }

.platform-list { padding: 15px 18px 18px; display: grid; gap: 17px; }
.platform-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 46px; align-items: center; gap: 10px; }
.platform-name { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.platform-name svg { width: 15px; height: 15px; color: var(--muted); }
.progress-track { height: 8px; background: #e7ebe8; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--green); }
.progress-fill.instagram { background: var(--violet); }
.progress-fill.tiktok { background: #343b37; }
.progress-fill.groups { background: var(--blue); }
.platform-percent { text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

.text-button { border: 0; background: transparent; color: var(--green); padding: 4px 0; font-weight: 650; }
.alert-list { display: grid; }
.alert-row { display: grid; grid-template-columns: 8px 110px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e8ece9; }
.alert-row:last-child { border-bottom: 0; }
.alert-bar { width: 4px; height: 30px; border-radius: 2px; background: var(--blue); }
.alert-row.critical .alert-bar { background: var(--red); }
.alert-row.warning .alert-bar { background: var(--amber); }
.alert-employee { font-weight: 650; }
.alert-copy strong, .alert-copy span { display: block; }
.alert-copy strong { font-size: 12px; }
.alert-copy span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.alert-level { color: var(--muted); font-size: 10px; }
.empty-state { min-height: 120px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }

.page-heading { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.page-heading h2 { font-size: 19px; }
.page-heading select { min-width: 140px; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.source-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: var(--surface); font-size: 11px; }

.management-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.management-stat { min-height: 82px; padding: 13px 15px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); background: var(--surface); border-radius: 5px; }
.management-stat span, .management-stat strong, .management-stat small { display: block; }
.management-stat span { color: var(--muted); font-size: 11px; }
.management-stat strong { margin-top: 3px; font-size: 21px; font-variant-numeric: tabular-nums; }
.management-stat small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.management-stat.positive { border-left-color: var(--green); }
.management-stat.warning { border-left-color: var(--amber); }
.management-stat.critical { border-left-color: var(--red); }

.attendance-table { min-width: 880px; }
.attendance-table th:first-child, .attendance-table td:first-child { width: 150px; }
.attendance-table th:last-child, .attendance-table td:last-child { width: 92px; }
.tabular-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted-value, .cell-subline, .cell-note { display: block; color: var(--muted); font-size: 10px; }
.cell-note { margin-top: 3px; }
.score-inline { color: var(--ink); font-variant-numeric: tabular-nums; }
.status-chip.attendance-present { color: #206443; background: var(--green-soft); }
.status-chip.attendance-late { color: #8a4e14; background: var(--amber-soft); }
.status-chip.attendance-leave, .status-chip.attendance-business_trip { color: #3e6485; background: var(--blue-soft); }
.status-chip.attendance-absent { color: #993c3c; background: var(--red-soft); }
.status-chip.attendance-unrecorded, .status-chip.attendance-not_applicable { color: #626b66; background: #ecefed; }
.manager-leave-request-list { display: grid; }
.manager-leave-request { min-width: 0; min-height: 76px; display: grid; grid-template-columns: 5px 140px 180px minmax(220px, 1fr) auto auto; align-items: center; gap: 13px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.manager-leave-request:last-child { border-bottom: 0; }
.manager-leave-marker { width: 5px; height: 42px; border-radius: 3px; background: var(--amber); }
.manager-leave-request.approved .manager-leave-marker { background: var(--green); }
.manager-leave-request.rejected .manager-leave-marker, .manager-leave-request.cancelled .manager-leave-marker { background: #aeb6b0; }
.manager-leave-employee strong, .manager-leave-employee span, .manager-leave-dates strong, .manager-leave-dates span, .manager-leave-reason strong, .manager-leave-reason span { display: block; }
.manager-leave-employee strong, .manager-leave-dates strong, .manager-leave-reason strong { font-size: 11px; }
.manager-leave-employee span, .manager-leave-dates span, .manager-leave-reason span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.manager-leave-reason { min-width: 0; }
.manager-leave-reason strong { overflow-wrap: anywhere; }
.status-chip.leave-request-pending { color: #8a4e14; background: var(--amber-soft); }
.status-chip.leave-request-approved { color: #206443; background: var(--green-soft); }
.status-chip.leave-request-rejected, .status-chip.leave-request-cancelled { color: #626b66; background: #ecefed; }
.manager-leave-actions { display: flex; justify-content: flex-end; gap: 6px; }
.manager-leave-actions button { min-height: 34px; padding: 0 10px; }
.manager-leave-actions svg { width: 15px; height: 15px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.row-icon-button { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 4px; color: #4b5a52; background: var(--surface); }
.row-icon-button:hover { color: var(--green); border-color: #9ab3a5; background: var(--green-soft); }
.row-icon-button svg { width: 15px; height: 15px; }

.task-table { min-width: 970px; }
.task-table th:first-child, .task-table td:first-child { width: 31%; }
.task-table th:nth-child(2), .task-table td:nth-child(2) { width: 138px; }
.task-table th:nth-child(5), .task-table td:nth-child(5) { width: 126px; }
.task-table th:last-child, .task-table td:last-child { width: 52px; }
.task-title-cell strong, .task-title-cell span { display: block; }
.task-title-cell span { max-width: 360px; margin-top: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.priority-chip { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 8px; border-radius: 12px; color: #4e5a53; background: #ecefed; font-size: 10px; }
.priority-chip.high { color: #8a4e14; background: var(--amber-soft); }
.priority-chip.urgent { color: #993c3c; background: var(--red-soft); }
.priority-chip.low { color: #3e6485; background: var(--blue-soft); }
.inline-status-select { width: 108px; height: 30px; padding: 0 24px 0 8px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 11px; }
.inline-status-select.completed { color: #206443; border-color: #afd0bd; background: var(--green-soft); }
.inline-status-select.overdue, .inline-status-select.blocked { color: #993c3c; border-color: #dfb5b5; background: var(--red-soft); }
.inline-status-select.submitted { color: #3e6485; border-color: #b9ccdd; background: var(--blue-soft); }
.source-label { color: var(--muted); font-size: 10px; white-space: nowrap; }

.activity-list { display: grid; }
.activity-row { min-height: 58px; display: grid; grid-template-columns: 32px minmax(0, 1fr) 94px; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid #e7ebe8; }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 50%; }
.activity-icon svg { width: 15px; height: 15px; }
.activity-row strong, .activity-row span { display: block; }
.activity-row strong { font-size: 12px; }
.activity-row div span, .activity-row time { color: var(--muted); font-size: 10px; }
.activity-row time { text-align: right; font-variant-numeric: tabular-nums; }

.employee-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.employee-stat { padding: 16px 18px; border-right: 1px solid var(--line); }
.employee-stat:last-child { border-right: 0; }
.employee-stat span, .employee-stat strong { display: block; }
.employee-stat span { color: var(--muted); font-size: 11px; }
.employee-stat strong { margin-top: 4px; font-size: 22px; }
.employee-chart-wrap { min-height: 300px; }
.employee-chart-wrap svg { height: 300px; }
.compact-table th, .compact-table td { padding-top: 10px; padding-bottom: 10px; }
.rubric-chip { display: inline-flex; min-height: 22px; align-items: center; padding: 2px 7px; border-radius: 11px; white-space: nowrap; font-size: 10px; }
.rubric-chip.legacy { color: #625b44; background: #f3efe3; }
.rubric-chip.hard_metrics { color: #285f8e; background: var(--blue-soft); }

.mail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.mail-stat { min-height: 74px; padding: 13px 15px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; }
.mail-stat span, .mail-stat strong { display: block; }
.mail-stat span { color: var(--muted); font-size: 11px; }
.mail-stat strong { margin-top: 3px; font-size: 20px; }
.mailbox-table th:nth-child(6), .mailbox-table td:nth-child(6) { width: 33%; }
.mail-summary-copy { color: #4f5953; font-size: 11px; line-height: 1.45; }
.log-source-cell strong, .log-source-cell span { display: block; }
.log-source-cell span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.link-button { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--blue); }
.link-button svg { width: 15px; height: 15px; }

.correction-list { display: grid; gap: 12px; }
.correction-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); overflow: hidden; }
.correction-item.critical { border-left-color: var(--red); }
.correction-item.warning { border-left-color: var(--amber); }
.correction-item.info { border-left-color: var(--blue); }
.correction-meta { padding: 15px; background: #fafbfa; border-right: 1px solid var(--line); }
.correction-meta strong, .correction-meta span { display: block; }
.correction-meta span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.correction-content { padding: 15px 18px; }
.correction-content h3 { margin: 0 0 7px; font-size: 14px; }
.correction-content p { margin: 0; color: #505a54; font-size: 12px; }
.correction-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.correction-box { padding: 10px 12px; background: var(--surface-muted); border: 1px solid #e3e7e4; border-radius: 4px; }
.correction-box span, .correction-box strong { display: block; }
.correction-box span { color: var(--muted); font-size: 10px; }
.correction-box strong { margin-top: 3px; font-size: 11px; line-height: 1.45; }

.topbar.customer-context .date-control > .icon-button,
.topbar.customer-context #datePicker,
.topbar.customer-context #gmailRefresh { display: none; }
.topbar.customer-context .date-heading { min-width: 260px; }
.customer-filter-block { padding: 16px 18px; }
.customer-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) minmax(150px, 0.72fr);
  align-items: end;
  gap: 12px;
}
.filter-field { min-width: 0; display: grid; gap: 5px; }
.filter-field > span { color: var(--muted); font-size: 10px; }
.filter-field input, .filter-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  background: var(--surface);
}
.filter-field input:focus, .filter-field select:focus {
  outline: 2px solid rgba(36, 122, 85, 0.17);
  border-color: var(--green);
}
.customer-filter-reset { align-self: end; }
.customer-table { min-width: 1160px; }
.customer-table th:first-child, .customer-table td:first-child { width: 190px; }
.customer-table th:nth-child(2), .customer-table td:nth-child(2) { width: 190px; }
.customer-table th:nth-child(3), .customer-table td:nth-child(3) { width: 24%; }
.customer-table th:nth-child(4), .customer-table td:nth-child(4) { width: 145px; }
.customer-table th:nth-child(5), .customer-table td:nth-child(5) { width: 108px; }
.customer-table th:nth-child(6), .customer-table td:nth-child(6) { width: 112px; }
.customer-table th:nth-child(7), .customer-table td:nth-child(7) { width: 130px; }
.customer-table th:last-child, .customer-table td:last-child { width: 52px; }
.customer-table tbody tr { cursor: pointer; }
.customer-table tbody tr:hover { background: #fafcfa; }
.customer-name-cell strong, .customer-name-cell span,
.customer-contact-cell strong, .customer-contact-cell span,
.customer-marketing-cell strong, .customer-marketing-cell span { display: block; }
.customer-name-cell strong { font-size: 13px; }
.customer-name-cell span, .customer-contact-cell span,
.customer-marketing-cell span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.customer-contact-cell strong { font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }
.customer-product-cell { color: #4f5953; font-size: 11px; line-height: 1.45; }
.customer-product-cell span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.customer-status-new { color: #626b66; background: #ecefed; }
.customer-status-contacted { color: #3e6485; background: var(--blue-soft); }
.customer-status-interested, .customer-status-quoted,
.customer-status-sample, .customer-status-negotiating { color: #8a4e14; background: var(--amber-soft); }
.customer-status-won { color: #206443; background: var(--green-soft); }
.customer-status-dormant, .customer-status-lost { color: #993c3c; background: var(--red-soft); }
.customer-name-cell .customer-level { display: inline-grid; place-items: center; min-width: 20px; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; color: #315f78; background: var(--blue-soft); font-size: 9px; font-weight: 750; vertical-align: middle; }
.follow-up-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.follow-up-date.due { color: var(--red); font-weight: 700; }

.customer-tools-section { overflow: visible; }
.tool-tabs { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.tool-tabs button { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: 11px; }
.tool-tabs button:last-child { border-right: 0; }
.tool-tabs button:hover { color: var(--ink); background: var(--surface-muted); }
.tool-tabs button.is-active { color: #fff; background: var(--green); }
.tool-tabs svg { width: 15px; height: 15px; }
.tool-panel { display: none; padding: 20px 18px; }
.tool-panel.is-active { display: block; }
.tool-form-grid { display: grid; align-items: end; gap: 12px; }
.timezone-tool-grid { grid-template-columns: minmax(220px, 0.9fr) minmax(240px, 1.1fr) minmax(260px, 1fr); }
.conversion-tool-grid { grid-template-columns: 120px minmax(140px, 0.7fr) minmax(150px, 0.9fr) 36px minmax(150px, 0.9fr) minmax(220px, 1.1fr); }
.currency-tool-grid { grid-template-columns: minmax(140px, 0.65fr) minmax(150px, 0.8fr) 36px minmax(150px, 0.8fr) auto minmax(240px, 1.2fr); }
.conversion-swap { align-self: end; width: 38px; height: 38px; }
.tool-result { min-height: 68px; display: grid; align-content: center; padding: 10px 14px; border-left: 3px solid var(--green); background: var(--green-soft); border-radius: 4px; }
.tool-result span, .tool-result strong, .tool-result small { display: block; }
.tool-result span { color: #4f6c5c; font-size: 10px; }
.tool-result strong { margin-top: 2px; font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tool-result small { margin-top: 2px; color: #5a6e63; font-size: 10px; }
.compact-result { min-height: 38px; padding-top: 7px; padding-bottom: 7px; }
.compact-result strong { font-size: 17px; }
.customs-library-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); overflow: hidden; }
.customs-library-summary > div { min-height: 72px; display: grid; align-content: center; padding: 10px 14px; border-right: 1px solid var(--line); }
.customs-library-summary > div:last-child { border-right: 0; }
.customs-library-summary span, .customs-library-summary strong, .customs-library-summary small { display: block; }
.customs-library-summary span { color: var(--muted); font-size: 9px; }
.customs-library-summary strong { margin-top: 2px; font-size: 20px; font-variant-numeric: tabular-nums; }
.customs-library-summary small { color: var(--muted); font-size: 9px; }
.customs-quick-search { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.customs-quick-search > span { margin-right: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.customs-quick-search button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 4px; color: #315f49; background: var(--green-soft); font-size: 9px; }
.customs-filter-grid { display: grid; grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(145px, 0.7fr)) auto; align-items: end; gap: 10px; }
.customs-search-actions { display: flex; align-items: center; gap: 6px; }
.customs-search-actions .command-button { min-height: 38px; }
.customs-search-actions .icon-button { width: 38px; height: 38px; }
.customs-result-heading { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.customs-result-heading span, .customs-result-heading strong { display: block; }
.customs-result-heading span { color: var(--muted); font-size: 9px; }
.customs-result-heading strong { margin-top: 2px; font-size: 11px; }
.customs-pagination { display: inline-flex; align-items: center; gap: 7px; }
.customs-pagination button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--surface); }
.customs-pagination button:disabled { color: #a5ada7; background: var(--surface-muted); }
.customs-pagination svg { width: 15px; height: 15px; }
.customs-pagination span { min-width: 46px; color: var(--muted); text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.customs-results { display: grid; gap: 8px; }
.customs-result-row { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 4px; }
.customs-code-cell { min-width: 0; }
.customs-code-cell code { display: block; color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 750; overflow-wrap: anywhere; }
.customs-code-cell span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.customs-result-copy { min-width: 0; }
.customs-result-copy strong, .customs-result-copy span, .customs-result-copy small, .customs-result-copy em { display: block; }
.customs-result-copy strong { font-size: 12px; line-height: 1.5; }
.customs-result-copy .customs-english-name { margin-top: 3px; color: #4e5c54; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.customs-result-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.customs-result-copy em { margin-top: 5px; color: var(--amber); font-size: 9px; font-style: normal; line-height: 1.45; }
.customs-disclaimer { margin-top: 12px; padding: 9px 11px; border-left: 3px solid var(--amber); color: #76512e; background: var(--amber-soft); font-size: 10px; line-height: 1.5; }

.detail-drawer.customer-detail-drawer { width: min(760px, 94vw); }
.drawer-header-actions { display: flex; align-items: center; gap: 6px; }
.customer-drawer-body { padding: 0; }
.customer-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.customer-detail-stat { min-height: 76px; padding: 13px 15px; border-right: 1px solid var(--line); }
.customer-detail-stat:last-child { border-right: 0; }
.customer-detail-stat span, .customer-detail-stat strong { display: block; }
.customer-detail-stat span { color: var(--muted); font-size: 10px; }
.customer-detail-stat strong { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.customer-detail-main { padding: 18px; }
.customer-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.customer-detail-field { min-height: 68px; padding: 11px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.customer-detail-field:nth-child(2n) { border-right: 0; }
.customer-detail-field:nth-last-child(-n+2) { border-bottom: 0; }
.customer-detail-field.full { grid-column: 1 / -1; border-right: 0; }
.customer-detail-field span, .customer-detail-field strong, .customer-detail-field a { display: block; }
.customer-detail-field span { color: var(--muted); font-size: 10px; }
.customer-detail-field strong, .customer-detail-field a { margin-top: 3px; color: var(--ink); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.customer-detail-field a { color: var(--blue); text-decoration: none; }
.customer-history { margin-top: 18px; }
.customer-history-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.customer-history-heading h3 { margin: 0; font-size: 13px; }
.customer-history-heading span { color: var(--muted); font-size: 10px; }
.customer-timeline { display: grid; }
.customer-timeline-item { position: relative; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px 0 12px 18px; border-left: 2px solid var(--line); }
.customer-timeline-item::before { content: ""; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.customer-timeline-meta strong, .customer-timeline-meta span { display: block; }
.customer-timeline-meta strong { font-size: 10px; }
.customer-timeline-meta span { color: var(--muted); font-size: 9px; }
.customer-timeline-copy { padding: 10px 12px; background: var(--surface-muted); border-radius: 4px; }
.customer-timeline-copy strong, .customer-timeline-copy span { display: block; }
.customer-timeline-copy strong { font-size: 11px; line-height: 1.5; }
.customer-timeline-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.customer-note-form { border-top: 1px solid var(--line); }
.customer-note-form .section-heading { background: #fafbfa; }
.customer-note-fields { display: grid; gap: 12px; padding: 16px 18px 20px; }
.customer-note-actions { display: flex; justify-content: flex-end; }
.customer-dialog { width: min(820px, calc(100vw - 30px)); }

.settings-form, .system-section { max-width: 780px; }
.mobile-account-section { max-width: 940px; }
.mobile-access-section { max-width: 940px; }
.mobile-access-layout { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(300px, 1.2fr); align-items: center; gap: 18px; padding: 16px 18px; }
.mobile-access-detail { min-width: 0; display: flex; align-items: center; gap: 10px; }
.mobile-access-detail > svg { width: 22px; height: 22px; flex: 0 0 22px; color: var(--green); }
.mobile-access-detail strong, .mobile-access-detail span { display: block; }
.mobile-access-detail strong { font-size: 12px; }
.mobile-access-detail span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.mobile-access-url { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 36px 36px; gap: 7px; }
.mobile-access-url input { min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; color: #3f4943; background: var(--surface-muted); font-size: 11px; }
.mobile-access-url .row-icon-button { width: 36px; height: 36px; }
.settings-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.setting-row { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.setting-row strong, .setting-row span { display: block; }
.setting-row strong { font-size: 13px; }
.setting-row span { color: var(--muted); font-size: 11px; }
.setting-row input[type="number"] { width: 92px; }
.inline-inputs { display: flex; align-items: flex-end; gap: 10px; }
.inline-inputs label { display: grid; gap: 3px; }
.inline-inputs label span { font-size: 10px; }
.inline-inputs input[type="number"] { width: 76px; }
.unit-input { display: flex; align-items: center; gap: 7px; }
.unit-input span { color: var(--muted); font-size: 11px; }
.settings-actions { padding: 14px 18px; display: flex; justify-content: flex-end; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 42px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: #c6cdc8; transition: background 160ms ease; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.18); transition: transform 160ms ease; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.system-list { display: grid; grid-template-columns: 160px minmax(0, 1fr); margin: 0; }
.system-list dt, .system-list dd { margin: 0; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.system-list dt { color: var(--muted); background: #fafbfa; font-size: 11px; }
.system-list dd { font-size: 12px; overflow-wrap: anywhere; }
.account-table { min-width: 760px; }
.account-table th:first-child, .account-table td:first-child { width: 210px; }
.account-table th:last-child, .account-table td:last-child { width: 92px; }
.account-status { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 8px; border-radius: 12px; color: #626b66; background: #ecefed; font-size: 10px; }
.account-status.active { color: #206443; background: var(--green-soft); }
.account-status.disabled { color: #993c3c; background: var(--red-soft); }
.danger-icon { color: var(--red); }
.danger-icon:hover { color: var(--red); border-color: #dab1b1; background: var(--red-soft); }
.credential-notice { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-left: 3px solid var(--blue); border-radius: 4px; color: #365871; background: var(--blue-soft); font-size: 11px; }
.credential-notice svg { width: 18px; height: 18px; flex: 0 0 18px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; }
.copy-field input { min-width: 0; }
.copy-field .row-icon-button { width: 34px; height: 36px; }

.management-dialog { width: min(620px, calc(100vw - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 6px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 65px rgba(19, 27, 22, 0.24); overflow: hidden; }
.management-dialog.task-dialog { width: min(740px, calc(100vw - 30px)); }
.management-dialog::backdrop { background: rgba(18, 24, 20, 0.46); }
.management-dialog form { max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.dialog-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.dialog-header span { display: block; color: var(--muted); font-size: 10px; }
.dialog-header h2 { margin: 2px 0 0; font-size: 17px; }
.dialog-body { padding: 16px; display: grid; gap: 13px; overflow-y: auto; }
.dialog-feedback { min-height: 44px; display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; border: 1px solid #e2b7b7; border-left: 3px solid var(--red); border-radius: 4px; color: #8e3333; background: var(--red-soft); font-size: 11px; line-height: 1.5; }
.dialog-feedback[hidden] { display: none; }
.dialog-feedback svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.dialog-feedback.warning { border-color: #e7ca98; border-left-color: var(--amber); color: #815117; background: var(--amber-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.three-columns { grid-template-columns: 1.15fr 0.85fr 0.9fr; }
.form-field { display: grid; gap: 5px; min-width: 0; }
.form-field > span { color: var(--muted); font-size: 11px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--surface); }
.form-field input, .form-field select { height: 36px; padding: 0 10px; }
.form-field textarea { min-height: 76px; padding: 9px 10px; resize: vertical; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 2px solid rgba(36, 122, 85, 0.17); border-color: var(--green); }
.dialog-footer { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfa; }
.dialog-footer > div { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.secondary-button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: var(--surface); }
.secondary-button:hover { background: var(--surface-muted); }
.danger-text-button { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 5px; border: 0; color: var(--red); background: transparent; }
.danger-text-button svg { width: 16px; height: 16px; }

.page-heading-actions { display: flex; align-items: center; gap: 8px; }
.operations-two-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr); gap: 18px; }
.operations-two-column > .section-block { min-width: 0; }
.weekly-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.weekly-plan-item { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.weekly-plan-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.weekly-plan-title span, .weekly-plan-title strong { display: block; overflow-wrap: anywhere; }
.weekly-plan-title span { color: var(--muted); font-size: 10px; }
.weekly-plan-title strong { margin-top: 3px; font-size: 17px; }
.weekly-plan-item dl { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 7px 9px; margin: 14px 0 0; }
.weekly-plan-item dt { color: var(--muted); font-size: 10px; }
.weekly-plan-item dd { margin: 0; color: #48514c; font-size: 11px; overflow-wrap: anywhere; }
.weekly-plan-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.operations-empty-plan { grid-column: 1 / -1; }
.target-count { display: inline-flex; min-width: 52px; justify-content: center; padding: 4px 8px; border-radius: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.target-count.complete { color: #206443; background: var(--green-soft); }
.target-count.open { color: #8a4e14; background: var(--amber-soft); }
.completion-cell { min-width: 110px; }
.completion-cell strong { display: block; margin-bottom: 5px; font-size: 13px; }
.completion-cell span { width: 100%; height: 5px; display: block; overflow: hidden; border-radius: 3px; background: #e6eae7; }
.completion-cell b { display: block; height: 100%; background: var(--green); }
.effect-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.effect-summary > div { padding: 13px 12px; border-right: 1px solid var(--line); }
.effect-summary > div:last-child { border-right: 0; }
.effect-summary span, .effect-summary strong { display: block; }
.effect-summary span { color: var(--muted); font-size: 9px; }
.effect-summary strong { margin-top: 3px; font-size: 18px; font-variant-numeric: tabular-nums; }
.compact-table-shell { border-top: 0; }
.account-metric-table { min-width: 760px; }
.inline-link { color: var(--green); font-size: 11px; font-weight: 700; text-decoration: none; }
.inline-link:hover { text-decoration: underline; }
.effect-table { min-width: 580px; }
.operations-reminder-list { display: grid; }
.operations-reminder { min-height: 74px; display: grid; grid-template-columns: 4px minmax(0, 1fr); gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.operations-reminder:last-child { border-bottom: 0; }
.operations-reminder > span { border-radius: 2px; background: var(--blue); }
.operations-reminder.warning > span { background: var(--amber); }
.operations-reminder.critical > span { background: var(--red); }
.operations-reminder strong, .operations-reminder p, .operations-reminder small { display: block; margin: 0; }
.operations-reminder strong { font-size: 11px; }
.operations-reminder p { margin-top: 3px; color: #4e5852; font-size: 10px; }
.operations-reminder small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.operations-target-table { min-width: 860px; }
.execution-table { min-width: 1080px; }
.execution-copy-title, .result-compact { display: block; max-width: 240px; overflow-wrap: anywhere; }
.result-compact { color: #4f5953; font-size: 10px; line-height: 1.6; }
.platform-chip { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 7px; border-radius: 4px; color: #305c7d; background: var(--blue-soft); font-size: 10px; font-weight: 650; }
.platform-chip.instagram { color: #704c80; background: var(--violet-soft); }
.platform-chip.tiktok { color: #343434; background: #ececec; }
.platform-chip.linkedin { color: #2f638f; background: #e7f0f7; }
.platform-chip.whatsapp { color: #206443; background: var(--green-soft); }
.status-chip.completed, .status-chip.verified, .status-chip.active, .status-chip.risk-normal { color: #206443; background: var(--green-soft); }
.status-chip.warning, .status-chip.warming, .status-chip.limited, .status-chip.risk-watch { color: #8a4e14; background: var(--amber-soft); }
.status-chip.rejected, .status-chip.disabled, .status-chip.risk-blocked { color: #993c3c; background: var(--red-soft); }
.critical-text { color: var(--red) !important; }
.correction-workflow-status { margin-top: 7px; display: inline-flex; width: fit-content; padding: 3px 7px; border-radius: 10px; color: #8a4e14; background: var(--amber-soft); font-size: 9px; }
.correction-workflow-status.closed { color: #206443; background: var(--green-soft); }
.correction-response { display: grid; gap: 3px; margin-top: 12px; padding: 10px 11px; border-left: 3px solid var(--blue); background: var(--blue-soft); }
.correction-response span, .correction-response small { color: #557084; font-size: 9px; }
.correction-response strong { font-size: 11px; }
.correction-manager-actions { display: flex; justify-content: flex-end; margin-top: 11px; }
.correction-manager-actions button { display: inline-flex; align-items: center; gap: 6px; }
.correction-manager-actions svg { width: 15px; height: 15px; }
.data-maintenance-section { max-width: 1080px; }
.export-controls { display: grid; grid-template-columns: 150px 150px minmax(180px, 1fr) auto auto; align-items: end; gap: 10px; padding: 16px 18px; }
.weekly-plan-dialog, .social-account-dialog { width: min(760px, calc(100vw - 30px)); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(18, 24, 20, 0.34); }
.detail-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(620px, 92vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: -18px 0 45px rgba(18, 27, 22, 0.16); transform: translateX(102%); transition: transform 180ms ease; }
.detail-drawer[aria-hidden="true"] { visibility: hidden; pointer-events: none; }
.detail-drawer.is-open { visibility: visible; pointer-events: auto; transform: translateX(0); }
.drawer-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-header span { color: var(--muted); font-size: 11px; }
.drawer-header h2 { margin: 2px 0 0; font-size: 19px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-score { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.score-box { min-height: 92px; display: grid; place-items: center; border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: 5px; }
.score-box.pending { border-left-color: var(--blue); background: var(--blue-soft); }
.score-box.watch { border-left-color: var(--amber); }
.score-box.critical { border-left-color: var(--red); }
.score-box strong { font-size: 34px; line-height: 1; }
.score-box span { color: var(--muted); font-size: 11px; }
.drawer-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.drawer-module { padding: 9px 10px; background: var(--surface-muted); border-radius: 4px; }
.drawer-module span, .drawer-module strong { display: block; }
.drawer-module span { color: var(--muted); font-size: 10px; }
.drawer-module strong { font-size: 15px; }
.drawer-section { padding: 17px 0; border-bottom: 1px solid var(--line); }
.drawer-section:last-child { border-bottom: 0; }
.drawer-section h3 { margin: 0 0 9px; font-size: 13px; }
.drawer-section .empty-state { min-height: auto; justify-items: start; padding: 4px 0; text-align: left; }
.drawer-section ul, .drawer-section ol { margin: 0; padding-left: 20px; }
.drawer-section li { margin: 6px 0; color: #4f5953; font-size: 12px; }
.drawer-correction { padding: 11px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 4px; }
.drawer-correction strong, .drawer-correction span { display: block; }
.drawer-correction span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.drawer-mail { display: grid; gap: 7px; padding: 11px 12px; background: var(--blue-soft); border-radius: 4px; font-size: 11px; }

.sync-panel { position: fixed; right: 22px; bottom: 22px; z-index: 40; width: min(380px, calc(100vw - 34px)); display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 12px; color: #fff; background: #29342e; border: 1px solid #3b4841; border-radius: 6px; box-shadow: var(--shadow); }
.sync-spinner { width: 34px; height: 34px; display: grid; place-items: center; background: #3b4a42; border-radius: 50%; }
.sync-spinner svg { width: 18px; height: 18px; animation: spin 1s linear infinite; }
.sync-panel strong, .sync-panel span { display: block; }
.sync-panel strong { font-size: 12px; }
.sync-panel span { color: #bfc9c3; font-size: 11px; }
.sync-panel .icon-button { border-color: #4b5951; color: #fff; background: transparent; }
.sync-panel[data-status="failed"] { background: #4b2929; border-color: #764343; }
.sync-panel[data-status="failed"] .sync-spinner { background: #673737; }
.sync-panel[data-status="failed"] .sync-spinner svg { animation: none; }
.sync-panel[data-status="completed"] .sync-spinner svg { animation: none; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); min-width: 220px; max-width: min(520px, calc(100vw - 30px)); padding: 10px 14px; color: #fff; background: #28312c; border-radius: 5px; box-shadow: var(--shadow); text-align: center; font-size: 12px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .brand-block { justify-content: center; padding-left: 0; padding-right: 0; }
  .brand-block > div:last-child, .nav-item span:not(.nav-count), .sidebar-status { display: none; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; position: relative; }
  .nav-count { position: absolute; top: 2px; right: 2px; min-width: 17px; padding: 0 4px; }
  .overview-grid { grid-template-columns: 1fr; }
  .workflow-steps { grid-template-columns: 1fr 1fr; }
  .workflow-step:nth-child(2) { border-right: 0; }
  .workflow-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .customer-filter-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .timezone-tool-grid, .conversion-tool-grid, .currency-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conversion-swap { display: none; }
  .tool-result, .currency-result { min-height: 64px; }
  .customs-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .customs-query-field { grid-column: 1 / -1; }
  .customs-search-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .customs-search-actions .command-button { min-width: 100px; }
  .operations-two-column { grid-template-columns: 1fr; gap: 0; }
  .export-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manager-leave-request { grid-template-columns: 5px 130px 160px minmax(180px, 1fr) auto; }
  .manager-leave-actions { grid-column: 2 / -1; justify-content: flex-start; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 25; width: 100%; height: 62px; padding: 7px 8px; border-right: 0; border-top: 1px solid #161b18; }
  .brand-block, .sidebar-status { display: none; }
  .nav-list { height: 100%; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 2px; }
  .nav-item { min-height: 48px; display: flex; flex-direction: column; justify-content: center; gap: 2px; font-size: 9px; }
  .nav-item span:not(.nav-count) { display: block; }
  .nav-item.is-active { box-shadow: inset 0 3px 0 #69bd91; }
  .nav-item svg { width: 17px; height: 17px; }
  .nav-count { top: 0; right: 10px; }
  .main-area { padding: 0 12px 82px; }
  .topbar { min-height: auto; padding: 12px 0; align-items: flex-start; flex-direction: column; }
  .date-control { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 8px; }
  .date-heading { min-width: 0; flex: 1; }
  #datePicker { width: 100%; grid-column: 1 / -1; }
  .top-actions { width: 100%; }
  .freshness { flex: 1; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-item { min-height: 90px; padding: 14px; border-bottom: 1px solid var(--line); }
  .metric-item:nth-child(2) { border-right: 0; }
  .metric-item:nth-child(3), .metric-item:nth-child(4) { border-bottom: 0; }
  .metric-value strong { font-size: 25px; }
  .workflow-steps { grid-template-columns: 1fr; }
  .workflow-step { min-height: 82px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workflow-step:nth-child(2) { border-right: 0; }
  .workflow-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workflow-step:last-child { border-bottom: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .legend { flex-wrap: wrap; }
  .score-table { min-width: 720px; }
  .compact-table { min-width: 820px; }
  .overview-grid { display: block; }
  .alert-row { grid-template-columns: 7px 74px minmax(0, 1fr); }
  .alert-level { display: none; }
  .employee-summary { grid-template-columns: 1fr 1fr; }
  .employee-stat:nth-child(2) { border-right: 0; }
  .employee-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .mail-summary { grid-template-columns: 1fr; }
  .management-summary { grid-template-columns: 1fr 1fr; }
  .manager-leave-request { grid-template-columns: 5px minmax(0, 1fr) auto; gap: 10px; }
  .manager-leave-dates, .manager-leave-reason { grid-column: 2 / -1; }
  .manager-leave-actions { grid-column: 2 / -1; }
  .task-page-heading { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions select { min-width: 0; flex: 1; }
  .correction-item { grid-template-columns: 1fr; }
  .correction-meta { border-right: 0; border-bottom: 1px solid var(--line); }
  .correction-actions { grid-template-columns: 1fr; }
  .setting-row { align-items: flex-start; }
  .inline-inputs { flex-wrap: wrap; justify-content: flex-end; }
  .system-list { grid-template-columns: 115px minmax(0, 1fr); }
  .mobile-access-layout { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .form-grid, .form-grid.three-columns { grid-template-columns: 1fr; }
  .management-dialog, .management-dialog.task-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .management-dialog.customer-dialog { width: calc(100vw - 20px); }
  .management-dialog form { max-height: calc(100vh - 20px); }
  .dialog-footer { align-items: stretch; flex-direction: column-reverse; }
  .dialog-footer > div { width: 100%; margin-left: 0; }
  .dialog-footer > div > button { flex: 1; }
  .customer-filter-grid, .timezone-tool-grid, .conversion-tool-grid, .currency-tool-grid { grid-template-columns: 1fr; }
  .customer-filter-reset { width: 100%; }
  .tool-tabs { width: 100%; }
  .tool-tabs button { min-width: 0; flex: 1; justify-content: center; padding: 0 7px; }
  .tool-tabs button span { display: none; }
  .customs-library-summary { grid-template-columns: 1fr; }
  .customs-library-summary > div { min-height: 60px; border-right: 0; border-bottom: 1px solid var(--line); }
  .customs-library-summary > div:last-child { border-bottom: 0; }
  .customs-filter-grid { grid-template-columns: 1fr; }
  .customs-search-actions > .command-button { flex: 1; }
  .customs-result-row { grid-template-columns: 1fr; gap: 8px; }
  .customs-result-heading { align-items: flex-start; flex-direction: column; }
  .customer-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-detail-stat:nth-child(2) { border-right: 0; }
  .customer-detail-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .customer-detail-grid { grid-template-columns: 1fr; }
  .customer-detail-field, .customer-detail-field:nth-child(2n), .customer-detail-field:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .customer-detail-field:last-child { border-bottom: 0; }
  .customer-timeline-item { grid-template-columns: 1fr; gap: 5px; }
  .operations-page-heading { align-items: flex-start; }
  .page-heading-actions { width: 100%; }
  .page-heading-actions > * { flex: 1; }
  .effect-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .effect-summary > div { border-bottom: 1px solid var(--line); }
  .export-controls { grid-template-columns: 1fr; }
}
