:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --line: #d6e0ec;
  --accent: #0891b2;
  --accent-soft: #e6f7fb;
  --accent-strong: #155e75;
  --nav: #111827;
  --nav-soft: #1f2937;
  --cyan: #22d3ee;
  --soft-green: #e9f8ef;
  --soft-amber: #fff6df;
  --danger: #d92d20;
  --success: #067647;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Release history */
.changelog-layout {
  grid-template-columns: minmax(0, 1fr);
}

.changelog-panel {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.changelog-heading {
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2eaf3;
}

.changelog-heading h2 {
  margin: 4px 0 6px;
}

.changelog-heading p {
  margin: 0;
}

.changelog-kicker {
  color: #0891b2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.current-version,
.release-version {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #bfe7ef;
  border-radius: 999px;
  background: #ecfeff;
  color: #0e7490;
  font-weight: 800;
  white-space: nowrap;
}

.changelog-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.release-entry {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  background: #fbfdff;
}

.release-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.release-date {
  color: #708097;
  font-size: 13px;
}

.release-content h3 {
  margin: 0 0 7px;
  color: #142033;
  font-size: 18px;
}

.release-content > p {
  margin: 0 0 12px;
  color: #5d6b82;
  line-height: 1.6;
}

.release-content ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #334155;
  line-height: 1.55;
}

.release-content li::marker {
  color: #06a7c4;
}

@media (max-width: 720px) {
  .release-entry {
    grid-template-columns: 1fr;
  }

  .release-meta {
    flex-direction: row;
    align-items: center;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-bottom: 42px;
  background: #f3f6fa;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 6px 16px;
  border-top: 1px solid rgba(217, 225, 236, 0.92);
  background: #fff;
  font-size: 12px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 12px;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #111827 0, #123047 58%, #155e75 100%);
}

.login-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
  padding: 28px;
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
}

.login-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-form,
.record-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.12s ease, background 0.12s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #22d3ee;
}

textarea {
  padding: 10px;
  resize: vertical;
}

.login-form button,
.record-form button {
  min-height: 40px;
  background: linear-gradient(135deg, #0891b2, #2563eb);
  color: #fff;
  border-color: transparent;
}

.form-error,
.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
}

.form-message {
  color: var(--success);
}

.form-message.error-message {
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.hr-submit-progress {
  display: grid;
  min-height: 360px;
  place-items: center;
}

.hr-submit-progress-card {
  width: min(520px, 100%);
  padding: 32px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.hr-submit-progress-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--success);
  font-size: 24px;
}

.hr-submit-progress-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.hr-submit-progress-card em {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-style: normal;
}

.hr-submit-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf7;
}

.hr-submit-progress-bar span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #2563eb);
  animation: hrSubmitProgress 3s linear both;
  transform-origin: left center;
}

@keyframes hrSubmitProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.demo-accounts {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 12px;
  background: #f9fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 42px);
  transition: grid-template-columns 0.18s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 58px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - 42px);
  overflow-y: auto;
  border-right: 1px solid #dce6f2;
  background: #f8fbff;
}

.sidebar-brand {
  display: grid;
  gap: 6px;
  padding: 18px 14px 14px;
  border-bottom: 1px solid #e3ebf5;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-brand strong {
  font-size: 20px;
  line-height: 1.2;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 9px;
  border: 1px solid #d7e2ef;
  border-radius: 9px;
  background: #fff;
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-toggle:hover {
  border-color: #96c9e4;
  color: #0f86c9;
}

.sidebar-toggle-icon {
  width: 14px;
  height: 14px;
  position: relative;
}

.sidebar-toggle-icon::before,
.sidebar-toggle-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-toggle-icon::before {
  top: 4px;
}

.sidebar-toggle-icon::after {
  bottom: 4px;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  padding: 14px 8px;
}

.app-shell.sidebar-collapsed .sidebar-brand-row {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-brand strong,
.app-shell.sidebar-collapsed .sidebar-toggle-text,
.app-shell.sidebar-collapsed .side-nav {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: #fff;
  color: var(--text);
  border-bottom: 1px solid #dce6f2;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.account-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-box span {
  color: #475569;
}

.account-box button {
  border-color: #d7e2ef;
  background: #f8fbff;
  color: #334155;
}

.tabs {
  display: grid;
  gap: 10px;
  padding: 12px 10px 22px;
  background: transparent;
  border-bottom: 0;
  overflow-x: visible;
}

.tabs button {
  width: 100%;
  justify-content: flex-start;
  min-height: 36px;
  border-color: transparent;
  border-radius: 9px;
  background: transparent;
  color: #52627a;
  text-align: left;
  font-weight: 650;
  padding: 0 10px;
}

.tabs button.active {
  background: linear-gradient(135deg, #0891b2, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.tabs button:not(.active):hover {
  background: #edf6ff;
  color: #0f5f8d;
}

.nav-section {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e1eaf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.nav-section.is-collapsed {
  gap: 0;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  color: #1f2a44;
  font-size: 14px;
  font-weight: 800;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.nav-icon {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 6px;
  background: #eaf4ff;
  color: #0f86c9;
}

.nav-icon::before {
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.nav-icon-finance::before {
  content: "¥";
}

.nav-icon-hr::before {
  content: "人";
}

.nav-icon-system::before {
  content: "⚙";
  font-size: 11px;
}

.nav-toggle i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.nav-toggle[aria-expanded="false"] i {
  transform: rotate(-45deg);
}

.nav-subtoggle {
  min-height: 30px;
  margin-top: 2px;
  padding-left: 4px;
  color: #64748b;
  font-size: 12px;
}

.nav-subtoggle .nav-label {
  gap: 0;
}

.nav-children {
  display: grid;
  gap: 5px;
}

.nav-children[hidden] {
  display: none;
}

.nav-subgroup {
  display: grid;
  gap: 4px;
  padding-left: 4px;
  border-left: 2px solid #e6edf7;
}

.nav-subchildren {
  padding-left: 8px;
}

.nav-subchildren button {
  min-height: 34px;
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

#dashboardTab .workspace {
  grid-template-columns: minmax(0, 1fr);
}

#dashboardTab .sidebar {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(260px, 0.65fr);
  align-items: stretch;
}

#dashboardTab .sidebar .panel {
  min-width: 0;
}

#dashboardTab .department-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

#dashboardTab .department-option {
  min-height: 32px;
}

#dashboardTab .sidebar .field-label {
  margin-top: 8px;
}

.sidebar,
.content,
.entry-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar .panel {
  border-color: #d8e4f0;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.sidebar .panel h2 {
  color: #1e293b;
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  padding: 18px;
  align-items: start;
}

#entryTab .entry-layout,
#apiVerifyTab .entry-layout,
#hrEmployeesTab .entry-layout,
#hrDailyTab .entry-layout,
#logsTab .entry-layout {
  grid-template-columns: minmax(0, 1fr);
}

.entry-hint-group {
  display: grid;
  gap: 4px;
  max-width: 820px;
}

.entry-hint-group p {
  margin: 0;
}

.hr-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr);
}

