/* 홈 대시보드 · 틀과 좌측 메뉴 · 공통 부품 — styles.css 에서 잘라 낸 조각. 자른 순서대로 읽힌다 · 순서를 바꾸면 생김새가 바뀐다 */
.sidebar .menu-item:hover,
.sidebar .menu-group-toggle:hover,
.sidebar .menu-group.open > .menu-group-toggle {
  border-color: rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .065);
  color: #fff;
}

.sidebar .menu-item.active {
  border-color: rgba(38, 201, 196, .2);
  background: rgba(15, 159, 156, .18);
  color: #38d2ce;
  box-shadow: inset 3px 0 var(--primary);
}

.sidebar .menu-group-toggle.has-active { color: #70dfdc; }
.sidebar .menu-group-chevron { color: rgba(255, 255, 255, .5); }
.sidebar .menu-submenu { gap: 2px; }
.sidebar .menu-group.open .menu-submenu { max-height: 310px; }

.sidebar .menu-subitem {
  min-height: 35px;
  margin-left: 9px;
  padding: 8px 12px 8px 22px;
  color: rgba(239, 246, 255, .66);
  font-size: 12px;
}

.sidebar .menu-submenu-placeholder { color: rgba(255, 255, 255, .42); }

.main-content { display: grid; gap: 14px; }
.view-section { gap: 14px; }

.menu-card, .side-panel, .hero-card, .summary-card, .panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 76px;
  padding: 16px 20px;
  border-left: 4px solid var(--primary);
  background: #fff;
}

.hero-card.compact { min-height: 64px; padding: 13px 18px; }
.hero-card h2 { color: var(--text); font-size: 23px; letter-spacing: -.035em; }
.hero-card p { margin-top: 5px; font-size: 13px; }
.hero-label { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .11em; }

.summary-grid, .content-grid, .form-grid, .mini-grid { gap: 14px; }

.summary-card {
  position: relative;
  gap: 5px;
  min-height: 124px;
  padding: 18px 18px 16px;
  overflow: hidden;
}

.summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  opacity: .82;
}

