:root {
  --bg: #000000;
  --bg-soft: #050505;
  --panel: rgba(4, 4, 4, 0.96);
  --panel-2: rgba(10, 10, 10, 0.98);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f5fb;
  --muted: #a1abc4;
  --orange: #ff6b00;
  --orange-soft: rgba(255, 107, 0, 0.14);
  --silver: #d4d5da;
  --green: #2bc47a;
  --yellow: #f3b53f;
  --red: #ef5b5b;
  --blue: #4d8bff;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 107, 0, 0.12), transparent 0 18%),
    radial-gradient(circle at 82% 12%, rgba(255, 107, 0, 0.05), transparent 0 14%),
    linear-gradient(180deg, #000000, #020202 52%, #000000);
  color: var(--text);
  color-scheme: dark;
}

body {
  padding: 16px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top center, rgba(255, 107, 0, 0.06), transparent 0 28%);
  opacity: 0.9;
}

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

button {
  cursor: pointer;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(circle, rgba(255,255,255,0.4) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  mix-blend-mode: soft-light;
}

.hidden {
  display: none !important;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 2.4vw, 2.4rem);
}

h3,
h4 {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--orange);
}

.small-text {
  color: var(--muted);
  font-size: 0.92rem;
}

.no-margin {
  margin: 0;
}

.auth-shell,
.app-shell {
  position: relative;
  z-index: 1;
}

.auth-shell {
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(320px, 540px);
  justify-content: center;
  gap: 18px;
  align-items: stretch;
}

.auth-card,
.sidebar,
.main-content,
.modal-card {
  background: linear-gradient(180deg, rgba(2, 2, 2, 0.98), rgba(8, 8, 8, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 30px;
}

.auth-card {
  padding: 28px;
}

.auth-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: center;
}

.auth-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  justify-content: center;
}

.brand-block {
  padding: 18px 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
}

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.8;
}

.brand-zia {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  color: var(--silver);
  position: relative;
}

.brand-zia::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--orange);
  left: 52%;
  top: 7px;
  box-shadow: 0 0 0 7px rgba(255, 107, 0, 0.1);
}

.brand-lab {
  margin-top: 12px;
  margin-left: auto;
  font-size: 1.7rem;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--orange);
}

.brand-subtitle {
  margin: 16px 0 0;
  color: var(--muted);
}

.auth-tabs,
.segmented {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.auth-tab,
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 14px;
  border-radius: 12px;
  transition: 0.18s ease;
}

.auth-tab.active,
.segmented button.active,
.auth-tab:hover,
.segmented button:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.auth-view {
  display: none;
}

.auth-view.active {
  display: grid;
}

.stack-form,
.form-grid {
  display: grid;
  gap: 16px;
}

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

.full-row {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.86rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(255, 107, 0, 0.52);
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.12);
}

.checkbox-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.015);
}

.checkbox-field input {
  width: auto;
  margin: 0;
  accent-color: var(--orange);
}