#dashboardTab .content,
#productsTab .content {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

#dashboardTab .metrics-panel {
  grid-column: 1 / -1;
  order: 3;
  padding: 14px 16px;
}

#dashboardTab .department-ranking-panel {
  grid-column: 1 / -1;
  order: 0;
  padding: 0;
  overflow: hidden;
}

.department-ranking-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e4edf7;
  background: #fff;
}

.department-ranking-header h2 {
  margin: 4px 0 5px;
  font-size: 22px;
}

.department-ranking-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.section-kicker {
  color: #0f8fb3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.department-ranking-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid #e4edf7;
  background: #f8fbff;
}

.ranking-date-block,
.ranking-sort-block {
  padding: 16px;
  border: 1px solid #dce7f3;
  border-radius: 10px;
  background: #fff;
}

.ranking-date-block {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 12px 16px;
  align-items: end;
}

.ranking-filter-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ranking-filter-heading strong {
  color: #17233a;
  font-size: 14px;
}

.ranking-filter-heading span {
  color: var(--muted);
  font-size: 12px;
}

.ranking-date-fields {
  display: grid;
  grid-template-columns: minmax(135px, 1fr) auto minmax(135px, 1fr);
  gap: 8px;
  align-items: end;
}

.ranking-date-fields label {
  display: grid;
  gap: 6px;
  color: #52637d;
  font-size: 12px;
  font-weight: 700;
}

.ranking-date-fields input {
  min-height: 40px;
  background: #fff;
}

.ranking-date-separator {
  padding-bottom: 11px;
  color: #8a98ab;
  font-size: 12px;
}

.ranking-quick-ranges {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 6px;
}

.ranking-quick-ranges button {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #d8e4f1;
  background: #f7faff;
  color: #52637d;
  box-shadow: none;
  white-space: nowrap;
}

.ranking-quick-ranges button.active {
  border-color: #1296b8;
  background: #e8f8fc;
  color: #087590;
}

.ranking-sort-block {
  display: grid;
  gap: 14px;
}

.ranking-control-group {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.ranking-control-group > span {
  color: #52637d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ranking-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid #d8e4f1;
  background: #f1f6fb;
}

.ranking-direction-segmented {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ranking-segmented button {
  min-height: 34px;
  padding: 6px 14px;
  border: 0;
  background: transparent;
  color: #52637d;
  box-shadow: none;
}

.ranking-segmented button.active {
  background: #ffffff;
  color: #0f7fa0;
  box-shadow: 0 2px 8px rgba(15, 127, 160, 0.12);
}

.department-ranking-table-wrap {
  margin: 0;
  max-height: 430px;
  border: 0;
  border-radius: 0;
}

.department-ranking-table-wrap table {
  min-width: 760px;
}

.department-ranking-table-wrap th,
.department-ranking-table-wrap td {
  vertical-align: middle;
}

.department-ranking-table-wrap th:first-child,
.department-ranking-table-wrap td:first-child {
  width: 72px;
  text-align: center;
}

.ranking-position {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #edf3f9;
  color: #52637d;
  font-weight: 800;
}

.ranking-position.top-1 { background: #fff2c7; color: #9a6500; }
.ranking-position.top-2 { background: #e8eef5; color: #52637d; }
.ranking-position.top-3 { background: #f7e4d6; color: #9a5127; }

.ranking-active-metric {
  background: #eefaff;
  color: #075f78;
  font-weight: 800;
}

.ranking-row-missing td {
  color: #8a98ab;
  background: #fafbfd;
}

.ranking-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 700;
}

.ranking-status.ready { background: #e8f8f0; color: #087443; }
.ranking-status.missing { background: #f1f4f8; color: #6b778c; }
.empty-cell { padding: 36px 16px !important; color: var(--muted); text-align: center; }

#summaryCards {
  grid-column: 1 / -1;
  order: 1;
}

#dashboardTab .chart-panel {
  grid-column: 1 / -1;
  order: 4;
}

#dashboardTab .table-panel {
  grid-column: 1 / -1;
  order: 2;
  min-width: 0;
}

#dashboardTab .table-panel .table-wrap {
  max-height: 420px;
}

#dashboardTab .table-panel table {
  min-width: 920px;
}

#productsTab .chart-panel {
  grid-column: 1 / -1;
  order: 3;
}

#productSummaryCards {
  grid-column: 1 / -1;
  order: 1;
}

#productsTab .table-panel {
  grid-column: 1 / -1;
  order: 5;
  min-width: 0;
}

#productsTab .table-panel .table-wrap {
  max-height: 500px;
}

#productsTab .product-rank-panel {
  grid-column: 1 / -1;
  order: 2;
}

#productsTab .product-insight-panel,
#productsTab .product-seasonal-panel {
  grid-column: span 6;
  order: 4;
}

#productsTab .product-library-readonly-panel {
  grid-column: 1 / -1;
  order: 7;
}

#productInsightTable {
  min-width: 980px;
}

#productSeasonalTable {
  min-width: 920px;
}

#productReadonlyLibraryTable {
  min-width: 760px;
}

#productsTab .product-quality-panel {
  grid-column: 1 / -1;
  order: 98;
}

#productsTab .compact-table-wrap {
  max-height: 360px;
}

#productsTab .workspace {
  grid-template-columns: 1fr;
}

