.workspace-module {
  width: min(100%, 1460px);
  min-width: 0;
  margin: 0 auto;
  color: #24373e;
}

.workspace-hero,
.workspace-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 8px 2px 0;
}

.workspace-hero p,
.workspace-section-head p {
  margin: 0 0 6px;
  color: #08766d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.workspace-hero h2,
.workspace-section-head h2 {
  margin: 0;
  color: #172930;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.2;
}

.workspace-hero > div > span,
.workspace-section-head > div > span {
  display: block;
  margin-top: 8px;
  color: #74858c;
  font-size: 13px;
}

.workspace-section-head > div:last-child {
  display: flex;
  gap: 10px;
}

.workspace-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid #dbe7e5;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(31, 62, 68, .05);
}

.workspace-summary-grid > button {
  display: grid;
  min-width: 0;
  min-height: 130px;
  padding: 22px 25px;
  border: 0;
  border-right: 1px solid #e2eae9;
  background: #fff;
  color: #24373e;
  text-align: left;
  cursor: pointer;
}

.workspace-summary-grid > button:last-child { border-right: 0; }
.workspace-summary-grid > button:hover { background: #f6fbfa; }
.workspace-summary-grid small { color: #6c7d84; font-size: 13px; font-weight: 750; }
.workspace-summary-grid strong { margin: 8px 0 3px; color: #087a70; font-size: 35px; line-height: 1; }
.workspace-summary-grid strong.danger { color: #d9424d; }
.workspace-summary-grid span { color: #94a1a6; font-size: 11px; }

.workspace-home-grid,
.workspace-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
  gap: 18px;
  align-items: start;
}

.workspace-card {
  min-width: 0;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid #dde7e6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(34, 58, 63, .04);
}

.workspace-card-head,
.workspace-todo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid #e5eceb;
}

.workspace-card-head h3 { margin: 0; color: #21343b; font-size: 17px; }
.workspace-card-head p { margin: 5px 0 0; color: #829198; font-size: 12px; }
.workspace-card-head > button { border: 0; background: transparent; color: #087a70; font-size: 12px; font-weight: 750; cursor: pointer; }

.workspace-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.workspace-source-grid button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid #e1e9e8;
  border-radius: 11px;
  background: #f8fbfa;
  color: #31474e;
  text-align: left;
  cursor: pointer;
}

.workspace-source-grid button:hover { border-color: #70b7b0; background: #f1faf8; }
.workspace-source-grid span { align-self: center; overflow: hidden; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.workspace-source-grid strong { color: #087a70; font-size: 24px; }
.workspace-source-grid small { grid-column: 1/-1; color: #88969c; font-size: 11px; }

.workspace-todo-list { padding: 0 18px 18px; }
.workspace-todo-list.compact { padding-top: 6px; }
.workspace-todo-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 128px auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 16px 4px;
  border-bottom: 1px solid #e8eeed;
}
.workspace-todo-row:last-child { border-bottom: 0; }
.workspace-todo-status { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: #eaf7f5; color: #14877d; }
.workspace-todo-row.overdue .workspace-todo-status { background: #fff0f1; color: #dc3f4a; }
.workspace-todo-status svg { width: 18px; height: 18px; }
.workspace-todo-main { min-width: 0; }
.workspace-todo-main > div { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.workspace-todo-main > div span { color: #087a70; font-size: 10px; font-weight: 800; }
.workspace-todo-main em { padding: 2px 6px; border-radius: 8px; background: #fff0f1; color: #d93644; font-size: 10px; font-style: normal; font-weight: 750; }
.workspace-todo-main strong { display: block; overflow: hidden; color: #263a41; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-todo-main small { display: block; margin-top: 4px; overflow: hidden; color: #829197; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-todo-due { text-align: right; }
.workspace-todo-due small { display: block; color: #95a1a6; font-size: 9px; }
.workspace-todo-due strong { display: block; margin-top: 4px; color: #5c7078; font-size: 11px; }
.workspace-todo-row.overdue .workspace-todo-due strong { color: #d63e49; }
.workspace-todo-actions { display: flex; gap: 7px; }
.workspace-todo-actions .btn { min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 11px; }

.workspace-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}
.workspace-module-grid article { min-width: 0; padding: 16px; border: 1px solid #e0e9e7; border-radius: 12px; background: #fafcfb; }
.workspace-module-grid article > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workspace-module-grid article strong { overflow: hidden; color: #263a41; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-module-grid article span { flex: 0 0 auto; padding: 3px 7px; border-radius: 8px; background: #e7f6f2; color: #128174; font-size: 9px; font-weight: 750; }
.workspace-module-grid article span.readonly { background: #f0f2f2; color: #75868c; }
.workspace-module-grid ul { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 14px 0; padding: 0; list-style: none; }
.workspace-module-grid li { overflow: hidden; color: #708087; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-module-grid li::before { content: "·"; margin-right: 4px; color: #169187; }
.workspace-module-grid article > button { width: 100%; min-height: 32px; border: 1px solid #cfe1de; border-radius: 8px; background: #fff; color: #087a70; font-size: 11px; font-weight: 750; cursor: pointer; }

.workspace-plan-list,
.workspace-approval-list { padding: 4px 18px 18px; }
.workspace-plan-list article,
.workspace-approval-list article { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 11px; align-items: center; padding: 14px 2px; border-bottom: 1px solid #e7edec; }
.workspace-plan-list article:last-child,
.workspace-approval-list article:last-child { border-bottom: 0; }
.workspace-plan-list article > span,
.workspace-approval-list article > span { padding: 4px 7px; border-radius: 8px; background: #e8f7f1; color: #168268; font-size: 9px; font-weight: 750; }
.workspace-plan-list article > span.paused,
.workspace-approval-list article > span.rejected { background: #fff0f1; color: #d43d49; }
.workspace-approval-list article > span.pending { background: #fff4e4; color: #b96b08; }
.workspace-plan-list article div,
.workspace-approval-list article div { min-width: 0; }
.workspace-plan-list article strong,
.workspace-approval-list article strong { display: block; overflow: hidden; color: #31454c; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-plan-list article small,
.workspace-approval-list article small { display: block; margin-top: 4px; overflow: hidden; color: #849198; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-plan-list time,
.workspace-approval-list time { color: #77878e; font-size: 10px; white-space: nowrap; }
.workspace-plan-list article > button,
.workspace-approval-list article > div:last-child button { border: 0; background: transparent; color: #087a70; font-size: 10px; font-weight: 750; cursor: pointer; }

.workspace-todo-toolbar { align-items: flex-start; }
.workspace-todo-toolbar > div { display: flex; flex-wrap: wrap; gap: 7px; }
.workspace-todo-toolbar button { min-height: 32px; padding: 0 11px; border: 1px solid #dbe5e3; border-radius: 8px; background: #fff; color: #64777e; font-size: 10px; font-weight: 720; cursor: pointer; }
.workspace-todo-toolbar button.active { border-color: #168b80; background: #eaf7f5; color: #08776e; }
.workspace-todo-toolbar > strong { flex: 0 0 auto; color: #087a70; font-size: 12px; }

.workspace-empty { display: grid; place-items: center; min-height: 140px; padding: 28px; color: #809097; text-align: center; }
.workspace-empty svg { width: 28px; height: 28px; margin-bottom: 9px; color: #70aaa4; }
.workspace-empty strong { color: #52676e; font-size: 13px; }
.workspace-empty span { margin-top: 5px; font-size: 10px; }

.workspace-dialog { width: min(760px, calc(100vw - 24px)); }
.workspace-dialog-body { max-height: min(70vh, 660px); padding: 24px; overflow: auto; }
.platform-mobile-nav { display: none; }
.workspace-load-status { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; margin-bottom:16px; border:1px solid #cde4df; border-radius:12px; background:#eff8f6; color:#285e58; line-height:1.5; }
@media (max-width:720px) {
  .workspace-load-status { flex-wrap:wrap; }
  /* Full-screen task actions must not sit behind the global navigation. */
  body:has(#handoverModule:not(.hidden) .task-detail-panel.is-open) .platform-mobile-nav { visibility:hidden; pointer-events:none; }
}

@media (max-width: 1100px) {
  .workspace-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-home-grid,
  .workspace-workbench-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body .app-shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .workspace-module { padding: 0 2px; }
  .workspace-hero,
  .workspace-section-head { align-items: stretch; flex-direction: column; gap: 14px; padding: 4px 2px 0; }
  .workspace-hero > button { align-self: flex-start; }
  .workspace-section-head > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .workspace-section-head > div:last-child .btn { width: 100%; padding: 0 10px; }
  .workspace-summary-grid { grid-template-columns: 1fr 1fr; border-radius: 12px; }
  .workspace-summary-grid > button { min-height: 100px; padding: 16px; border-bottom: 1px solid #e2eae9; }
  .workspace-summary-grid > button:nth-child(2) { border-right: 0; }
  .workspace-summary-grid > button:nth-child(n+3) { border-bottom: 0; }
  .workspace-summary-grid strong { font-size: 29px; }
  .workspace-module-grid { grid-template-columns: 1fr 1fr; padding: 12px; }
  .workspace-source-grid { padding: 12px; }
  .workspace-card-head,
  .workspace-todo-toolbar { padding: 16px; }
  .workspace-todo-list { padding: 0 12px 12px; }
  .workspace-todo-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; }
  .workspace-todo-due { grid-column: 2; text-align: left; }
  .workspace-todo-due small { display: none; }
  .workspace-todo-actions { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; }
  .workspace-todo-main strong { white-space: normal; }
  .workspace-plan-list article,
  .workspace-approval-list article { grid-template-columns: auto minmax(0, 1fr); }
  .workspace-plan-list time,
  .workspace-approval-list time { grid-column: 2; }
  .workspace-plan-list article > button,
  .workspace-approval-list article > div:last-child { grid-column: 2; justify-self: end; }
  .platform-mobile-nav {
    position: fixed;
    z-index: 350;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: calc(61px + env(safe-area-inset-bottom));
    padding: 5px 4px env(safe-area-inset-bottom);
    border-top: 1px solid #dbe7e5;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 28px rgba(28, 54, 59, .1);
    backdrop-filter: blur(16px);
  }
  .platform-mobile-nav button { position: relative; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: #7c8b91; font-size: 9px; font-weight: 720; }
  .platform-mobile-nav button.active { color: #087a70; }
  .platform-mobile-nav svg { width: 19px; height: 19px; }
  .platform-mobile-nav b { position: absolute; top: 1px; left: 55%; min-width: 17px; padding: 2px 4px; border-radius: 10px; background: #e44650; color: #fff; font-size: 8px; }
  .notification-mobile-nav { display: none !important; }
  .workspace-dialog-body { padding: 18px 16px; }
}

@media (max-width: 440px) {
  .workspace-module-grid { grid-template-columns: 1fr; }
  .workspace-source-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .notification-active.mobile-apps-open .module-sidebar {
    display: flex;
  }
}