.hint-card {
  padding: 15px 16px;
  border: 1px dashed rgba(255, 107, 0, 0.34);
  background: rgba(255, 107, 0, 0.06);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.no-top {
  margin-top: 0;
}

code {
  color: var(--text);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.text-button,
.close-button {
  border-radius: 16px;
  border: 1px solid transparent;
  padding: 12px 16px;
  transition: 0.18s ease;
}

.primary-button,
.secondary-button {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
  color: var(--text);
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(180deg, #ff7b1f, #ff6b00);
  color: white;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.02);
}

.primary-button {
  background: linear-gradient(180deg, #ff7b1f, #ff6b00);
  color: white;
  font-weight: 700;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(255, 107, 0, 0.22);
}

.ghost-button,
.text-button,
.close-button {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
  color: var(--text);
}

.text-button,
.close-button {
  padding: 10px 12px;
}

.ghost-button:hover,
.text-button:hover,
.close-button:hover {
  background: rgba(255, 255, 255, 0.03);
}

.danger-button {
  background: rgba(239, 91, 91, 0.12);
  color: #ffc2c2;
  border-color: rgba(239, 91, 91, 0.3);
}

.app-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: calc(100vh - 32px);
}

.sidebar,
.main-content {
  padding: 22px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 14px 16px;
  border-radius: 16px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
  color: var(--text);
}

.sidebar-panel,
.panel {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.sidebar-panel {
  padding: 16px;
}

.mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.topbar,
.toolbar,
.panel-header,
.modal-header,
.modal-footer,
.topbar-actions,
.toolbar-filters,
.toolbar-actions,
.footer-actions-right,
.table-actions,
.inline-actions,
.client-card-header,
.task-card-header,
.task-meta-row,
.calendar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.toolbar {
  align-items: end;
}

.compact input,
.compact select {
  min-width: 160px;
}

.search-field input {
  min-width: 260px;
}

.panel {
  padding: 18px;
}

.panel-grid,
.dashboard-grid,
.stats-grid,
.clients-grid,
.admin-grid,
.profile-grid {
  display: grid;
  gap: 16px;
}

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

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


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

.full-span {
  grid-column: 1 / -1;
}

.small-value {
  font-size: 1rem;
}

.activity-feed {
  display: grid;
  gap: 12px;
}

.activity-item,
.remote-user-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
  border-radius: 18px;
}

.activity-item {
  padding: 14px;
}

.activity-item p {
  margin: 6px 0 6px;
}

.activity-top,
.remote-user-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.remote-user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.remote-user-card {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.remote-user-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.remote-user-metrics > div {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  display: grid;
  gap: 4px;
}

.remote-user-metrics strong {
  font-size: 1rem;
}

.remote-user-metrics span,
.remote-copy-block p,
.activity-item .small-text {
  color: var(--muted);
}

.remote-copy-block {
  display: grid;
  gap: 6px;
}

.remote-copy-block p {
  margin: 0;
}

.work-available {
  border-color: rgba(43, 196, 122, 0.3);
  background: rgba(43, 196, 122, 0.12);
}

.work-focus {
  border-color: rgba(77, 139, 255, 0.32);
  background: rgba(77, 139, 255, 0.12);
}

.work-meeting {
  border-color: rgba(243, 181, 63, 0.32);
  background: rgba(243, 181, 63, 0.12);
}

.work-break {
  border-color: rgba(168, 112, 255, 0.32);
  background: rgba(168, 112, 255, 0.12);
}

.work-offline {
  border-color: rgba(124, 140, 160, 0.28);
  background: rgba(124, 140, 160, 0.12);
}

.stat-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.008));
  border: 1px solid var(--line);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0 0;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 14px;
  overflow: auto;
  padding-bottom: 4px;
}

.board-column {
  min-height: 300px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.column-header,
.column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 0 0 6px rgba(255, 107, 0, 0.1);
}

.count-pill,
.badge,
.role-pill,
.channel-pill,
.task-chip {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.76rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge.high,
.priority-high {
  border-color: rgba(239, 91, 91, 0.26);
  background: rgba(239, 91, 91, 0.12);
}

.badge.medium {
  border-color: rgba(243, 181, 63, 0.24);
  background: rgba(243, 181, 63, 0.1);
}

.badge.low {
  border-color: rgba(43, 196, 122, 0.24);
  background: rgba(43, 196, 122, 0.1);
}

.task-card,
.client-card,
.calendar-day,
.user-row,
.email-log-card,
.list-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  border-radius: 18px;
}

.task-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.task-title,
.client-name {
  margin: 0;
  font-size: 1rem;
}

.task-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.tags-row,
.channels-row,
.attachment-list,
.comment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.table-subtext {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 6px;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
}

.calendar-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  min-width: 760px;
}

.calendar-weekday {
  padding: 0 4px 4px;
}

.calendar-day {
  min-height: 120px;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.calendar-day.muted {
  opacity: 0.52;
}

.calendar-item {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 107, 0, 0.12);
  border: 1px solid rgba(255, 107, 0, 0.2);
  font-size: 0.82rem;
}

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

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


.checkbox-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}


.client-card,
.user-row,
.email-log-card,
.list-card {
  padding: 16px;
}

.user-row {
  display: grid;
  gap: 12px;
}

.email-log-card p {
  margin-bottom: 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,107,0,0.7), rgba(77,139,255,0.8));
}

.inner-panel {
  padding: 16px;
}

.compact-head {
  margin-bottom: 12px;
}

.attachment-upload-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.attachment-item,
.comment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 30;
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
}

.modal-large {
  width: min(980px, 100%);
}

.close-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 40;
}

.toast {
  min-width: 280px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(4, 4, 4, 0.98);
  box-shadow: var(--shadow);
}

.toast strong {
  display: block;
  margin-bottom: 6px;
}

.drag-over {
  border-color: rgba(255, 107, 0, 0.5);
  background: rgba(255, 107, 0, 0.08);
}

.link-button {
  color: #ffb27f;
  text-decoration: none;
}