#productsTab .sidebar {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  align-items: stretch;
}

#productsTab .sidebar .panel {
  margin: 0;
}

.product-filter-bar {
  position: relative;
  z-index: 8;
}

.product-filter-item {
  min-width: 0;
  padding: 16px;
}

.product-filter-item h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.product-filter-item select,
.product-date-picker summary {
  min-height: 44px;
}

.product-date-picker {
  position: relative;
}

.product-date-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #cfdaea;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
  list-style: none;
}

.product-date-picker summary::-webkit-details-marker {
  display: none;
}

.product-date-picker[open] summary {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.product-date-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  width: min(430px, calc(100vw - 40px));
  padding: 16px;
  border: 1px solid #d8e4f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.product-date-popover .field-label {
  margin: 0;
  font-size: 12px;
}

.product-date-popover input {
  width: 100%;
}

.product-date-shortcuts {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.product-date-shortcuts button {
  flex: 1;
  min-height: 36px;
  padding: 0 10px;
  border-color: #cfdaea;
  background: #f8fafc;
  color: #334155;
}

.rank-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #52627a;
  font: inherit;
  font-weight: 700;
}

.rank-sort-button:hover,
.rank-sort-button.active {
  background: #eaf6ff;
  color: #0369a1;
}

.rank-index-column {
  width: 70px;
  text-align: center;
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef3f8;
  color: #52627a;
  font-size: 12px;
  font-weight: 800;
}

.rank-number.top-1 {
  background: #fff1c2;
  color: #9a6700;
}

.rank-number.top-2 {
  background: #e8edf3;
  color: #475569;
}

.rank-number.top-3 {
  background: #f8e1d1;
  color: #9a4d16;
}

.trend-signal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: #52627a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.trend-signal.loss,
.trend-signal.decline {
  background: #fff1f0;
  color: #c52b21;
}

.trend-signal.growth,
.trend-signal.new {
  background: #ecfdf3;
  color: #087443;
}

.trend-signal.insufficient {
  background: #f8fafc;
  color: #7c8798;
}

.trend-suggestion {
  display: block;
  margin-top: 5px;
  color: #667085;
  white-space: nowrap;
}

.trend-value {
  font-weight: 800;
}

#productsTab .chart-wrap {
  min-height: 430px;
}

.product-library-layout {
  grid-template-columns: minmax(420px, 0.8fr) minmax(0, 1.2fr);
}

.product-library-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-library-form label,
.inline-filter {
  display: grid;
  gap: 8px;
}

.product-library-form label span {
  color: #5d6b82;
  font-weight: 700;
}

.product-library-form .wide-field,
.product-library-form .form-actions {
  grid-column: 1 / -1;
}

.inline-filter {
  grid-template-columns: minmax(140px, 180px) minmax(110px, 140px) minmax(180px, 240px);
  align-items: center;
  gap: 10px;
}

.row-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.quality-pill.review {
  background: #fff7ed;
  color: #c2410c;
}

.quality-pill.invalid {
  background: #fef2f2;
  color: #dc2626;
}

.quality-pill.valid {
  background: #ecfdf3;
  color: #087443;
}

#productEntryPanel {
  grid-column: 1 / -1;
  order: 4;
}

.page-help {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 18px 20px;
  border: 1px solid #dbe5f1;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  color: #5d6b82;
}

#dashboardTab .page-help,
#productsTab .page-help {
  order: 99;
}

.page-help h3 {
  margin: 0 0 10px;
  color: #142033;
  font-size: 18px;
}

.page-help ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  line-height: 1.65;
}

.page-help li::marker {
  color: #0ea5e9;
}

#hrDashboardTab .hr-layout {
  grid-template-columns: minmax(0, 1fr);
}

#hrDashboardTab .entry-panel {
  min-width: 0;
  max-width: none;
}

#hrDashboardTab .entry-panel .panel-title-row {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5edf6;
}

#hrDashboardTab .entry-panel .action-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  width: 100%;
  min-width: 0;
}

#hrDashboardTab .entry-panel .date-shortcuts {
  display: flex;
  gap: 8px;
  align-self: end;
  white-space: nowrap;
}

#hrDashboardTab .entry-panel .date-shortcuts .small-btn {
  min-width: 56px;
  min-height: 42px;
  padding: 0 12px;
}

#hrDashboardTab .entry-panel .panel-title-row h2 {
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

#hrDashboardTab #hrSummaryCards {
  margin: 16px 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

#hrDashboardTab .hr-table-wrap {
  max-height: 560px;
}

#hrDashboardTab .hr-subsection-title {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5edf6;
}

.compact-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-bottom: 14px;
}

.compact-filter-grid .small-btn {
  min-height: 42px;
}

.hr-import-panel {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #e5edf6;
}

.hr-import-panel h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.hr-import-panel .muted {
  margin: 0;
}

.hr-import-result {
  margin-top: 14px;
}

.hr-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  background: #f8fbff;
}

.hr-import-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbe5f1;
  color: #64748b;
  font-weight: 700;
}

.hr-import-summary .success {
  color: #047857;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.hr-import-summary .danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff7f7;
}

.hr-import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.hr-import-detail {
  margin-top: 12px;
  max-height: 260px;
}

.hr-import-help {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #f6f9fd;
  border: 1px solid #dbe5f1;
  color: #64748b;
  line-height: 1.7;
}

.hr-import-help strong {
  display: block;
  margin-bottom: 6px;
  color: #142033;
}

.hr-import-help p {
  margin: 4px 0;
}

#hrDashboardTab .hr-layout > .panel:not(.entry-panel) {
  background: linear-gradient(180deg, #ffffff 0, #f8fbff 100%);
}

@media (max-width: 1180px) {
  #hrDashboardTab .entry-panel .action-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  #hrDashboardTab .entry-panel .date-shortcuts {
    grid-column: 1 / -1;
  }
}

.panel,
.metrics-panel,
.chart-panel,
.table-panel,
.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.resume-card {
  content-visibility: auto;
  contain-intrinsic-size: 180px;
}