.summary-card p { color: #4e5e73; font-size: 12px; font-weight: 700; }
.summary-card strong { color: var(--text); font-size: 30px; font-variant-numeric: tabular-nums; }
.summary-card span { font-size: 12px; }
.summary-card.accent { border-color: #cfe5e4; background: #f0fbfa; color: var(--text); }
.summary-card.accent p, .summary-card.accent span { color: var(--muted); }

.panel { gap: 13px; padding: 17px 18px; }
.panel > h3, .panel-head h3, .block-head h3 { color: var(--text); font-size: 16px; letter-spacing: -.02em; }
.panel-head { min-height: 34px; padding-bottom: 10px; border-bottom: 1px solid #edf1f4; }
.meta-line { color: var(--muted); font-size: 12px; }

.primary-button, .secondary-button, .ghost-button, .text-button, .search-submit-button {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.primary-button { background: var(--primary); color: #fff; box-shadow: 0 2px 5px rgba(15, 159, 156, .18); }
.primary-button:hover { background: var(--primary-hover); }
.secondary-button, .ghost-button { border: 1px solid var(--line); background: #fff; color: #435268; }
.secondary-button:hover, .ghost-button:hover { border-color: #b8c5d1; background: #f7f9fb; color: var(--text); }
.text-button { color: var(--primary); }
.danger-action { border-color: #f0c9c4; color: var(--danger-text); }

input, select, textarea,
.search-box input, .form-grid input, .form-grid select, .form-grid textarea,
.search-inline input, .compact-select, .table-input {
  border-color: var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

input:hover, select:hover, textarea:hover { border-color: #aebdca; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 159, 156, .1); }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table { color: var(--text); font-variant-numeric: tabular-nums; }
th {
  border-bottom-color: var(--line-strong);
  background: #f4f7f9;
  color: #445267;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
}

td { border-bottom-color: #e9eef2; font-size: 12px; }
tbody tr:hover td { background: #f3fbfa; }

.status-badge, .tax-progress, .temp-reg-tag, .home-withholding-chip {
  border-radius: 5px;
  font-weight: 700;
}

.status-done, .tax-done { background: var(--success-bg); color: var(--success-text); }
.status-progress, .tax-progress { background: var(--progress-bg); color: var(--progress-text); }
.status-wait, .tax-wait { background: var(--warn-bg); color: var(--warn-text); }

.progress-track, .summary-progress-track, .home-wh-bar { background: #e8edf2; }
.progress-slot.filled, .summary-progress-fill, .home-wh-bar-fill { background: var(--primary); }
.home-wh-bar-fill.is-done { background: #2aaa68; }

.home-schedule-item { padding: 10px 6px; }
.home-schedule-date { color: var(--primary); font-size: 12px; }
.home-schedule-title, .home-wh-label { font-size: 13px; }
.home-withholding-chip { border-color: #f0c9c4; background: var(--danger-bg); color: var(--danger-text); }

.tab-row { gap: 5px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.tab-row button { border-radius: 6px 6px 0 0; }

.modal-overlay, .ui-text-editor-overlay { background: rgba(8, 24, 43, .58); }
.modal-shell, .modal-card, .ui-text-editor-card { border-color: var(--line); border-radius: 12px; box-shadow: 0 24px 70px rgba(8, 24, 43, .24); }

.login-shell {
  background:
    linear-gradient(90deg, var(--dark) 0, var(--dark) min(38vw, 520px), transparent min(38vw, 520px)),
    var(--bg);
}

.login-card {
  width: min(430px, calc(100vw - 32px));
  margin-left: clamp(0px, 22vw, 360px);
  padding: 34px;
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(16, 36, 62, .14);
}

.login-card h2 { font-size: 28px; letter-spacing: -.035em; }
.login-form { gap: 13px; }
.login-form label { color: #4d5d70; font-size: 12px; font-weight: 700; }
.login-form input[type="text"], .login-form input[type="password"] { min-height: 42px; padding: 9px 11px; }
.login-form .primary-button { min-height: 43px; }

/* Keep the dedicated client workspace consistent without changing its behavior. */
.temp-reg-titlebar {
  padding: 14px 18px;
  border-color: var(--line);
  border-radius: 10px 10px 0 0;
  background: #fff;
}

.temp-reg-workspace {
  border-color: var(--line);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow);
}

.temp-reg-sidebar { border-color: var(--line); background: #f5f7f9; }
.temp-reg-count.active { background: var(--primary); }
.temp-reg-result-label strong { color: var(--primary); }
.temp-reg-card:hover, .temp-reg-card.active, .temp-reg-card:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.temp-reg-card.multi-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.temp-reg-card.multi-selected .temp-reg-select-box { border-color: var(--primary); background: var(--primary); }
.temp-reg-company-head { background: var(--dark); }
.temp-reg-tabs button.active { border-bottom-color: var(--primary); color: var(--primary); }
.temp-reg-memo { border: 1px solid #cfe7e5; background: #eef9f8; box-shadow: none; }
.temp-reg-type-badge { background: var(--primary); }
.temp-reg-field:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(15, 159, 156, .13); }

@media (max-width: 1180px) and (min-width: 761px) {
  .topbar { grid-template-columns: 224px minmax(30px, 1fr) auto; }
  .brand { margin-right: 14px; padding: 0 15px; }
  .sidebar { width: 224px; }
  .main-content { margin-left: 224px; padding: 18px; }
  .user-box .ghost-button { padding-inline: 7px; font-size: 11px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1500px) and (min-width: 761px) {
  .temp-reg-workspace { grid-template-columns: 260px minmax(0, 1fr); }
  .temp-reg-detail-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .temp-reg-memo { margin-top: 4px; }
  .temp-reg-info-row { grid-template-columns: 175px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { padding: 0; }
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 10px 10px;
    background: #fff;
  }

  .brand {
    min-height: 64px;
    margin: 0 -10px 8px;
    padding: 0 16px;
  }

  .brand-mark { width: 36px; height: 36px; }
  .spacer-box { display: none; }
  .user-box { display: flex; width: 100%; overflow-x: auto; }
  .user-box .ghost-button { flex: 0 0 auto; }
  .user-box .user-chip { flex: 0 0 auto; }

  .layout { display: block; min-height: 0; }
  .sidebar { position: static; display: block; width: 100%; padding: 8px 10px; background: var(--dark); }
  .sidebar::after { display: none; }
  .sidebar .menu-card { display: flex; max-height: none; padding: 6px; border: 0; border-radius: 8px; overflow-x: auto; background: transparent; box-shadow: none; }
  .sidebar .menu-item, .sidebar .menu-group-toggle { flex: 0 0 auto; width: auto; min-height: 36px; padding: 8px 10px; white-space: nowrap; }
  .sidebar .menu-group { display: flex; flex: 0 0 auto; }
  .sidebar .menu-submenu { display: flex; flex: 0 0 auto; max-width: 0; max-height: none; gap: 3px; opacity: 0; }
  .sidebar .menu-group.open .menu-submenu { max-width: 560px; max-height: none; opacity: 1; }
  .sidebar .menu-subitem { margin-left: 0; }

  .main-content { width: 100%; margin: 0; padding: 12px 10px 24px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 108px; padding: 15px; }
  .summary-card strong { font-size: 25px; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .panel { padding: 14px; }
  .login-shell { background: var(--bg); }
  .login-card { margin-left: 0; padding: 25px; }
}

@media print {
  .main-content { margin-left: 0 !important; }
}

/* ================================================================
   Reference-accurate dashboard shell and home workspace
   ================================================================ */
.topbar-page-context {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  height: 100%;
  padding: 0 20px;
}

.topbar-menu-toggle {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #32445a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.topbar-menu-toggle:hover { background: #f0f4f7; }
.topbar-page-context h2 { margin: 0; color: #172337; font-size: 23px; letter-spacing: -.035em; white-space: nowrap; }
.topbar-date { margin-left: auto; color: #4d5c70; font-size: 13px; white-space: nowrap; }

.dashboard-home-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: rgba(239, 246, 255, .78);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.dashboard-home-button::before,
.sidebar .menu-item::before,
.sidebar .menu-group-toggle::before {
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #c9d6e5;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.dashboard-home-button::before { content: "⌂"; font-size: 20px; }
.sidebar .menu-item[data-target="law"]::before { content: "§"; }
.sidebar .menu-item[data-target="temp_registration"]::before { content: "♙"; font-size: 19px; }
.sidebar .menu-item[data-target="withholding"]::before,
.sidebar .menu-item[data-target="vat"]::before,
.sidebar .menu-item[data-target="corporate"]::before,
.sidebar .menu-item[data-target="personal"]::before { content: "▤"; }
.sidebar .menu-item[data-target="bookkeeping_contract"]::before,
.sidebar .menu-item[data-target="binding_request"]::before,
.sidebar .menu-item[data-target="mailing_envelope"]::before,
.sidebar .menu-item[data-target="file_binder"]::before { content: "□"; }
.sidebar .menu-item[data-target="payroll"]::before { content: "▦"; }
.sidebar .menu-item[data-target="credit"]::before { content: "%"; }
.sidebar .menu-item[data-target="pdf"]::before { content: "▱"; }
.sidebar .menu-group-toggle::before { content: "▤"; }
#yale-forms-menu-toggle::before { content: "□"; }

.dashboard-home-button:hover { border-color: rgba(255,255,255,.06); background: rgba(255,255,255,.065); color: #fff; }
.dashboard-home-button.active { border-color: rgba(38,201,196,.2); background: rgba(15,159,156,.18); color: #38d2ce; box-shadow: inset 3px 0 var(--primary); }
.dashboard-home-button.active::before, .sidebar .menu-item.active::before { color: #38d2ce; }

.sidebar .menu-item, .sidebar .menu-group-toggle { display: flex; align-items: center; gap: 12px; }
.sidebar .menu-group-toggle .menu-group-chevron { margin-left: auto; }
.sidebar .menu-subitem { padding-left: 26px; }
.sidebar .menu-subitem::before { flex-basis: 15px; width: 15px; height: 15px; font-size: 11px; }

#view-home { gap: 14px; }

.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.home-kpi-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  min-height: 128px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(16,36,62,.045);
}

.home-kpi-icon {
  display: grid;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  background: #e8f7f6;
  color: #0b9693;
  font-size: 26px;
  font-weight: 800;
}

.home-kpi-card > div:last-child { display: grid; min-width: 0; gap: 5px; }
.home-kpi-card p { margin: 0; color: #26364b; font-size: 13px; font-weight: 800; }
.home-kpi-card strong { display: flex; align-items: baseline; gap: 5px; color: #0a8e8b; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.home-kpi-card strong small { color: #25364a; font-size: 12px; font-weight: 700; }
.home-kpi-card > div:last-child > span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.home-kpi-deadline .home-kpi-icon { background: #eaf7f7; }
.home-kpi-progress .home-kpi-icon { background: #e4f5f4; }
.home-kpi-waiting .home-kpi-icon { background: #eef8f8; }

.home-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(390px, 1.1fr) minmax(240px, .72fr);
  gap: 14px;
  align-items: stretch;
}

.home-dashboard-grid > .panel { min-width: 0; min-height: 455px; }
.home-dashboard-grid .panel, .home-workflow-panel, .home-activity-panel { border-radius: 10px; box-shadow: 0 3px 12px rgba(16,36,62,.045); }
.home-dashboard-grid .panel-head, .home-workflow-panel .panel-head, .home-activity-panel .panel-head { margin: -17px -18px 0; padding: 13px 16px; }
.home-dashboard-grid .panel-head h3, .home-workflow-panel .panel-head h3, .home-activity-panel .panel-head h3 { font-size: 15px; }
.home-panel-link { padding: 4px 0; border: 0; background: transparent; color: #536478; font-size: 11px; cursor: pointer; }
.home-panel-link:hover { color: var(--primary); }

.home-schedule-panel { overflow: hidden; }
.home-schedule-items { position: relative; gap: 0; }
.home-schedule-item {
  position: relative;
  display: grid;
  grid-template-columns: 70px 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 0;
  border-bottom: 1px solid #e7edf2;
}
.home-schedule-item:last-child { border-bottom: 0; }
.home-schedule-item::before { content: ""; position: absolute; top: 0; bottom: 0; left: 76px; width: 1px; background: #d9e2ea; }
.home-schedule-item:first-child::before { top: 50%; }
.home-schedule-item:last-child::before { bottom: 50%; }
.home-schedule-date { display: grid; flex: none; gap: 2px; color: #0b9390; text-align: center; }
.home-schedule-date strong { font-size: 13px; }
.home-schedule-date small { font-size: 10px; }
.home-schedule-dot { position: relative; z-index: 1; display: block; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.home-schedule-body { display: grid; gap: 3px; }
.home-schedule-title { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.home-schedule-note { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.home-schedule-dday { min-width: 43px; padding: 4px 6px; border: 1px solid #20aaa6; border-radius: 5px; color: #078b88; font-size: 10px; font-weight: 800; text-align: center; }
.home-schedule-item.is-past { opacity: .58; }
.home-schedule-item.is-past .home-schedule-dday { border-color: #cbd5df; color: #748297; }

.home-withholding-panel { overflow: hidden; }
.home-wh-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #e0e6ec; border-radius: 7px; overflow: hidden; }
.home-wh-summary > div { display: grid; gap: 7px; min-width: 0; padding: 12px 8px; border-right: 1px solid #e0e6ec; text-align: center; }
.home-wh-summary > div:last-child { border-right: 0; }
.home-wh-summary span { color: #506075; font-size: 10px; }
.home-wh-summary strong { color: #172337; font-size: 20px; font-variant-numeric: tabular-nums; }
.home-wh-summary strong small { margin-left: 3px; font-size: 9px; font-weight: 600; }
.home-wh-summary strong.is-done { color: #0f9f9c; }
.home-wh-summary strong.is-progress { color: #2f6fe4; }
.home-wh-summary strong.is-pending { color: #ef5c39; }
.home-wh-table { display: grid; min-width: 0; margin-top: 8px; }
.home-wh-table-head, .home-wh-table-row { display: grid; grid-template-columns: minmax(120px, 1.6fr) repeat(3, .52fr) minmax(92px, .9fr); align-items: center; min-height: 42px; border-bottom: 1px solid #e8edf2; }
.home-wh-table-head { min-height: 34px; color: #69788c; font-size: 9px; font-weight: 800; }
.home-wh-table-row { color: #526175; font-size: 10px; }
.home-wh-table-row strong { overflow: hidden; color: #26364b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.home-wh-table-row > span:last-child { display: flex; align-items: center; gap: 5px; color: #405269; }
.home-wh-table-row i { display: block; width: 46px; height: 5px; overflow: hidden; border-radius: 99px; background: #e8edf2; }
.home-wh-table-row i b { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

.home-dashboard-rail { display: grid; grid-template-rows: auto 1fr; gap: 14px; min-width: 0; }
.home-dashboard-rail .panel { min-height: 0; }
.home-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.home-quick-grid button { display: grid; min-width: 0; min-height: 75px; padding: 9px 5px; place-items: center; align-content: center; gap: 6px; border: 1px solid #dfe6ec; border-radius: 7px; background: #fff; color: #26364b; font-size: 9px; font-weight: 700; cursor: pointer; }
.home-quick-grid button:hover { border-color: #8fcfcd; background: #f3fbfa; color: #087f7c; }
.home-quick-grid button > span { display: grid; height: 27px; min-width: 27px; padding: 0 4px; place-items: center; border-radius: 7px; background: #eef4f8; color: #536b87; font-size: 15px; font-weight: 800; }
.home-quick-grid button:nth-child(4) > span, .home-quick-grid button:nth-child(5) > span { background: #e8f7f6; color: #0c9692; }
.home-quick-grid button:nth-child(7) > span { background: #fff0ee; color: #e24f3d; font-size: 9px; }
.home-deadline-panel .panel-head > span { color: #748297; font-size: 10px; }
.home-deadline-list { display: grid; gap: 0; }
.home-deadline-list button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 8px 0; border: 0; border-bottom: 1px solid #e8edf2; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.home-deadline-list button:last-child { border-bottom: 0; }
.home-deadline-list button > span { display: grid; gap: 2px; min-width: 52px; padding: 5px 6px; border-radius: 6px; background: #eef8f8; text-align: center; }
.home-deadline-list button b { color: #0c8f8c; font-size: 10px; }
.home-deadline-list button strong { color: #32677a; font-size: 9px; }
.home-deadline-list button em { overflow: hidden; color: #29394d; font-size: 10px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.home-deadline-list button small { padding: 3px 5px; border: 1px solid #ff9a42; border-radius: 4px; color: #e8750d; font-size: 8px; white-space: nowrap; }

.home-workflow-panel { gap: 0; padding-bottom: 13px; }
.home-workflow-panel .panel-head { min-height: 42px; }
.home-workflow { display: flex; align-items: center; gap: 7px; padding-top: 12px; }
.home-workflow-stage { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; flex: 1 1 0; min-width: 0; min-height: 74px; padding: 8px 10px; border: 1px solid #e0e7ed; border-radius: 7px; background: #fff; }
.home-workflow-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: #e8f7f6; color: #07918e; font-size: 15px; }
.home-workflow-stage > div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 3px 7px; min-width: 0; }
.home-workflow-stage strong { color: #078d8a; font-size: 11px; }
.home-workflow-stage b { color: #172337; font-size: 21px; }
.home-workflow-stage b small { margin-left: 2px; font-size: 9px; }
.home-workflow-stage > div > span { grid-column: 1 / -1; color: #758397; font-size: 9px; }
.home-workflow-stage i { grid-column: 1 / -1; display: block; height: 4px; overflow: hidden; border-radius: 99px; background: #e7edf1; }
.home-workflow-stage i em { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.home-workflow-stage mark { padding: 0; background: transparent; color: #168d8a; font-size: 9px; }
.home-workflow-stage.is-amber .home-workflow-icon { background: #fff2dc; color: #ed8b00; }
.home-workflow-stage.is-amber strong, .home-workflow-stage.is-amber mark { color: #d87e00; }
.home-workflow-stage.is-amber i em { background: #f39a19; }
.home-workflow-stage.is-green .home-workflow-icon { background: #e8f7ef; color: #14804a; }
.home-workflow-stage.is-green strong, .home-workflow-stage.is-green mark { color: #14804a; }
.home-workflow-stage.is-green i em { background: #26a765; }
.home-workflow-arrow { flex: 0 0 auto; color: #738296; font-size: 22px; }

.home-activity-panel { gap: 0; overflow: hidden; }
.home-recent-activity { display: grid; margin: 0 -18px -17px; }
.home-activity-row { display: grid; grid-template-columns: 130px 80px minmax(200px, 1.5fr) minmax(140px, 1fr) 110px; align-items: center; min-height: 28px; border-top: 1px solid #e6ebf0; color: #59687b; font-size: 9px; }
.home-activity-row > * { min-width: 0; padding: 5px 12px; overflow: hidden; border-right: 1px solid #edf1f4; text-overflow: ellipsis; white-space: nowrap; }
.home-activity-row > *:last-child { border-right: 0; }
.home-activity-row strong { color: #2b3a4d; font-size: 9px; }
.home-activity-head { min-height: 25px; background: #f5f7f9; color: #47566a; font-weight: 800; }
.home-dashboard-empty { margin: 0; padding: 26px 10px; color: #8592a3; font-size: 11px; text-align: center; }

@media (min-width: 761px) {
  body.sidebar-collapsed .topbar { grid-template-columns: 76px minmax(60px, 1fr) auto; }
  body.sidebar-collapsed .brand { justify-content: center; margin-right: 0; padding: 0; }
  body.sidebar-collapsed .brand > div:last-child { display: none; }
  body.sidebar-collapsed .sidebar { width: 76px; }
  body.sidebar-collapsed .main-content { margin-left: 76px; }
  body.sidebar-collapsed .sidebar .menu-card { padding-inline: 10px; }
  body.sidebar-collapsed .sidebar .section-title,
  body.sidebar-collapsed .sidebar .menu-item,
  body.sidebar-collapsed .sidebar .menu-group-toggle,
  body.sidebar-collapsed .dashboard-home-button { font-size: 0; justify-content: center; gap: 0; }
  body.sidebar-collapsed .sidebar .menu-item::before,
  body.sidebar-collapsed .sidebar .menu-group-toggle::before,
  body.sidebar-collapsed .dashboard-home-button::before { flex-basis: 24px; width: 24px; font-size: 17px; }
  body.sidebar-collapsed .sidebar .menu-submenu { display: none; }
  body.sidebar-collapsed .sidebar .menu-group-chevron { display: none; }
}

@media (max-width: 1280px) and (min-width: 761px) {
  .home-dashboard-grid { grid-template-columns: minmax(300px,.92fr) minmax(360px,1.08fr); }
  .home-dashboard-rail { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .home-quick-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .home-dashboard-grid > .panel { min-height: 420px; }
}

@media (max-width: 980px) {
  .home-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-dashboard-grid { grid-template-columns: 1fr; }
  .home-dashboard-rail { grid-column: auto; grid-template-columns: 1fr; }
  .home-dashboard-grid > .panel { min-height: 0; }
  .home-workflow { display: grid; grid-template-columns: 1fr 1fr; }
  .home-workflow-arrow { display: none; }
}

@media (max-width: 760px) {
  .topbar-page-context { order: 2; width: 100%; height: 46px; padding: 0 4px; border-top: 1px solid var(--line); }
  .topbar-page-context h2 { font-size: 17px; }
  .topbar-date { font-size: 10px; }
  .dashboard-home-button { flex: 0 0 auto; width: auto; min-height: 36px; padding: 8px 10px; white-space: nowrap; }
  .dashboard-home-button::before, .sidebar .menu-item::before, .sidebar .menu-group-toggle::before { display: none; }
  .home-kpi-grid { gap: 10px; }
  .home-kpi-card { min-height: 104px; padding: 13px; gap: 10px; }
  .home-kpi-icon { flex-basis: 40px; width: 40px; height: 40px; font-size: 19px; }
  .home-kpi-card strong { font-size: 25px; }
  .home-dashboard-grid { gap: 10px; }
  .home-dashboard-grid .panel-head, .home-workflow-panel .panel-head, .home-activity-panel .panel-head { margin-inline: -14px; }
  .home-wh-table-head, .home-wh-table-row { grid-template-columns: minmax(100px,1.4fr) repeat(3,.5fr); }
  .home-wh-table-head span:last-child, .home-wh-table-row span:last-child { display: none; }
  .home-workflow { grid-template-columns: 1fr; }
  .home-activity-row { grid-template-columns: 110px 65px minmax(180px,1fr); }
  .home-activity-row > *:nth-child(4), .home-activity-row > *:nth-child(5) { display: none; }
  .home-recent-activity { overflow-x: auto; }
}

/* ================================================================
   2026 workspace refresh — one visual system across every menu
   ================================================================ */