.link-button:hover {
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .auth-shell,
  .app-shell,
  .dashboard-grid,
  .stats-grid,
  .clients-grid,
  .admin-grid,
  .profile-grid,
  .remote-user-grid {
    grid-template-columns: 1fr;
  }

  .compact-grid,
  .remote-user-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

@media (max-width: 860px) {
  html {
    scroll-behavior: smooth;
  }

  body {
    padding: 8px;
  }

  .auth-shell {
    min-height: auto;
    gap: 12px;
  }

  .auth-card,
  .sidebar,
  .main-content,
  .modal-card {
    border-radius: 24px;
  }

  .brand-zia {
    font-size: 3.2rem;
  }

  .brand-lab {
    font-size: 1.35rem;
    letter-spacing: 0.12em;
  }

  .app-shell {
    gap: 12px;
    min-height: auto;
  }

  .sidebar {
    order: 0;
    padding: 14px;
    gap: 14px;
  }

  .sidebar .brand-block {
    padding: 14px;
  }

  .sidebar-panel {
    padding: 14px;
  }

  .nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar,
  .board-grid::-webkit-scrollbar,
  .calendar-scroll::-webkit-scrollbar,
  .table-wrap::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 12px 14px;
  }

  .main-content {
    padding: 14px;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 8px;
    z-index: 8;
    padding: 0 0 4px;
    backdrop-filter: blur(12px);
  }

  .topbar-actions,
  .toolbar-actions,
  .toolbar-filters {
    width: 100%;
  }

  .topbar-actions,
  .toolbar-filters,
  .toolbar-actions,
  .attachment-upload-row,
  .form-grid.two-columns {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions > *,
  .toolbar-actions > *,
  .attachment-upload-row > * {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1 1 0;
  }

  .search-field input,
  .compact input,
  .compact select {
    min-width: unset;
  }

  .dashboard-grid,
  .stats-grid,
  .clients-grid,
  .admin-grid,
  .profile-grid,
  .remote-user-grid,
  .compact-grid,
  .remote-user-metrics {
    grid-template-columns: 1fr;
  }

  .panel,
  .sidebar-panel,
  .client-card,
  .task-card,
  .user-row,
  .email-log-card,
  .list-card {
    padding: 14px;
  }

  .board-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(84vw, 1fr);
    grid-template-columns: unset;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
  }

  .board-column {
    min-height: 220px;
    scroll-snap-align: start;
  }

  .table-wrap {
    overflow: visible;
  }

  .stacked-table thead {
    display: none;
  }

  .stacked-table,
  .stacked-table tbody,
  .stacked-table tr,
  .stacked-table td {
    display: block;
    width: 100%;
  }

  .stacked-table tbody {
    display: grid;
    gap: 12px;
  }

  .stacked-table tr {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.015);
    padding: 12px;
  }

  .stacked-table td {
    border: 0;
    padding: 10px 0;
  }

  .stacked-table td + td {
    border-top: 1px solid var(--line);
  }

  .stacked-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .calendar-scroll {
    margin: 0 -4px;
    padding: 0 4px 8px;
  }

  .calendar-grid {
    min-width: 700px;
  }

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

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal-card,
  .modal-large {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    padding: 18px 14px 20px;
  }

  .toast-container {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}

.assignee-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.assignee-check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}

.assignee-check-item input {
  grid-row: span 2;
  width: 18px;
  height: 18px;
}

.assignee-check-item span {
  font-weight: 600;
}

.assignee-check-item small {
  color: var(--muted);
}

.board-grid.six-columns {
  grid-template-columns: repeat(6, minmax(260px, 1fr));
}

.stage-badge,
.inline-status-select {
  font-weight: 600;
}

.status-not_started {
  --stage-bg: rgba(124, 140, 160, 0.14);
  --stage-border: rgba(124, 140, 160, 0.3);
  --stage-text: #d4dbe4;
}

.status-in_progress {
  --stage-bg: rgba(77, 139, 255, 0.14);
  --stage-border: rgba(77, 139, 255, 0.32);
  --stage-text: #b8d3ff;
}

.status-review {
  --stage-bg: rgba(243, 181, 63, 0.14);
  --stage-border: rgba(243, 181, 63, 0.32);
  --stage-text: #ffe2a4;
}

.status-sent {
  --stage-bg: rgba(168, 112, 255, 0.14);
  --stage-border: rgba(168, 112, 255, 0.32);
  --stage-text: #e1ccff;
}

.status-approved {
  --stage-bg: rgba(43, 196, 122, 0.14);
  --stage-border: rgba(43, 196, 122, 0.32);
  --stage-text: #bdf4d3;
}