.panel,
.metrics-panel,
.chart-panel,
.table-panel {
  padding: 20px;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.department-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.department-option,
.metric-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.department-option input,
.metric-option input {
  width: 16px;
  height: 16px;
}

.department-option:has(input:checked),
.metric-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.field-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.quick-row,
.action-row,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-row {
  margin-top: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.segmented button {
  border: 0;
  border-radius: 0;
  min-height: 38px;
}

.segmented button.active {
  background: linear-gradient(135deg, #0891b2, #2563eb);
  color: #fff;
}

.panel-title-row,
.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chart-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #e5edf6;
}

.metric-groups {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.metric-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  min-width: 64px;
}

.metric-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

#dashboardTab .metric-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 10px;
}

#dashboardTab .metric-option {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  box-shadow: none;
  white-space: nowrap;
}

.metric-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.chart-header p {
  margin: 0;
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: flex-end;
  max-width: 520px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #e5edf6;
  border-radius: 999px;
  background: #fff;
}

.legend-line {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.product-chart-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.product-metric-checks {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.product-metric-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid #d8e2ef;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.product-metric-checks input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.chart-wrap {
  position: relative;
  height: 440px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

#trendChart,
#productTrendChart {
  width: 100%;
  height: 100%;
  display: block;
}

.tooltip {
  position: absolute;
  z-index: 2;
  width: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  padding: 18px;
  border-color: #dce5f3;
  background: #fff;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #22d3ee, #2563eb);
}

.summary-card span,
.summary-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.summary-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 25px;
  letter-spacing: 0;
}

.positive {
  color: var(--success);
}

.negative {
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.table-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 0;
  font-size: 13px;
}

.secondary-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #f8fafc;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5edf6;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  background: #f1f6fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

tbody tr:hover td {
  background: #f8fcff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e3eaf4;
  border-radius: 12px;
  background: #f8fbff;
}

.entry-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(180px, 220px);
  gap: 14px;
  align-items: end;
}

.entry-sheet-block {
  display: grid;
  gap: 10px;
}

.entry-sheet-block h3 {
  margin: 0;
  font-size: 15px;
}

.entry-table-wrap {
  max-height: 520px;
}

.entry-table {
  min-width: 620px;
}

.entry-table th,
.entry-table td {
  padding: 8px;
  text-align: left;
}

.entry-table input {
  min-height: 34px;
}

.entry-table td:first-child {
  width: 240px;
  color: var(--text);
  font-weight: 600;
}

.entry-table th:last-child,
.entry-table td:last-child {
  width: 150px;
  text-align: left;
}

.entry-table input:disabled {
  background: #f8fafc;
  color: var(--muted);
  cursor: not-allowed;
}

.hr-table-wrap table {
  min-width: 960px;
}

.hr-table-wrap td:last-child {
  text-align: left;
}

.product-entry-table {
  min-width: 820px;
}

.product-entry-table td:first-child {
  width: auto;
  font-weight: 400;
}

.domestic-toolbar {
  grid-template-columns: minmax(220px, 320px) minmax(180px, 220px) auto;
}

.domestic-sheet-block {
  gap: 12px;
}

.domestic-entry-scroll {
  width: 100%;
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.sheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sheet-toolbar input {
  width: 150px;
  min-height: 30px;
  font-size: 12px;
}

.domestic-entry-table {
  min-width: 4200px;
  border-collapse: collapse;
  font-size: 12px;
}

.domestic-entry-table th,
.domestic-entry-table td {
  border: 1px solid #b8c7d8;
  padding: 0;
  text-align: center;
  white-space: normal;
}

.domestic-entry-table th {
  height: 32px;
  padding: 4px 6px;
  color: #0f172a;
  background: #d7f1fb;
  font-weight: 700;
}

.domestic-entry-table .sheet-header-input {
  min-width: 76px;
  min-height: 24px;
  padding: 2px 4px;
  color: inherit;
  font-weight: inherit;
  background: transparent;
  border: 0;
  text-align: center;
}

.domestic-entry-table .sheet-group-input {
  min-width: 140px;
  font-size: 14px;
}

.domestic-entry-table .domestic-group-head {
  background: #fff3cf;
}

.domestic-entry-table th:nth-last-child(-n + 9) {
  background: #eaf6bc;
}

.domestic-entry-table tbody tr:first-child td {
  background: #fff25a;
  font-weight: 700;
}

.domestic-entry-table tbody tr:not(:first-child) td {
  background: #d7f1fb;
}

.domestic-entry-table td:nth-child(n + 16):nth-child(-n + 46) {
  background: #fff5d6;
}

.domestic-entry-table tbody tr:not(:first-child) td:nth-last-child(-n + 9) {
  background: #eef8c6;
}

.domestic-entry-table input {
  width: 100%;
  min-width: 86px;
  min-height: 30px;
  padding: 5px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 12px;
}

.domestic-entry-table input:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #fff;
}

.domestic-entry-table td.sheet-cell-selected,
.domestic-entry-table th.sheet-cell-selected {
  box-shadow: inset 0 0 0 2px #2563eb;
}

.domestic-entry-table td.sheet-cell-active,
.domestic-entry-table th.sheet-cell-active {
  box-shadow: inset 0 0 0 3px #1d4ed8;
}

.domestic-entry-table td.sheet-find-hit,
.domestic-entry-table th.sheet-find-hit {
  background: #fde68a !important;
}

.domestic-entry-table td.sheet-bold input,
.domestic-entry-table th.sheet-bold input {
  font-weight: 800;
}

.domestic-entry-table td.sheet-fill,
.domestic-entry-table th.sheet-fill {
  background: #dcfce7 !important;
}

.domestic-entry-table .text-cell input,
.domestic-entry-table .product-cell input {
  min-width: 116px;
  text-align: left;
}

.domestic-entry-table .percent-cell input {
  min-width: 76px;
}

.cross-entry-table {
  min-width: 2800px;
}

.cross-entry-table th {
  background: #eefaf4;
}

.cross-entry-table .cross-group-head {
  background: #fbd0c0;
  font-size: 15px;
}

.cross-entry-table tbody tr:first-child td {
  background: #ffc400;
  font-weight: 700;
}

.cross-entry-table tbody tr:not(:first-child) td {
  background: #f8fffb;
}

.cross-entry-table td:nth-child(n + 13):nth-child(-n + 19) {
  background: #fff1dc;
}

