:root {
  --bg: #f7f8fb;
  --ink: #1d2733;
  --panel: #ffffff;
  --line: #dce3ec;
  --accent: #2f5bdb;
  --accent-dark: #2548ad;
  --warn: #5a67d8;
  --danger: #b42318;
  --good: #2f5bdb;
  --muted: #556273;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  line-height: 1.52;
  background: linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
}

.orb {
  display: none;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: #ffc987;
  top: -120px;
  left: -70px;
}

.orb-b {
  width: 300px;
  height: 300px;
  background: #9adfce;
  top: -120px;
  right: -70px;
}

.shell-header {
  width: min(1240px, 94vw);
  margin: 0.7rem auto 0.6rem;
  padding: 0.7rem 0.9rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0.4rem;
  z-index: 5;
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.92);
}

.brand {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand span {
  color: var(--accent);
}

.header-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.header-links a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.header-links a:hover {
  border-color: var(--line);
  background: #fff;
}

.header-links a.active {
  border-color: #cad6fb;
  background: #eef2ff;
  color: #2a4592;
}

.status-chip {
  background: #eef2ff;
  color: #2a4592;
  border: 1px solid #d3dcfb;
  border-radius: 999px;
  padding: 0.35rem 0.68rem;
  font-weight: 700;
  font-size: 0.78rem;
}

.layout {
  width: min(1240px, 94vw);
  margin: 0 auto 2.2rem;
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid #e8edf3;
  border-radius: 16px;
  box-shadow: 0 3px 14px rgba(18, 32, 35, 0.05);
}

.quick-panel {
  padding: 1rem;
  align-self: start;
  position: sticky;
  top: 4.8rem;
  background: #fcfdff;
}

.quick-panel h2 {
  margin-top: 0;
  margin-bottom: 0.52rem;
  font-family: "Manrope", sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
}

.workflow-steps {
  margin: 0;
  padding-left: 1.05rem;
  line-height: 1.45;
}

.stats-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.stats-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.58rem;
  background: #fff;
}

.label {
  margin: 0;
  font-size: 0.8rem;
  color: #44555f;
}

.value {
  margin: 0.2rem 0 0;
  font-weight: 800;
  font-size: 1.24rem;
  font-family: "Manrope", sans-serif;
}

.content-stack {
  display: grid;
  gap: 1rem;
}

.employee-tabs {
  display: flex;
  gap: 0.45rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.55rem;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.tab-btn:hover {
  border-color: #c5d3f7;
  background: #f7f9ff;
  color: var(--ink);
}

.tab-btn[aria-selected="true"] {
  background: #eef2ff;
  border-color: #bac9f5;
  color: #2a4592;
}

.tab-hidden {
  display: none;
}

.module {
  padding: 0.95rem;
}

.employee-view .content-stack {
  gap: 0.65rem;
}

.client-view .layout,
.employee-view .layout {
  grid-template-columns: 1fr;
}

.client-view .content-stack,
.employee-view .content-stack {
  width: min(980px, 100%);
  margin: 0 auto;
}

.employee-view .employee-group {
  padding: 0.45rem 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.employee-view .module-grid {
  gap: 0.7rem;
}

.employee-view .card {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  box-shadow: 0 10px 26px rgba(23, 34, 56, 0.08);
}

.employee-view .module-title-row {
  margin-bottom: 0.65rem;
}

.employee-view .simple-list li,
.employee-view .integration-list li,
.employee-view .selectable-list li,
.employee-view .queue-column,
.employee-view .queue-column li,
.employee-view .kpi-row article {
  border: 0;
  background: #f5f8ff;
  box-shadow: inset 0 0 0 1px rgba(214, 224, 245, 0.6);
}

.employee-view .employee-group .table-wrap table {
  border-collapse: separate;
  border-spacing: 0 0.4rem;
}

.employee-view .employee-group .table-wrap th,
.employee-view .employee-group .table-wrap td {
  border: 0;
  white-space: normal;
  padding: 0.52rem 0.58rem;
}

.employee-view .employee-group .table-wrap tbody tr {
  background: #f7f9ff;
  box-shadow: inset 0 0 0 1px rgba(218, 227, 246, 0.7);
}

.employee-view .employee-group .table-wrap tbody td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.employee-view .employee-group .table-wrap tbody td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.client-management-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.create-client-toggle {
  border: 1px solid #cad6fb;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #eef2ff;
  color: #2a4592;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.create-client-toggle:hover {
  background: #e3ebff;
}

.create-client-panel {
  margin-bottom: 0.8rem;
}

.create-client-panel[hidden] {
  display: none;
}

.dashboard-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0.8rem;
}

#dashboard-module .pill {
  border: 0;
  background: #eff4ff;
  color: #2d4b9f;
}