.status-scheduled {
  --stage-bg: rgba(255, 107, 0, 0.14);
  --stage-border: rgba(255, 107, 0, 0.3);
  --stage-text: #ffd2b0;
}

.stage-badge,
.inline-status-select,
.subtask-preview-item {
  background: var(--stage-bg, rgba(255,255,255,0.04));
  border-color: var(--stage-border, var(--line));
  color: var(--stage-text, var(--text));
}

.inline-status-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background-color: rgba(4, 4, 4, 0.98);
}

.inline-status-wrap {
  min-width: 0;
  flex: 1;
}

.task-card.status-not_started,
.task-card.status-in_progress,
.task-card.status-review,
.task-card.status-sent,
.task-card.status-approved,
.task-card.status-scheduled {
  border-color: var(--stage-border, var(--line));
}

.board-column.status-not_started,
.board-column.status-in_progress,
.board-column.status-review,
.board-column.status-sent,
.board-column.status-approved,
.board-column.status-scheduled {
  box-shadow: inset 0 1px 0 var(--stage-border, transparent);
}

.dot.status-not_started,
.dot.status-in_progress,
.dot.status-review,
.dot.status-sent,
.dot.status-approved,
.dot.status-scheduled {
  background: var(--stage-text, var(--orange));
  box-shadow: 0 0 0 6px var(--stage-bg, rgba(255,107,0,0.1));
}

.task-card-footer,
.task-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.subtask-preview-list,
.subtask-editor-list {
  display: grid;
  gap: 10px;
}

.subtask-preview-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 10px;
  font-size: 0.82rem;
}

.subtask-preview-item span {
  color: var(--muted);
}

.subtask-editor-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
}

.subtask-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
}

.small-button {
  padding: 8px 12px;
  min-height: auto;
}

.compact-empty {
  padding: 14px;
}

@media (max-width: 980px) {
  .assignee-check-grid,
  .subtask-editor-row {
    grid-template-columns: 1fr;
  }

  .task-card-footer,
  .task-meta-top {
    flex-direction: column;
    align-items: stretch;
  }
}


/* ===== Brand + responsive refresh overrides ===== */
:root {
  --sidebar-w: 286px;
  --auth-max: 560px;
  --panel-border: rgba(255,255,255,0.09);
}

.auth-shell {
  grid-template-columns: minmax(320px, var(--auth-max));
  justify-content: center;
  align-items: center;
}

.auth-card.auth-single {
  width: min(100%, var(--auth-max));
  padding: 28px;
}

.auth-header-block {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.auth-logo-frame {
  display: grid;
  place-items: center;
  width: 160px;
  min-height: 160px;
  padding: 14px;
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.brand-logo-auth-icon {
  width: 100%;
  max-width: 132px;
  height: auto;
  object-fit: contain;
}

.brand-logo-sidebar {
  width: 168px;
  max-width: 100%;
}

.auth-copy.compact {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.auth-copy.compact h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 0.98;
  margin: 0;
}

.auth-copy.compact .small-text {
  max-width: 38ch;
}

.auth-panels {
  display: grid;
  gap: 0;
}

.auth-view[hidden] {
  display: none !important;
}

.auth-view.active {
  display: grid;
}

.auth-tabs {
  width: 100%;
}

.auth-tab {
  flex: 1 1 0;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(4, 8, 14, 0.66);
  backdrop-filter: blur(4px);
}

.hidden-desktop {
  display: none !important;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.sidebar {
  position: relative;
}

.sidebar-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.topbar-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-content {
  background: linear-gradient(180deg, rgba(18,23,35,0.94), rgba(15,19,29,0.96));
}

.panel,
.sidebar-panel,
.client-card,
.task-card,
.email-log-card,
.activity-item,
.user-row,
.list-card,
.board-column,
.calendar-day,
.assignee-check-item,
.subtask-editor-row,
.subtask-preview-item,
.remote-user-card {
  border-color: var(--panel-border);
}

.task-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.03));
}

.task-title,
.client-name,
.panel-title {
  letter-spacing: -0.02em;
}

.data-table th,
.data-table td {
  padding: 16px 12px;
}

.table-actions {
  align-items: center;
}

.inline-status-select {
  min-width: 150px;
}

.subtask-editor-row {
  align-items: end;
}

.attachment-upload-row input[type="file"] {
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.015);
  color: var(--muted);
}