.cross-entry-table td:nth-child(n + 20):nth-child(-n + 25) {
  background: #e8f8ee;
}

.cross-entry-table td:nth-child(n + 26):nth-child(-n + 30) {
  background: #eee8ff;
}

.cross-entry-table input {
  min-width: 84px;
}

.cross-entry-table .product-cell input {
  min-width: 132px;
}

.adq-entry-table {
  min-width: 2300px;
}

.adq-entry-table th {
  background: #ffc400;
  color: #202124;
}

.adq-entry-table tbody tr:first-child td {
  background: #ffc400;
  font-weight: 700;
}

.adq-entry-table tbody tr:not(:first-child) td {
  background: #b9cbed;
}

.adq-entry-table td:nth-child(n + 17):nth-child(-n + 20) {
  background: #cfdbf0;
}

.adq-entry-table td:nth-child(n + 21):nth-child(-n + 22) {
  background: #fff4bd;
}

.adq-entry-table input {
  min-width: 92px;
}

.adq-entry-table .product-cell input {
  min-width: 170px;
}

.adq-expense-table {
  min-width: 520px;
}

.adq-expense-table tbody tr:last-child td {
  background: #ffc400;
  font-weight: 700;
}

.luckysheet-entry-frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  contain: layout paint;
}

.luckysheet-entry-note {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.luckysheet-editor {
  position: relative;
  display: block;
  width: 100%;
  height: 72vh;
  min-height: 680px;
  border: 0;
  background: #fff;
}

.luckysheet-entry-frame.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  border-radius: 0;
  border: 0;
  background: #fff;
}

.luckysheet-entry-frame.is-fullscreen .luckysheet-editor {
  height: calc(100vh - 43px);
  min-height: 0;
}

.luckysheet-entry-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.luckysheet-shortcuts {
  color: var(--muted);
  font-size: 12px;
}

.record-form .luckysheet-fullscreen-btn {
  min-height: 30px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.record-form .luckysheet-fullscreen-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.luckysheet-entry-shell {
  background: #fff;
  overflow: hidden;
  contain: layout paint;
}

.danger-btn {
  background: #fff;
  color: var(--danger);
  border-color: #f3b8b3;
}

.danger-btn:hover {
  background: #fff5f4;
  color: var(--danger);
  border-color: var(--danger);
}

.department-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.department-checks legend {
  color: var(--muted);
  padding: 0 6px;
}

.department-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.department-checks input {
  width: 16px;
  min-height: 16px;
}

.muted,
.note-list p {
  color: var(--muted);
}

.small-btn {
  min-height: 28px;
  padding: 0 8px;
}

.detail-panel {
  position: sticky;
  top: 16px;
  height: calc(100vh - 74px);
  max-height: calc(100vh - 74px);
  min-width: 0;
  overflow-x: scroll;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.detail-panel .record-form {
  width: max-content;
  min-width: 720px;
  padding-right: 12px;
}

.resume-card-list {
  display: block;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid #dce5f3;
  border-radius: 12px;
  background: #fff;
}

.resume-list-scroll {
  width: 100%;
  max-height: clamp(320px, 48vh, 620px);
  overflow: auto;
}

.resume-list-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.resume-list-table th,
.resume-list-table td {
  height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
  white-space: nowrap;
}

.resume-list-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.resume-list-table .compact-date {
  width: 72px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.resume-list-table tbody tr {
  cursor: pointer;
}

.resume-list-table tbody tr:hover {
  background: #f8fbff;
}

.resume-list-table tbody tr.active {
  background: #eaf3ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.resume-card {
  border: 1px solid #dce5f3;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: clip;
}

.resume-detail-card {
  min-width: 720px;
  box-shadow: none;
}

.resume-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5edf7;
  background: #f8fbff;
}

.resume-card-head strong {
  display: block;
  font-size: 16px;
}

.resume-card-head span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.status-pill {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-align: center;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.status-pill.ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.api-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.api-provider-card {
  border: 1px solid #dbe6f2;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow-soft);
}

.api-provider-card .panel-title-row {
  padding: 0 0 12px;
  border-bottom: 1px solid #e7eef7;
}

.api-config-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.api-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.api-form-grid label {
  display: grid;
  gap: 7px;
}

.api-form-grid label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.api-form-grid small {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.api-form-grid .wide-field {
  grid-column: 1 / -1;
}

.saved-secret {
  color: #0f766e;
  font-weight: 800;
}

.api-form-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f9fd;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

.inline-check input {
  width: 16px;
  height: 16px;
}

.api-actions {
  justify-content: flex-start;
}

.danger-light {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.api-test-result {
  margin-top: 14px;
  border: 1px solid #e2eaf4;
  border-radius: 14px;
  padding: 12px;
  background: #f8fbff;
}

.api-test-summary {
  margin: 0 0 8px;
  font-weight: 800;
}

.api-test-summary.ok {
  color: #047857;
}

.api-test-summary.danger {
  color: #dc2626;
}

.api-check-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-check-list li {
  display: grid;
  grid-template-columns: 54px minmax(120px, 0.7fr) minmax(160px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
}

.api-check-list li.ok strong {
  color: #047857;
}

.api-check-list li.danger strong {
  color: #dc2626;
}

.api-check-list em {
  color: var(--muted);
  font-style: normal;
}

.resume-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 0;
  margin: 0;
}

.resume-detail-grid div {
  min-height: 64px;
  padding: 12px 14px;
  border-right: 1px solid #edf2f8;
  border-bottom: 1px solid #edf2f8;
}

.resume-detail-grid dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.resume-detail-grid dd {
  margin: 0;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}

.hr-attachment-preview {
  display: grid;
  gap: 8px;
  width: min(220px, 100%);
  color: #2563eb;
  text-decoration: none;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.hr-attachment-preview img {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8fbff;
}

.hr-attachment-preview .attachment-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  border: 1px dashed #bfd0e6;
  border-radius: 10px;
  background: #f8fbff;
  color: #64748b;
  text-decoration: none;
}

.hr-attachment-preview span {
  font-size: 12px;
  text-decoration: underline;
}

.current-attachment {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.hr-attachment-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 28px;
}

.hr-attachment-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.hr-attachment-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(960px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
}

.hr-attachment-modal.is-fullscreen {
  padding: 0;
}

.hr-attachment-modal.is-fullscreen .hr-attachment-modal-panel,
.hr-attachment-modal-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
}

.hr-attachment-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5edf7;
}

.hr-attachment-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.hr-attachment-modal-body {
  overflow: auto;
  padding: 16px;
  background: #f8fbff;
}

.hr-attachment-modal-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  background: #fff;
}

.resume-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  padding: 12px 16px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: var(--muted);
  background: #f8fbff;
}

.approval-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #c7d7fe;
  border-radius: 10px;
  background: #f7faff;
}

