* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.workspace-shell { width: min(1440px, calc(100% - 28px)); margin: 0 auto; padding: 14px 0 40px; }
.workspace-shell .topbar { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 14px; align-items: center; }
.workspace-shell .topbar h1, .workspace-shell .topbar p { margin: 0; }
.workspace-shell .topbar .header-actions { grid-column: 2; grid-row: 1; }
.workspace-shell .server-monitor { grid-column: 1 / -1; }
.workspace-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.workspace-loading { min-height: 260px; display: grid; place-items: center; padding: 40px; color: var(--muted); text-align: center; }
.workspace-loading::before { content: ""; width: 28px; height: 28px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: workspace-spin .75s linear infinite; }
@keyframes workspace-spin { to { transform: rotate(360deg); } }
.workspace-empty { padding: 44px 20px; color: var(--muted); text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.workspace-empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 16px; }
.workspace-action { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-weight: 800; text-decoration: none; }
.workspace-action.primary { border-color: transparent; color: #fff; background: var(--brand-gradient); }
.workspace-action:hover { border-color: var(--brand); color: var(--brand-dark); }
.workspace-action.primary:hover { color: #fff; filter: brightness(.97); }
.workspace-chip { display: inline-flex; min-height: 25px; align-items: center; padding: 3px 8px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); font-size: 11px; font-weight: 850; }
.workspace-chip.danger { color: #a63c34; background: #fff0ee; }
.workspace-chip.warning { color: #8b5700; background: #fff6dc; }
.workspace-chip.neutral { color: #586a7c; background: #eef3f6; }

.profile-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 20px; }
.profile-hero-copy { min-width: 0; }
.profile-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--brand-dark); font-size: 12px; font-weight: 850; text-decoration: none; }
.profile-hero h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.profile-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.profile-summary article { min-height: 82px; padding: 14px 16px; }
.profile-summary span { color: var(--muted); font-size: 12px; font-weight: 750; }
.profile-summary strong { display: block; margin-top: 6px; font-size: 23px; letter-spacing: -.04em; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 10px; margin-top: 10px; }
.profile-section { min-width: 0; overflow: hidden; }
.profile-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.profile-section > header h3 { margin: 0; font-size: 16px; }
.profile-section > header span { color: var(--muted); font-size: 12px; }
.profile-section.full { grid-column: 1 / -1; }
.profile-list { display: grid; }
.profile-list-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 14px 17px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.profile-list-item:first-child { border-top: 0; }
.profile-list-item:hover { background: var(--panel-soft); }
.profile-list-item time, .profile-list-item small { color: var(--muted); font-size: 11px; }
.profile-list-item strong { display: block; margin-bottom: 4px; font-size: 14px; }
.profile-list-item p { margin: 4px 0 0; color: #4f6274; font-size: 12px; line-height: 1.55; }
.profile-followup-checks { display: flex; flex-wrap: wrap; gap: 5px; }
.profile-followup-checks span { padding: 4px 7px; border-radius: 6px; color: #8b5700; background: #fff6dc; font-size: 10px; font-weight: 800; }
.profile-followup-checks span.done { color: #0a6b5e; background: #eaf8f3; }
.profile-current { padding: 16px 17px; }
.profile-current-actions { margin-top: 12px; }
.profile-current-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-current-grid div { padding: 11px; border-radius: 10px; background: var(--panel-soft); }
.profile-current-grid dt { color: var(--muted); font-size: 11px; }
.profile-current-grid dd { margin: 4px 0 0; font-size: 13px; font-weight: 800; }

.work-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 18px 20px; }
.work-intro h2, .work-intro p { margin: 0; }
.work-intro h2 { font-size: 20px; }
.work-intro p { margin-top: 5px; color: var(--muted); }
.work-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.work-summary article { padding: 14px 16px; }
.work-summary span { color: var(--muted); font-size: 12px; font-weight: 750; }
.work-summary strong { display: block; margin-top: 4px; font-size: 24px; }
.work-summary article.remote { border-color: #9ddfd4; border-bottom: 3px solid #198a80; background: #f3fbf9; }
.work-summary article.visit { border-color: #b9c9ff; border-bottom: 3px solid #4c6fe7; background: #f5f7ff; }
.work-summary article.remote span, .work-summary article.remote strong { color: #08766c; }
.work-summary article.visit span, .work-summary article.visit strong { color: #3158c7; }
.work-controls { display: grid; grid-template-columns: minmax(200px, 1fr) auto; gap: 12px; margin-top: 10px; padding: 14px; }
.work-controls input { width: 100%; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.work-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.work-tabs button { min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: #465a6c; background: #fff; font-weight: 800; cursor: pointer; }
.work-tabs button.active { border-color: transparent; color: #fff; background: var(--brand-gradient); }
.work-tabs button[data-filter="remote"]:not(.active) { border-color: #9ddfd4; color: #08766c; background: #e6f6f2; }
.work-tabs button[data-filter="visit"]:not(.active) { border-color: #b9c9ff; color: #3158c7; background: #edf2ff; }
.work-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.work-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; color: inherit; background: #fff; box-shadow: 0 7px 22px rgba(31, 60, 78, .05); text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.work-card:hover { transform: translateY(-1px); border-color: rgba(17, 134, 125, .42); box-shadow: 0 11px 28px rgba(31, 60, 78, .09); }
.work-card-icon { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: var(--brand-dark); background: var(--brand-soft); font-size: 16px; font-weight: 900; }
.work-card.urgent .work-card-icon { color: #b23b33; background: #fff0ee; }
.work-card.visit:not(.urgent) .work-card-icon { color: #3158c7; background: #edf2ff; }
.work-card.remote:not(.urgent) .work-card-icon { color: #08766c; background: #e6f6f2; }
.work-card h3 { overflow: hidden; margin: 0; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.work-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.work-card-arrow { color: var(--brand); font-size: 18px; }

.client-profile-link { color: var(--ink); font-weight: 850; text-decoration-color: rgba(17, 134, 125, .35); text-underline-offset: 3px; }
.client-profile-link:hover { color: var(--brand-dark); text-decoration-color: currentColor; }

@media (max-width: 900px) {
  .workspace-shell { width: min(100% - 18px, 760px); padding-top: 9px; }
  .workspace-shell .topbar { grid-template-columns: 1fr; }
  .workspace-shell .topbar .header-actions { grid-column: 1; grid-row: auto; align-items: stretch; }
  .profile-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-section.full { grid-column: auto; }
  .work-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .profile-hero, .work-intro { align-items: stretch; flex-direction: column; }
  .profile-actions { justify-content: flex-start; }
  .profile-list-item { grid-template-columns: 74px minmax(0, 1fr); }
  .profile-list-item > :last-child { grid-column: 2; justify-self: start; }
  .profile-current-grid { grid-template-columns: 1fr; }
  .work-controls { grid-template-columns: 1fr; }
  .work-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