.remote-user-card .badge,
.activity-item,
.email-log-card {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.stats-grid.compact-grid .stat-card,
.profile-grid .stat-card {
  min-height: 112px;
}

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

  .clients-grid,
  .profile-grid,
  .dashboard-grid,
  .remote-user-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body {
    padding: 10px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 20px);
  }

  .sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(88vw, 320px);
    max-width: calc(100vw - 20px);
    z-index: 20;
    overflow-y: auto;
    transform: translateX(calc(-100% - 18px));
    transition: transform 0.22s ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .hidden-desktop {
    display: inline-grid !important;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    padding-bottom: 6px;
    background: linear-gradient(180deg, rgba(11,14,20,0.96), rgba(11,14,20,0.82));
  }

  .topbar-actions,
  .toolbar-filters,
  .toolbar-actions,
  .form-grid.two-columns,
  .attachment-upload-row,
  .modal-footer,
  .footer-actions-right {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .topbar-actions > *,
  .toolbar-actions > *,
  .footer-actions-right > * {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1 1 0;
  }

  .search-field input,
  .compact input,
  .compact select {
    min-width: unset;
  }

  .board-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(84vw, 1fr);
    grid-template-columns: unset;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
  }

  .board-column {
    scroll-snap-align: start;
  }

  .calendar-scroll,
  .board-grid,
  .table-wrap {
    scrollbar-width: none;
  }

  .calendar-scroll::-webkit-scrollbar,
  .board-grid::-webkit-scrollbar,
  .table-wrap::-webkit-scrollbar {
    display: none;
  }

  .table-wrap {
    overflow: visible;
  }

  .stacked-table thead {
    display: none;
  }

  .stacked-table,
  .stacked-table tbody,
  .stacked-table tr,
  .stacked-table td {
    display: block;
    width: 100%;
  }

  .stacked-table tbody {
    display: grid;
    gap: 12px;
  }

  .stacked-table tr {
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: rgba(255,255,255,0.015);
    padding: 12px;
  }

  .stacked-table td {
    border: 0;
    padding: 10px 0;
  }

  .stacked-table td + td {
    border-top: 1px solid var(--line);
  }

  .stacked-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal-card,
  .modal-large {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    padding: 18px 14px 22px;
  }
}

@media (max-width: 720px) {
  body {
    padding: 8px;
  }

  .auth-card.auth-single {
    padding: 22px 18px;
    border-radius: 26px;
  }

  .auth-logo-frame {
    width: 136px;
    min-height: 136px;
  }

  .brand-logo-auth-icon {
    max-width: 116px;
  }

  .topbar-actions,
  .toolbar-filters,
  .toolbar-actions,
  .compact-grid,
  .stats-grid,
  .clients-grid,
  .profile-grid,
  .admin-grid,
  .remote-user-grid,
  .remote-user-metrics,
  .assignee-check-grid,
  .subtask-editor-row {
    grid-template-columns: 1fr;
  }

  .task-card-footer,
  .task-meta-top,
  .client-card-header,
  .panel-header,
  .calendar-head,
  .topbar,
  .toolbar {
    align-items: stretch;
  }

  .inline-status-select {
    min-width: 0;
  }

  .toast-container {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .toast {
    width: 100%;
    min-width: 0;
  }
}


.sidebar,
.main-content,
.auth-card,
.modal-card {
  position: relative;
}

.sidebar::before,
.main-content::before,
.auth-card::before,
.modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.primary-button {
  box-shadow: 0 18px 40px rgba(255, 107, 0, 0.18);
}

.sidebar-panel,
.panel,
.task-card,
.client-card,
.calendar-day,
.user-row,
.email-log-card,
.list-card,
.remote-user-card,
.activity-item,
.board-column,
.stat-card {
  background-color: rgba(7, 7, 7, 0.96);
}

.progress-bar {
  background: rgba(255, 255, 255, 0.035);
}

.calendar-item {
  background: rgba(255, 107, 0, 0.1);
  border: 1px solid rgba(255, 107, 0, 0.24);
}

@media (max-width: 860px) {
  body {
    background: linear-gradient(180deg, #000000, #010101 58%, #000000);
  }
}


/* 2026-04 visual + permissions pass */
.main-content,
.sidebar,
.modal-card,
.panel,
.stat-card,
.client-card,
.remote-user-card,
.user-row,
.list-card,
.task-card,
.board-column,
.calendar-day,
.email-log-card,
.inner-panel,
.auth-card {
  background: linear-gradient(180deg, rgba(2, 2, 2, 0.985), rgba(4, 4, 4, 0.975));
}

.main-content {
  background-color: #000000;
}

.table-wrap,
.clients-grid,
.dashboard-grid,
.profile-grid,
.admin-grid {
  background: transparent;
}

.no-gap {
  gap: 10px;
}

.resource-url {
  overflow-wrap: anywhere;
}

.topbar,
.toolbar {
  background: transparent;
}

.progress-bar {
  background: rgba(255, 255, 255, 0.05);
}

.progress-bar span {
  background: linear-gradient(90deg, rgba(255,107,0,0.92), rgba(255,107,0,0.42));
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(255, 107, 0, 0.46);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.08);
}


body,
.app-shell,
.auth-shell {
  background-color: #000000;
}

.main-content,
.sidebar,
.panel,
.client-card,
.stat-card,
.remote-user-card,
.user-row,
.modal-card,
.task-card,
.board-column,
.calendar-day,
.email-log-card,
.inner-panel,
.brand-block,
.sidebar-panel {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  background-image: none;
  background-color: rgba(3, 3, 3, 0.985);
}

/* 2026-04 remote dashboard + tablet/mobile refinement */
.remote-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.92fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}