.approval-panel h3 {
  margin: 0;
  font-size: 15px;
}

.approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dbe5ff;
  border-radius: 8px;
  background: #fff;
}

.approval-item strong,
.approval-item span {
  display: block;
}

.approval-resume-link {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.approval-resume-link:hover {
  color: #0f8fb3;
  text-decoration: underline;
}

.approval-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.approval-item .approval-change-summary {
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}

.approval-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.approval-hint {
  padding: 8px 16px;
  border-bottom: 1px solid #e5edf7;
  background: var(--soft-amber);
  color: #8a5a00;
  font-size: 13px;
}

.approval-empty {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: var(--muted);
  background: #fbfdff;
}

.hr-daily-entry {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hr-daily-entry .panel-title-row {
  margin-bottom: 10px;
}

.table-panel .panel-title-row,
.metrics-panel .panel-title-row {
  align-items: center;
}

.table-panel .panel-title-row {
  padding-bottom: 12px;
  border-bottom: 1px solid #e5edf6;
}

.table-panel .table-wrap {
  margin-top: 12px;
}

.metric-group {
  padding: 12px;
  border: 1px solid #e5edf6;
  border-radius: 12px;
  background: #fbfdff;
}

.metric-group h3 {
  color: #334155;
}

.panel .action-row button,
.quick-row button {
  background: #f8fbff;
}

.panel .action-row button:hover,
.quick-row button:hover {
  background: #ecfeff;
}

.chart-panel,
.metrics-panel,
.table-panel {
  min-width: 0;
}

.chart-panel {
  overflow: hidden;
}

.product-workspace .sidebar .panel select,
.product-workspace .sidebar .panel input,
#dashboardTab .sidebar input {
  background: #f8fbff;
}

.site-footer {
  box-shadow: none;
}

[hidden] {
  display: none !important;
}

.k-assistant-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 13px 6px 7px;
  border: 1px solid #cbdaf0;
  border-radius: 22px;
  background: #ffffff;
  color: #1e3a5f;
  box-shadow: 0 8px 24px rgba(30, 58, 95, 0.14);
  font-weight: 700;
}

.k-assistant-mini-avatar,
.k-assistant-face {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1769e0;
  color: #ffffff;
  font-weight: 800;
}

.k-assistant-mini-avatar {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.k-assistant-panel {
  --k-color: #d97706;
  --k-soft: #fff8e8;
  position: fixed;
  right: 22px;
  bottom: 76px;
  z-index: 71;
  width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid #d9e3f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
}

.k-assistant-panel[data-severity="positive"] {
  --k-color: #138a57;
  --k-soft: #edf9f3;
}

.k-assistant-panel[data-severity="neutral"] {
  --k-color: #64748b;
  --k-soft: #f3f6fa;
}

.k-assistant-panel[data-severity="warning"] {
  --k-color: #ea7a12;
  --k-soft: #fff5e8;
}

.k-assistant-panel[data-severity="critical"] {
  --k-color: #d92d20;
  --k-soft: #fff0ef;
}

.k-assistant-accent {
  height: 4px;
  background: var(--k-color);
}

.k-assistant-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  padding: 14px 14px 10px;
  background: var(--k-soft);
}

.k-assistant-head > div:nth-child(2) {
  display: grid;
  gap: 2px;
}

.k-assistant-head strong {
  color: #152238;
  font-size: 15px;
}

.k-assistant-head span {
  color: var(--k-color);
  font-size: 12px;
  font-weight: 700;
}

.k-assistant-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 5px;
  border: 2px solid color-mix(in srgb, var(--k-color) 25%, white);
  border-radius: 15px 15px 18px 18px;
  background: #ffffff;
}

.k-assistant-face {
  width: 30px;
  height: 30px;
  background: var(--k-color);
  font-size: 14px;
}

.k-assistant-avatar i {
  position: absolute;
  right: -3px;
  bottom: 2px;
  width: 11px;
  height: 11px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #25c2e8;
}

.k-assistant-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  font-size: 24px;
  line-height: 1;
}

.k-assistant-close:hover {
  background: rgba(100, 116, 139, 0.12);
}

.k-assistant-body {
  display: grid;
  gap: 7px;
  padding: 13px 15px 14px;
}

.k-assistant-body p {
  margin: 0;
  color: #52637a;
  font-size: 13px;
  line-height: 1.6;
}

.k-assistant-body .k-assistant-message {
  color: #17243a;
  font-size: 14px;
  font-weight: 700;
}

.k-assistant-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
  padding-top: 9px;
  border-top: 1px solid #e5ebf3;
  color: #718096;
  font-size: 11px;
}

.k-assistant-footer span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .k-assistant-launcher {
    right: 14px;
    bottom: 14px;
  }

  .k-assistant-panel {
    right: 14px;
    bottom: 66px;
  }
}

/* Access monitor */
.access-monitor-layout {
  grid-template-columns: minmax(0, 1fr);
}

.access-monitor-layout .panel-title-row > div > h2 {
  margin-bottom: 4px;
}

.access-monitor-summary {
  margin: 18px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.access-monitor-summary article {
  min-height: 126px;
}

.access-monitor-summary .monitor-online-value {
  color: #087f5b;
}

.online-status,
.access-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 64px;
  font-weight: 700;
  white-space: nowrap;
}

.online-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.online-status.is-online {
  color: #087f5b;
}