#dashboard-module .stats-grid article {
  border: 0;
  border-radius: 16px;
  padding: 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  box-shadow: 0 10px 24px rgba(24, 37, 69, 0.08);
}

#dashboard-module .stats-grid .label {
  color: #6a7789;
  font-weight: 600;
}

#dashboard-module .stats-grid .value {
  color: #25395d;
}

#dashboard-module .card {
  border: 0;
  border-radius: 18px;
  padding: 1rem;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(23, 34, 56, 0.08);
}

#dashboard-module .simple-list li {
  border: 0;
  border-radius: 12px;
  background: #f5f8ff;
  box-shadow: inset 0 0 0 1px rgba(214, 224, 245, 0.6);
}

#dashboard-module .badge {
  border-radius: 999px;
  border: 0;
  box-shadow: none;
}

.calendar-widget {
  display: grid;
  gap: 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.calendar-title {
  margin: 0;
  min-width: 140px;
  text-align: center;
  font-weight: 700;
  color: #2a4592;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: #6b7788;
  padding: 0.15rem 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.34rem;
}

.calendar-day {
  border: 0;
  border-radius: 12px;
  background: #fff;
  min-height: 62px;
  padding: 0.36rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(219, 228, 246, 0.75);
}

.calendar-day.weekend {
  background: #f8f3ff;
  box-shadow: inset 0 0 0 1px rgba(216, 199, 249, 0.9);
}

.calendar-day.weekend .calendar-day-number {
  color: #5c3fa3;
}

.calendar-day.other-month {
  opacity: 0.48;
}

.calendar-day.has-items {
  box-shadow: inset 0 0 0 1px #c7d4ff;
  background: #f7f9ff;
}

.calendar-day.selected {
  box-shadow: 0 0 0 2px rgba(142, 167, 246, 0.2), inset 0 0 0 1px #8ea7f6;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 1px #9ab1f8;
}

.calendar-day-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: #3a4654;
}

.calendar-day-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #2f4ca1;
  background: #e8efff;
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
}

.calendar-details {
  border-top: 1px solid #e9eef8;
  padding-top: 0.6rem;
}

.calendar-details h4 {
  margin-bottom: 0.45rem;
}

.calendar-details .simple-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  background: #f6f9ff;
  box-shadow: inset 0 0 0 1px rgba(217, 226, 244, 0.65);
}

.calendar-item-title {
  font-size: 0.85rem;
  color: var(--ink);
}

#dashboard-module .table-wrap table {
  border-collapse: separate;
  border-spacing: 0 0.4rem;
  min-width: 0;
}

#dashboard-module .table-wrap th,
#dashboard-module .table-wrap td {
  border: 0;
  white-space: normal;
  padding: 0.52rem 0.58rem;
}

#dashboard-module .table-wrap tbody tr {
  background: #f7f9ff;
  box-shadow: inset 0 0 0 1px rgba(218, 227, 246, 0.7);
}

#dashboard-module .table-wrap tbody td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

#dashboard-module .table-wrap tbody td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

#dashboard-doc-status li,
#dashboard-obligation-status li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.client-dashboard-shell {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.client-view .module.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.client-dashboard-shell .module-grid {
  gap: 0.9rem;
}