.panel-header-spread {
  align-items: flex-start;
}

.wrap-actions {
  flex-wrap: wrap;
}

.remote-actions {
  justify-content: flex-end;
}

.work-session-stats {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.remote-dashboard-panel .work-session-stats,
.remote-profile-panel .work-session-stats {
  margin-bottom: 18px;
}

.dashboard-work-stats .stat-card,
.profile-work-stats .stat-card,
.remote-metrics-grid .stat-card {
  min-height: 138px;
}

.work-session-stats .stat-value.small-value {
  font-size: clamp(1.2rem, 2vw, 2.35rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

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

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

.work-form-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.work-form-footer .primary-button {
  min-width: 220px;
}

.remote-control-panel textarea {
  min-height: 104px;
}

.remote-dashboard-panel textarea {
  min-height: 84px;
}

.remote-summary-panel .activity-feed {
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
}

.remote-summary-panel .activity-feed::-webkit-scrollbar {
  width: 8px;
}

.remote-summary-panel .activity-feed::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}

.remote-summary-compact .activity-feed {
  max-height: 392px;
}

.remote-activity-feed .activity-item {
  padding: 18px 20px;
}

.remote-control-panel .field span,
.remote-summary-panel .small-text {
  color: rgba(214, 220, 241, 0.82);
}

.remote-control-panel .badge,
.remote-summary-panel .badge {
  backdrop-filter: blur(10px);
}

.remote-dashboard-panel,
.remote-summary-panel {
  min-height: 100%;
}

.remote-summary-panel .panel-title,
.remote-control-panel .panel-title {
  margin-bottom: 2px;
}

@media (max-width: 1340px) {
  .remote-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .work-session-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .remote-metrics-grid.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .remote-dashboard-grid,
  .work-session-form-inline,
  .work-session-stats,
  .remote-metrics-grid,
  .stats-grid,
  .dashboard-grid,
  .profile-grid,
  .clients-grid,
  .admin-grid,
  .remote-user-grid {
    grid-template-columns: 1fr;
  }

  .remote-actions {
    width: 100%;
    justify-content: stretch;
  }

  .remote-actions > * {
    width: 100%;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .work-form-footer {
    justify-content: stretch;
  }

  .work-form-footer .primary-button {
    width: 100%;
    min-width: 0;
  }

  .work-session-stats .stat-value.small-value {
    font-size: clamp(1.2rem, 5vw, 2rem);
  }
}

@media (max-width: 720px) {
  .remote-summary-panel .activity-feed {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .remote-control-panel,
  .remote-summary-panel {
    padding: 18px 16px;
  }

  .remote-activity-feed .activity-item {
    padding: 16px 16px;
  }

  .dashboard-work-stats .stat-card,
  .profile-work-stats .stat-card,
  .remote-metrics-grid .stat-card {
    min-height: 108px;
  }
}


/* 2026-04-22 work status color system + remote visual polish */
.work-available {
  --stage-bg: rgba(43, 196, 122, 0.14);
  --stage-border: rgba(43, 196, 122, 0.34);
  --stage-text: #bdf4d3;
}

.work-focus {
  --stage-bg: rgba(77, 139, 255, 0.14);
  --stage-border: rgba(77, 139, 255, 0.34);
  --stage-text: #c6dcff;
}

.work-meeting {
  --stage-bg: rgba(243, 181, 63, 0.15);
  --stage-border: rgba(243, 181, 63, 0.34);
  --stage-text: #ffe1a2;
}

.work-break {
  --stage-bg: rgba(255, 107, 0, 0.15);
  --stage-border: rgba(255, 107, 0, 0.34);
  --stage-text: #ffd0ab;
}

.work-offline {
  --stage-bg: rgba(138, 149, 168, 0.12);
  --stage-border: rgba(138, 149, 168, 0.28);
  --stage-text: #d8dfea;
}

.work-status-card,
.work-status-select,
.remote-control-panel .badge,
.remote-summary-panel .badge {
  background: var(--stage-bg, rgba(255,255,255,0.04));
  border-color: var(--stage-border, var(--line));
  color: var(--stage-text, var(--text));
}

.work-status-card {
  box-shadow: inset 0 1px 0 var(--stage-border, transparent);
}

.work-status-card .small-text,
.work-status-card .stat-value {
  color: var(--stage-text, var(--text));
}

.work-status-select {
  border-width: 1px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02);
}

.work-status-select:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-border, rgba(255,255,255,0.18)) 45%, transparent);
}