.online-status.is-online i {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

.online-status.is-offline,
.access-action.is-logout {
  color: #64748b;
}

.access-action.is-login {
  color: #087f5b;
}

.access-event-table-wrap {
  max-height: 420px;
}

@media (max-width: 900px) {
  .access-monitor-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dce6f2;
  }

  .app-shell.sidebar-collapsed .app-sidebar {
    height: auto;
  }

  .tabs {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .api-provider-grid,
  .api-form-grid {
    grid-template-columns: 1fr;
  }

  .api-check-list li {
    grid-template-columns: 1fr;
  }

  .workspace,
  .entry-layout {
    grid-template-columns: 1fr;
  }

  #dashboardTab .content,
  #productsTab .content {
    grid-template-columns: 1fr;
  }

  #dashboardTab .metrics-panel,
  #dashboardTab .department-ranking-panel,
  #summaryCards,
  #dashboardTab .chart-panel,
  #dashboardTab .table-panel,
  #productsTab .chart-panel,
  #productSummaryCards,
  #productsTab .table-panel,
  #productsTab .product-rank-panel,
  #productsTab .product-insight-panel,
  #productsTab .product-seasonal-panel,
  #productsTab .product-library-readonly-panel,
  #productsTab .product-quality-panel,
  #productEntryPanel {
    grid-column: 1;
  }

  .department-ranking-header {
    padding: 18px;
  }

  .department-ranking-filters {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .ranking-date-block {
    grid-template-columns: 1fr;
  }

  .ranking-quick-ranges {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ranking-control-group {
    grid-template-columns: 1fr;
  }

  #productsTab .sidebar {
    grid-template-columns: 1fr;
  }

  #productsTab .chart-header {
    flex-direction: column;
  }

  .product-chart-tools {
    align-items: flex-start;
  }

  .product-metric-checks,
  #productLegend {
    justify-content: flex-start;
  }

  #hrDashboardTab .hr-layout {
    grid-template-columns: 1fr;
  }

  #hrDashboardTab .entry-panel .action-row {
    grid-template-columns: 1fr;
  }

  .metric-groups,
  .summary-grid,
  .form-grid,
  .filter-grid,
  .entry-toolbar {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

  .resume-detail-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 620px) {
  .ranking-date-fields {
    grid-template-columns: 1fr;
  }

  .ranking-date-separator {
    display: none;
  }

  .ranking-quick-ranges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resume-card-head {
    flex-direction: column;
  }

  .resume-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* 2026-07 UI refresh: compact, flat enterprise workspace */
:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --text: #182230;
  --muted: #667085;
  --line: #d9e0e8;
  --accent: #0f8fa6;
  --accent-soft: #e8f6f8;
  --accent-strong: #0b6575;
  --nav: #172230;
  --nav-soft: #223143;
  --cyan: #28bfd4;
  --soft-green: #eaf7ef;
  --soft-amber: #fff5df;
  --danger: #c4322b;
  --success: #087a55;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-soft: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button,
input,
select,
textarea {
  border-radius: 6px;
}

button {
  transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 143, 166, 0.1);
}

.login-shell {
  min-height: 100vh;
  padding: 32px;
  background: #e9edf2;
}

.login-card {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  width: min(900px, 100%);
  min-height: 520px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d3dae4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(24, 34, 48, 0.12);
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 48px 44px 36px;
  background: #172230;
  color: #fff;
}

.login-brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: auto;
  place-items: center;
  border-radius: 12px;
  background: transparent;
}

.login-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.login-kicker {
  display: block;
  margin: 42px 0 12px;
  color: #67d5e3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.login-brand-panel h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: 0;
}

.login-brand-panel p {
  margin: 12px 0 0;
  color: #aab7c7;
  font-size: 14px;
}

.login-brand-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 56px;
  color: #8090a3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.login-brand-foot i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #28bfd4;
}

.login-version {
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid rgba(40, 191, 212, 0.32);
  border-radius: 999px;
  color: #70d8e6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 60px;
  background: #fff;
}

.login-heading > span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.login-heading h2 {
  margin: 9px 0 0;
  font-size: 26px;
}

.login-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-form {
  gap: 18px;
  margin-top: 32px;
}

.login-form label {
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.login-form input {
  min-height: 44px;
  padding: 0 13px;
  background: #fbfcfd;
}

.login-form button,
.record-form button {
  min-height: 44px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 750;
}

.login-form button:hover,
.record-form button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.app-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  background: var(--bg);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 58px minmax(0, 1fr);
}

.app-sidebar {
  border-right: 1px solid #263649;
  background: var(--nav);
  color: #e7edf5;
  scrollbar-color: #405169 transparent;
}

.sidebar-brand {
  min-height: 74px;
  padding: 17px 14px;
  border-bottom: 1px solid #2b3a4d;
  background: #131d29;
}

.sidebar-brand strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 17px;
}

.sidebar-brand strong > span {
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
}

.sidebar-brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 7px;
}

.sidebar-toggle {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: #3a4b60;
  background: #223043;
  color: #b8c4d2;
}

.sidebar-toggle-text {
  display: none;
}

.tabs {
  gap: 4px;
  padding: 12px 10px 26px;
}

.nav-section {
  gap: 3px;
  padding: 3px 0 10px;
  border: 0;
  border-bottom: 1px solid #2a394b;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.nav-section:last-child {
  border-bottom: 0;
}

.nav-toggle {
  min-height: 40px;
  padding: 0 11px;
  color: #eef3f8;
  font-size: 13px;
}

.nav-toggle:hover,
.tabs button:not(.active):hover {
  background: #213044;
  color: #fff;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  border-radius: 4px;
  background: #2a3b4f;
  color: #6bd5e2;
}

.nav-toggle i {
  width: 7px;
  height: 7px;
  color: #8da0b5;
}

.nav-children {
  gap: 2px;
}

.tabs button {
  min-height: 36px;
  padding: 0 12px 0 41px;
  border-radius: 5px;
  color: #aebaca;
  font-size: 13px;
  font-weight: 600;
}

.tabs button.active {
  position: relative;
  border-color: transparent;
  background: #26394c;
  color: #fff;
  box-shadow: none;
}

.tabs button.active::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #2bc1d4;
}

.nav-subgroup {
  gap: 2px;
  margin-left: 16px;
  padding-left: 0;
  border-left: 1px solid #34465b;
}