.client-dashboard-shell .pill {
  border: 0;
  background: #e9f0ff;
  color: #2d4b9f;
}

.client-dashboard-shell .client-widget {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
  box-shadow: 0 14px 30px rgba(20, 36, 68, 0.08);
}

.client-widget-list {
  gap: 0.55rem;
}

.client-widget-list li {
  border: 0;
  border-radius: 12px;
  padding: 0.6rem 0.72rem;
  background: rgba(243, 248, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.client-widget-main {
  display: grid;
  gap: 0.06rem;
}

.client-widget-main small {
  color: #5e6e83;
  font-size: 0.75rem;
}

.client-widget-empty {
  color: #516176;
  font-weight: 600;
}

.client-vendor-history-grid {
  display: grid;
  gap: 0.58rem;
}

.client-vendor-history-item {
  border-radius: 13px;
  background: rgba(243, 248, 255, 0.9);
  overflow: hidden;
}

.client-vendor-history-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.62rem 0.72rem;
  font-weight: 700;
  color: #23344d;
}

.client-vendor-history-item summary::-webkit-details-marker {
  display: none;
}

.client-vendor-history-item summary::after {
  content: "+";
  font-size: 0.95rem;
  line-height: 1;
  color: #48609b;
  margin-left: 0.35rem;
}

.client-vendor-history-item[open] summary::after {
  content: "-";
}

.client-vendor-history-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-vendor-history-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.client-vendor-history-docs {
  margin-top: 0;
  padding: 0 0.58rem 0.58rem;
}

.client-status-widget {
  background: linear-gradient(155deg, #f0f5ff 0%, #eefcf9 100%);
}

.client-status-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-status-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  border-radius: 12px;
  padding: 0.52rem 0.62rem;
  background: rgba(255, 255, 255, 0.86);
}

.client-status-label {
  font-size: 0.81rem;
  font-weight: 700;
  color: #2a3952;
}

.module.route-focus {
  border-color: #c7d4ff;
  box-shadow: 0 0 0 3px rgba(137, 160, 240, 0.2), 0 3px 14px rgba(18, 32, 35, 0.05);
  animation: pulseFocus 700ms ease;
}

.module-title-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

h1,
h3,
h4 {
  font-family: "Manrope", sans-serif;
  margin: 0;
}

h1 {
  font-size: 1.22rem;
  font-weight: 800;
}

h3 {
  margin-bottom: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.24rem 0.68rem;
  font-size: 0.75rem;
  background: #f6f8fb;
  font-weight: 600;
}

.module-grid {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.module-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid #edf1f6;
  border-radius: 16px;
  background: #ffffff;
  padding: 0.95rem;
  box-shadow: 0 2px 8px rgba(18, 32, 35, 0.04);
}

.card p {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

.hint {
  font-size: 0.82rem;
  color: #325464;
  background: #f4f9fc;
  border: 1px solid #deebf2;
  border-radius: 10px;
  padding: 0.42rem 0.55rem;
}

.upload-dropzone {
  border: 1px dashed #b7c7e8;
  border-radius: 14px;
  min-height: 160px;
  padding: 1rem;
  text-align: center;
  background: #f9fbff;
  cursor: pointer;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.6rem;
  transition: border-color 140ms ease, background 140ms ease;
}

.upload-dropzone p {
  margin: 0;
  font-weight: 700;
  color: #274585;
}

.upload-dropzone-btn {
  min-width: 140px;
}

.upload-dropzone.dragover,
.upload-dropzone:hover,
.upload-dropzone:focus-visible {
  border-color: #7d99e8;
  background: #eef3ff;
  outline: none;
}

.form-stack {
  display: grid;
  gap: 0.65rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.87rem;
  font-weight: 500;
}

.checklist {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem;
  margin: 0;
}

.checklist legend {
  padding: 0 0.35rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.checklist label {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-weight: 500;
  font-size: 0.84rem;
  margin: 0.25rem 0;
}

.checklist input[type="checkbox"] {
  width: auto;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.6rem 0.66rem;
  background: #fffeff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.inline-form {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form > * {
  flex: 1;
  min-width: 150px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0.62rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 16px rgba(37, 72, 173, 0.24);
}

.btn.primary:hover {
  background: var(--accent-dark);
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn.danger {
  background: #fff1f3;
  border-color: #fecdd3;
  color: var(--danger);
}

.btn.success {
  background: linear-gradient(135deg, #1f9d68 0%, #157347 100%);
  border-color: #146c43;
  color: #fff;
  box-shadow: 0 8px 16px rgba(21, 115, 71, 0.24);
}

.btn.success:hover {
  background: #157347;
}

.simple-list,
.integration-list,
.selectable-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.simple-list li,
.integration-list li,
.selectable-list li {
  border: 1px solid #edf1f6;
  border-radius: 14px;
  padding: 0.54rem 0.64rem;
  background: #fff;
}

.integration-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

#task-assigned-by-client li,
#docs-awaiting-client li,
#docs-awaiting-manager li,
#overdue-items-list li,
#doc-verification-sync-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.integration-list button {
  min-width: 92px;
}

.selectable-list li {
  cursor: pointer;
}

.selectable-list li.active {
  border-color: #c8d5fb;
  background: #f2f5ff;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  border-bottom: 1px solid #e5ece9;
  padding: 0.56rem 0.34rem;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #27444d;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.54rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.uploaded,
.badge.pending,
.badge.in_progress {
  background: #f0edff;
  color: #4b3fb3;
}

.badge.processing {
  background: #e9f2ff;
  color: #1f5eb4;
}

.badge.pending_review {
  background: #fff3d6;
  color: #9c5f00;
}

.badge.ready_to_file {
  background: #e6f7f4;
  color: #0f6a5e;
}

.badge.review,
.badge.client_followup,
.badge.manager_review,
.badge.filing {
  background: #eef2ff;
  color: #2a4592;
}

.badge.approved,
.badge.completed,
.badge.synced,
.badge.connected {
  background: #e5f8ec;
  color: #1e7a43;
}

.badge.rejected,
.badge.overdue,
.badge.disconnected {
  background: #fee2e2;
  color: #991b1b;
}

.days.good {
  color: var(--good);
  font-weight: 700;
}

.days.warn {
  color: var(--warn);
  font-weight: 700;
}

.days.danger {
  color: var(--danger);
  font-weight: 700;
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.status-help-head {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
}

.status-help-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #c9d5ec;
  background: #f4f7ff;
  color: #2a4592;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.status-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  width: min(380px, calc(100vw - 1.5rem));
  border: 1px solid #e0e7f5;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(26, 39, 66, 0.14);
  padding: 0.6rem;
  white-space: normal;
  display: none;
  z-index: 30;
}

.client-view #client-upload-module .table-wrap {
  overflow: visible;
}

.client-view #client-upload-module table {
  min-width: 0;
}

#client-dashboard-doc-status li,
#client-dashboard-task-status li,
#client-dashboard-recent-uploads li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.status-tooltip p {
  margin: 0.32rem 0;
  display: flex;
  align-items: center;
  gap: 0.44rem;
  font-size: 0.82rem;
  color: var(--ink);
}

.status-help-head:hover .status-tooltip,
.status-help-head:focus-within .status-tooltip {
  display: block;
}

.queue-column {
  border: 1px solid #edf1f6;
  border-radius: 14px;
  padding: 0.65rem;
  background: #fff;
}

.queue-column h4 {
  font-size: 0.86rem;
  margin-bottom: 0.45rem;
}

.queue-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.queue-column li {
  border: 1px solid #edf1f6;
  border-radius: 12px;
  padding: 0.42rem;
  background: #fff;
  font-size: 0.82rem;
}

.kpi-row {
  display: grid;
  gap: 0.55rem;
}

.kpi-row article {
  border: 1px solid #edf1f6;
  border-radius: 14px;
  padding: 0.62rem;
  background: #fff;
}

.kpi-row h4 {
  margin-bottom: 0.34rem;
  font-size: 0.88rem;
}

.kpi-row p {
  margin: 0.16rem 0;
  font-size: 0.86rem;
}

.alert {
  color: var(--danger);
  font-weight: 700;
}

.portal-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.55rem;
  z-index: 20;
  width: min(420px, calc(100vw - 1.5rem));
  pointer-events: none;
}

.portal-toast {
  border: 1px solid #e3e9f0;
  border-left-width: 5px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(18, 32, 35, 0.14);
  padding: 0.76rem 0.86rem;
  font-size: 0.86rem;
  line-height: 1.4;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 220ms ease, transform 220ms ease;
}

.portal-toast.success {
  border-left-color: var(--good);
}

.portal-toast.warn {
  border-left-color: var(--warn);
}

.portal-toast.error {
  border-left-color: var(--danger);
}

.portal-toast.info {
  border-left-color: var(--accent);
}

.portal-toast.hiding {
  opacity: 0;
  transform: translateY(8px);
}

@keyframes pulseFocus {
  0% {
    transform: translateY(6px);
    opacity: 0.88;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .quick-panel {
    position: static;
  }
}

@media (max-width: 980px) {
  .module-grid.two,
  .queue-grid {
    grid-template-columns: 1fr;
  }

  .module {
    padding: 0.85rem;
  }

  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-day {
    min-height: 56px;
  }
}

@media (max-width: 780px) {
  .orb {
    display: none;
  }

  .shell-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    width: 96vw;
    padding: 0.85rem;
    border-radius: 12px;
  }

  .header-links {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .header-links a {
    flex: 0 0 auto;
    font-size: 0.86rem;
    padding: 0.4rem 0.7rem;
  }

  .status-chip {
    align-self: flex-start;
  }

  .module-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .module {
    padding: 0.8rem;
  }

  .card {
    padding: 0.75rem;
  }

  .hint {
    font-size: 0.77rem;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form > * {
    min-width: 0;
    width: 100%;
  }

  .integration-list li {
    flex-direction: column;
    align-items: stretch;
  }

  .module-grid.two,
  .queue-grid {
    grid-template-columns: 1fr;
  }

  .employee-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
}

@media (max-width: 560px) {
  .layout {
    width: 96vw;
    gap: 0.75rem;
  }

  .quick-panel {
    padding: 0.75rem;
  }

  .dashboard-kpis {
    grid-template-columns: 1fr;
  }

  .calendar-nav {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-title {
    min-width: 0;
    flex: 1;
  }

  .calendar-day {
    min-height: 54px;
    padding: 0.28rem;
  }

  .calendar-day-number {
    font-size: 0.76rem;
  }

  .stats-grid {
    gap: 0.5rem;
  }

  .client-status-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.1rem;
  }

  h3 {
    font-size: 0.95rem;
  }

  .pill {
    font-size: 0.73rem;
  }

  .card p {
    font-size: 0.86rem;
  }

  input,
  select,
  textarea {
    padding: 0.66rem 0.62rem;
  }

  .btn {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap table {
    min-width: 0;
    width: 100%;
    display: block;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 0.55rem;
  }

  .table-wrap tr {
    display: block;
    border: 1px solid #e5ece7;
    border-radius: 10px;
    background: #fff;
    padding: 0.38rem 0.55rem;
  }

  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.55rem;
    border: 0;
    border-bottom: 1px dashed #eef2ee;
    white-space: normal;
    padding: 0.36rem 0;
    font-size: 0.82rem;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    flex: 0 0 40%;
    font-weight: 700;
    color: #27454b;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
  }

  .portal-toast-host {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    bottom: 0.75rem;
  }

  th,
  td {
    padding: 0.45rem 0.28rem;
    font-size: 0.82rem;
  }
}