.remote-control-panel .badge {
  font-weight: 700;
}

.work-session-stats {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
}

.dashboard-work-stats .stat-card,
.profile-work-stats .stat-card {
  min-height: 126px;
  padding: 18px 18px 16px;
}

.work-stat-card .small-text {
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.work-session-stats .stat-value.small-value {
  font-size: clamp(1rem, 1.45vw, 1.75rem);
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.work-time-card .stat-value.small-value {
  font-size: clamp(0.98rem, 1.18vw, 1.45rem);
}

.work-duration-card .stat-value.small-value,
.work-status-card .stat-value.small-value {
  font-size: clamp(1.18rem, 1.2vw, 1.55rem);
}

.remote-dashboard-panel .panel-header-spread {
  gap: 12px;
}

.remote-actions {
  gap: 10px;
  align-items: center;
}

.remote-actions .ghost-button {
  padding: 14px 20px;
}

.remote-metrics-grid .stat-card {
  min-height: 118px;
}

.remote-metrics-grid .stat-value {
  font-size: clamp(1.3rem, 1.7vw, 2rem);
}

.remote-summary-panel .activity-feed {
  gap: 12px;
}

.remote-activity-feed .activity-item {
  border-radius: 22px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 1460px) {
  .work-session-stats .stat-value.small-value {
    font-size: clamp(0.98rem, 1.2vw, 1.55rem);
  }
}

@media (max-width: 1200px) {
  .work-session-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-time-card .stat-value.small-value,
  .work-duration-card .stat-value.small-value,
  .work-status-card .stat-value.small-value {
    font-size: clamp(1.1rem, 1.7vw, 1.5rem);
  }
}

@media (max-width: 980px) {
  .remote-actions {
    width: 100%;
    justify-content: stretch;
  }

  .remote-actions > * {
    width: 100%;
  }

  .work-session-stats .stat-value.small-value {
    font-size: clamp(1rem, 4vw, 1.55rem);
  }
}

@media (max-width: 720px) {
  .dashboard-work-stats .stat-card,
  .profile-work-stats .stat-card,
  .remote-metrics-grid .stat-card {
    min-height: 104px;
    padding: 16px 15px;
  }

  .work-session-stats .stat-value.small-value {
    font-size: clamp(0.95rem, 5vw, 1.35rem);
  }

  .work-time-card .stat-value.small-value,
  .work-duration-card .stat-value.small-value,
  .work-status-card .stat-value.small-value {
    font-size: clamp(1rem, 5vw, 1.4rem);
  }
}


/* 2026-04-22 mobile/tablet stabilization pass */
body.drawer-open {
  overflow: hidden;
}

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

#workspace,
.panel,
.remote-dashboard-grid,
.dashboard-grid,
.stats-grid,
.clients-grid,
.profile-grid,
.admin-grid,
.board-grid,
.table-wrap {
  min-width: 0;
}

@media (min-width: 981px) and (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 258px minmax(0, 1fr);
    gap: 16px;
  }

  .sidebar {
    padding: 18px 16px;
  }

  .toolbar-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .remote-dashboard-grid,
  .dashboard-grid,
  .clients-grid,
  .profile-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .work-session-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body {
    padding: 0;
    overflow-x: hidden;
    background: #000;
  }

  .grain {
    opacity: 0.05;
  }

  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .sidebar-scrim {
    z-index: 70;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 330px);
    max-width: 330px;
    height: 100dvh;
    z-index: 80;
    padding: 16px 14px 18px;
    overflow-y: auto;
    border-radius: 0 24px 24px 0;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar .brand-block {
    padding: 14px;
  }

  .brand-logo-sidebar {
    width: 124px;
    display: block;
    margin: 0 auto 12px;
  }

  .brand-subtitle {
    font-size: 1rem;
    line-height: 1.35;
  }

  .sidebar-close {
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    border-radius: 18px;
  }

  .nav {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow: visible;
    gap: 8px;
    padding: 0;
  }

  .nav-item {
    width: 100%;
    min-width: 0;
    text-align: left;
    padding: 13px 14px;
  }

  .sidebar-panel {
    display: block;
    margin-top: 6px;
  }

  .main-content {
    min-height: 100dvh;
    padding: 16px 14px 24px;
    overflow: visible;
    border-radius: 0;
    background: #000;
    box-shadow: none;
  }

  .main-content::before {
    display: none;
  }

  .topbar {
    position: relative;
    top: auto;
    z-index: 5;
    padding: 0;
    margin-bottom: 14px;
    gap: 12px;
    background: transparent;
    align-items: flex-start;
  }

  .topbar-title-group {
    width: 100%;
    align-items: center;
    gap: 12px;
  }

  .topbar-title-group h1 {
    font-size: clamp(2rem, 9vw, 2.7rem);
    line-height: 1.02;
  }

  .mobile-menu-button {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 20px;
    font-size: 1.45rem;
    padding: 0;
  }

  .topbar-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }

  .topbar-actions > * {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
  }

  #logoutButton {
    grid-column: 1 / -1;
  }

  .toolbar {
    gap: 12px;
    margin-bottom: 14px;
  }

  .toolbar-filters,
  .toolbar-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
    gap: 12px;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1 1 0;
    min-height: 48px;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }

  .search-field input,
  .compact input,
  .compact select {
    min-width: 0;
  }

  .remote-dashboard-grid,
  .dashboard-grid,
  .stats-grid,
  .clients-grid,
  .profile-grid,
  .admin-grid,
  .remote-user-grid,
  .remote-metrics-grid,
  .work-session-form-inline,
  .work-session-stats {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .panel,
  .sidebar-panel,
  .client-card,
  .task-card,
  .user-row,
  .email-log-card,
  .list-card,
  .board-column,
  .stat-card,
  .remote-user-card,
  .activity-item {
    padding: 16px !important;
    border-radius: 20px;
  }

  .remote-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    justify-content: stretch;
  }

  .remote-actions .badge {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .remote-actions > button {
    width: 100%;
    min-height: 52px;
  }

  .work-session-stats .stat-card {
    min-height: auto;
    padding: 16px !important;
  }

  .work-session-stats .stat-value.small-value {
    font-size: clamp(1.06rem, 4.4vw, 1.55rem) !important;
    line-height: 1.15;
  }

  .work-session-form-inline .field-span-2 {
    grid-column: auto;
  }

  .work-form-footer {
    justify-content: stretch;
  }

  .work-form-footer .primary-button {
    width: 100%;
    min-width: 0;
    min-height: 54px;
  }

  .activity-feed,
  .remote-summary-panel .activity-feed {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0;
  }

  .remote-activity-feed .activity-item {
    padding: 16px !important;
  }

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

  .data-table {
    min-width: 680px;
  }

  .board-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(88vw, 1fr);
  }

  .calendar-grid {
    min-width: 680px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal-card,
  .modal-large {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding: 18px 14px 20px;
  }

  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .toast {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .main-content {
    padding: 14px 12px 22px;
  }

  .sidebar {
    width: calc(100vw - 28px);
    max-width: none;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  #logoutButton {
    grid-column: auto;
  }

  .topbar-actions > * {
    min-height: 50px;
    padding: 14px;
  }

  .topbar-title-group h1 {
    font-size: clamp(1.86rem, 10vw, 2.45rem);
  }

  .eyebrow {
    font-size: 0.8rem;
  }

  .remote-actions {
    grid-template-columns: 1fr;
  }

  .remote-actions .badge {
    grid-column: auto;
  }

  .work-session-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .work-session-stats .stat-value.small-value {
    font-size: clamp(1rem, 5vw, 1.32rem) !important;
  }

  .remote-metrics-grid .stat-card,
  .dashboard-work-stats .stat-card {
    min-height: 100px;
  }
}

@media (max-width: 560px) {
  .work-session-stats {
    grid-template-columns: 1fr !important;
  }

  .panel,
  .sidebar-panel,
  .client-card,
  .task-card,
  .stat-card,
  .activity-item,
  .remote-user-card {
    padding: 14px !important;
  }

  .board-grid {
    grid-auto-columns: minmax(92vw, 1fr);
  }
}