.nav-subtoggle {
  min-height: 32px;
  padding-left: 14px !important;
  color: #95a7ba !important;
  font-size: 12px !important;
}

.nav-subchildren {
  padding-left: 0;
}

.nav-subchildren button {
  min-height: 32px;
  padding-left: 26px;
  font-size: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  min-height: 74px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.topbar h1 {
  font-size: 21px;
  font-weight: 760;
}

.topbar p {
  margin-top: 4px;
  font-size: 12px;
}

.account-box {
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.account-box span {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.account-box button {
  min-height: 32px;
  border-color: #d5dce5;
  background: #fff;
}

.workspace {
  gap: 16px;
  padding: 20px 24px 28px;
}

.entry-layout {
  gap: 16px;
  padding: 20px 24px 28px;
}

.panel,
.metrics-panel,
.chart-panel,
.table-panel,
.summary-card {
  border-color: #dbe1e8;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.panel,
.metrics-panel,
.chart-panel,
.table-panel {
  padding: 18px;
}

.sidebar .panel,
#hrDashboardTab .hr-layout > .panel:not(.entry-panel) {
  border-color: #dbe1e8;
  background: #fff;
}

h2 {
  font-size: 17px;
}

.panel-title-row,
.chart-header {
  gap: 12px;
}

.department-option,
.metric-option {
  border-radius: 5px;
  box-shadow: none;
}

.department-option:has(input:checked),
.metric-option:has(input:checked) {
  border-color: #82c8d2;
  background: #edf8f9;
}

#dashboardTab .metric-option {
  border-radius: 5px;
}

.metric-group {
  border-color: #e0e5eb;
  border-radius: 6px;
  background: #fafbfc;
}

.summary-grid {
  gap: 12px;
}

.summary-card {
  min-height: 102px;
  padding: 16px 17px;
}

.summary-card::before {
  inset: 14px auto 14px 0;
  width: 3px;
  height: auto;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.summary-card:nth-child(2)::before {
  background: #2b6cb0;
}

.summary-card:nth-child(3)::before {
  background: #c47a21;
}

.summary-card:nth-child(4)::before {
  background: #7a5aa6;
}

.summary-card strong {
  margin: 7px 0 5px;
  font-size: 24px;
}

.chart-wrap,
.table-wrap {
  border-radius: 6px;
}

.chart-wrap {
  height: 400px;
  background: #fbfcfd;
}

table thead th {
  background: #eef2f6;
  color: #344054;
  font-weight: 750;
}

table tbody tr:hover td {
  background: #f5fafb;
}

.legend-item,
.product-metric-checks label {
  border-radius: 5px;
}

.segmented {
  border-radius: 6px;
}

.segmented button.active {
  background: var(--accent);
}

.page-help {
  border-radius: 6px;
  background: #f8fafc;
}

.site-footer {
  min-height: 34px;
  background: #fff;
}

/* Account management: three independent vertical work areas prevent list overlap. */
.account-management-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 24px 28px;
}

.account-management-layout > .panel {
  width: 100%;
  min-width: 0;
}

.account-editor-panel,
.account-directory-panel,
.account-hr-panel {
  position: static;
}

.account-section-heading,
.account-directory-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.account-section-heading h2,
.account-directory-heading h2 {
  margin: 3px 0 0;
}

.account-section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.section-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.account-directory-heading h2 small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.account-directory-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px;
  gap: 10px;
  width: min(480px, 100%);
}

.account-directory-tools label,
.account-form-grid label {
  min-width: 0;
}

.account-directory-tools label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-password-field {
  grid-column: span 2;
}

.password-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-visibility-btn {
  min-width: 62px;
  padding-inline: 12px;
  border-color: #cbd8e7;
  background: #f8fafc;
  color: #334155;
}

.account-password-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.account-role-hint {
  margin: 14px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f0f9ff;
  color: #475569;
  font-size: 12px;
  line-height: 1.65;
}

.account-department-checks {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.account-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.account-table-wrap table {
  min-width: 760px;
}

.account-table-wrap thead th {
  background: #edf4fb;
}

.account-table-wrap th:nth-child(1) { width: 18%; }
.account-table-wrap th:nth-child(2) { width: 16%; }
.account-table-wrap th:nth-child(3) { width: 16%; }
.account-table-wrap th:nth-child(4) { width: 40%; }
.account-table-wrap th:nth-child(5) { width: 10%; }

.account-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #cbd8e7;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.account-role-badge.role-owner,
.account-role-badge.role-finance {
  border-color: #9bd7df;
  background: #ecfeff;
  color: #0e7490;
}

.account-role-badge.role-finance_specialist {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.account-role-badge.role-hr_manager,
.account-role-badge.role-hr_specialist {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.account-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.account-pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-pagination-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.account-hr-panel .record-form {
  margin-bottom: 12px;
}

.account-hr-panel .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-hr-panel .hr-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

@media (max-width: 1280px) {
  .account-form-grid,
  .account-hr-panel .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-department-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .login-card {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
  }

  .login-brand-panel {
    min-height: 210px;
    padding: 30px;
  }

  .login-brand-mark {
    margin-bottom: 0;
  }

  .login-kicker {
    margin-top: 24px;
  }

  .login-brand-foot {
    display: none;
  }

  .login-form-panel {
    padding: 36px 30px;
  }

  .app-sidebar {
    background: var(--nav);
  }

  .topbar {
    position: static;
  }
}

@media (max-width: 620px) {
  .login-shell {
    padding: 12px;
  }

  .login-brand-panel {
    min-height: 190px;
    padding: 24px;
  }

  .login-form-panel {
    padding: 30px 24px;
  }

  .workspace,
  .entry-layout {
    padding: 14px;
  }

  .account-management-layout {
    padding: 14px;
  }

  .account-directory-heading {
    flex-direction: column;
  }

  .account-directory-tools {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .account-form-grid,
  .account-hr-panel .form-grid {
    grid-template-columns: 1fr;
  }

  .account-password-field {
    grid-column: 1;
  }

  .account-department-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Keep the themed sidebar from overriding the responsive single-column shell. */
@media (max-width: 980px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid #263649;
  }

  .app-main {
    width: 100%;
    min-width: 0;
  }
}
