

/* Mobile usability pass: instant feedback, no accidental zoom, tighter cards. */






@keyframes viewPulse {
  from { box-shadow: inset 0 0 0 0 rgba(40, 208, 189, 0); }
  to { box-shadow: inset 0 0 0 9999px rgba(40, 208, 189, .035); }
}

@media (max-width: 760px) {
  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  .toolbar {
    gap: 8px;
  }

  

  

  

  

  

  

  

  

  #production .event-main-cell p {
    -webkit-line-clamp: 2;
  }

  

  

  

  

  

  

  
}

/* Integraciones + historial técnico */
.integration-detector-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(40, 208, 189, .22);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(40, 208, 189, .08), transparent 38%),
    color-mix(in srgb, var(--surface) 92%, transparent);
}

.integration-detector-head,
.detector-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.integration-detector-head h3 {
  margin: 0 0 3px;
}

.integration-detector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
}

.integration-detector-meta span,
.console-pill {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.console-pill {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.console-pill.ok {
  color: #0b6a59;
  border-color: rgba(40, 208, 189, .45);
  background: rgba(40, 208, 189, .14);
}

.console-pill.off {
  color: var(--muted);
}

.integration-detector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.integration-detector-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 12px;
  background: rgba(10, 16, 22, .03);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.integration-detector-card.ok {
  border-left-color: #28d0bd;
}

.integration-detector-card.hot {
  border-left-color: #f59e0b;
}

.integration-detector-card strong {
  font-family: inherit;
  font-size: 12px;
}

.integration-detector-card .detector-topline span {
  color: #28d0bd;
  font-size: 12px;
  font-weight: 900;
}

.integration-detector-card code,
.integration-detector-card p,
.integration-detector-card small {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}











.production-mail-time strong {
  color: #d7e2ee;
  font-size: 10px;
}













.production-mail-card strong {
  color: #f8fafc;
  font-size: 12px;
}

.production-mail-card p,
.production-mail-card .muted {
  margin: 0;
  color: #9fb0c4;
  font-size: 11px;
  line-height: 1.25;
}

.production-mail-card .pill {
  min-height: 22px;
  padding: 2px 8px;
  font-family: var(--font);
  font-size: 10px;
}

.production-mail-card .chip-row {
  gap: 4px;
}

.production-mail-card .chip-row span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(40, 208, 189, .11);
  color: #8df5e8;
  font-size: 10px;
}

.production-mail-card .actions {
  gap: 5px;
  margin-top: 2px;
}

.production-mail-card .actions button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}



.dark-mode .integration-detector-panel,
.dark-mode .integration-detector-card {
  background-color: rgba(12, 18, 26, .76);
}

@media (max-width: 720px) {
  .integration-detector-head {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-detector-grid {
    grid-template-columns: 1fr;
  }

  .production-timeline {
    --timeline-axis: 12px;
    max-height: 58vh;
    padding: 10px;
  }

  .production-mail {
    grid-template-columns: 1fr;
    gap: 5px;
    padding-left: 20px;
  }

  .production-mail-time {
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
  }

  .production-mail-time span {
    justify-self: start;
  }
}

@media (max-width: 620px) {
  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  


}

/* Mobile usability final overrides. This lives at the end so older mobile rules cannot win. */
button.is-action-pending {
  position: relative;
  transform: translateY(1px) scale(.985);
  filter: saturate(1.1) brightness(.96);
}

button.is-action-pending::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 999px;
  background: currentColor;
  animation: procPulse .9s ease-in-out infinite;
}

.view.is-action-pending-view {
  animation: viewPulse .9s ease-in-out infinite alternate;
}

@keyframes viewPulse {
  from { box-shadow: inset 0 0 0 0 rgba(40, 208, 189, 0); }
  to { box-shadow: inset 0 0 0 9999px rgba(40, 208, 189, .035); }
}

@media (max-width: 760px) {
    html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  

  

    button,
  .button-link {
    min-height: 38px;
    border-radius: 10px;
    padding: 0 11px;
    font-size: 13px;
  }

    main {
    width: 100%;
    max-width: 100vw;
    padding-inline: 10px;
  }

    .brand {
    padding: 18px 12px 14px;
  }

    .brand h1 {
    font-size: clamp(30px, 11vw, 44px);
    line-height: .94;
    text-align: center;
  }

    .workflow-nav {
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

    .workflow-nav::-webkit-scrollbar,
  .utility-nav::-webkit-scrollbar,
  .edit-bar::-webkit-scrollbar {
    display: none;
  }

    .workflow-nav .nav {
    flex: 0 0 min(31vw, 128px);
    min-height: 58px;
    padding: 8px;
    border-radius: 26px;
    font-size: 12px;
  }

    .utility-nav {
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
  }

    .utility-nav .nav {
    flex: 0 0 48px;
    width: 48px;
    min-height: 48px;
    border-radius: 999px;
  }

    header {
    padding: 8px 8px 0;
  }

    .edit-bar {
    justify-content: flex-start;
    width: 100%;
    max-width: calc(100vw - 16px);
    padding: 8px;
    overflow-x: auto;
    border-radius: 24px;
  }

    .edit-bar button {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }

    .edit-bar button span {
    display: none;
  }

  .toolbar,
  .actions {
    gap: 8px;
  }

    .toolbar h2,
  .toolbar > h2 {
    font-size: 28px;
    line-height: 1;
  }

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

    .view,
  .row {
    min-width: 0;
    max-width: 100%;
  }

    .month-section {
    margin-top: 14px;
  }

    .month-head h3 {
    font-size: 30px;
  }

    #production .row.production,
  #events .row.events,
  #postproduction .post-event-card,
  .expenses-row,
  .task-card {
    border-radius: 14px;
  }

  body #production .row.production {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
      "date main"
      "date status"
      "actions actions";
    padding: 9px;
  }

  body #production .row.production > .production-row-actions {
    grid-area: actions;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  body #production .event-main-cell p {
    -webkit-line-clamp: 2;
  }

    .floating-upload {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 96px);
    min-height: 52px;
    border-radius: 999px;
  }

  

  

  

  

    .grid-form {
    grid-template-columns: 1fr;
  }

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

/* Override final: timeline de producción en modo consola compacta */
body .production-timeline {
  --timeline-axis: 22px;
  --timeline-dot-size: 9px;
  --timeline-dot-border: 2px;
  gap: 6px;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(40, 208, 189, .18);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(40, 208, 189, .12), transparent 26%),
    #081018;
  color: #d7e2ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body .production-timeline::before {
  top: 18px;
  bottom: 18px;
  background: linear-gradient(#28d0bd, rgba(139, 92, 246, .7), rgba(245, 158, 11, .85));
  opacity: .55;
}

body .production-mail {
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  padding-left: 0;
}

body .production-mail::before {
  top: 13px;
  border-color: #081018;
}

body .production-mail-time {
  padding-top: 4px;
  color: #8ea0b6;
  font-size: 10px;
  line-height: 1.2;
}

body .production-mail-time strong {
  color: #d7e2ee;
  font-size: 10px;
}

body .production-mail-time span {
  padding: 1px 6px;
  background: rgba(255, 255, 255, .06);
  color: #9aaabd;
}

body .production-mail-card {
  gap: 5px;
  padding: 8px 10px;
  border-color: rgba(148, 163, 184, .22);
  border-radius: 10px;
  background: rgba(15, 23, 32, .88);
  box-shadow: none;
}

body .production-mail.outgoing .production-mail-card {
  border-color: rgba(40, 208, 189, .35);
  background: rgba(5, 56, 54, .35);
}

body .production-mail.needs-attention .production-mail-card {
  border-color: rgba(245, 158, 11, .46);
  background: rgba(68, 43, 10, .42);
}

body .production-mail.waiting-response .production-mail-card {
  border-color: rgba(139, 92, 246, .5);
  background: rgba(39, 24, 74, .42);
}

body .production-mail-head {
  gap: 8px;
}

body .production-mail-card strong {
  color: #f8fafc;
  font-size: 12px;
}

body .production-mail-card p,
body .production-mail-card .muted {
  margin: 0;
  color: #9fb0c4;
  font-size: 11px;
  line-height: 1.25;
}

body .production-mail-card .pill {
  min-height: 22px;
  padding: 2px 8px;
  font-family: var(--font);
  font-size: 10px;
}

body .production-mail-card .chip-row span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(40, 208, 189, .11);
  color: #8df5e8;
  font-size: 10px;
}

body .production-mail-card .actions {
  gap: 5px;
  margin-top: 2px;
}

body .production-mail-card .actions button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

body .mail-body-preview {
  max-height: 66px;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background: rgba(2, 6, 12, .36);
  color: #b7c7d8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.3;
}

@media (max-width: 720px) {
  body .production-timeline {
    --timeline-axis: 12px;
    max-height: 58vh;
    padding: 10px;
  }

  body .production-mail {
    grid-template-columns: 1fr;
    gap: 5px;
    padding-left: 20px;
  }

  body .production-mail-time {
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
  }
}

@media (max-width: 760px) {
  body .post-event-card {
    max-width: 100%;
    overflow: hidden;
    padding: 10px;
  }

  body .post-event-head {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  body .post-event-head > .pill,
  body .post-event-head > .actions {
    grid-column: 1 / -1;
    justify-self: start;
  }

  body .post-event-head .event-main-cell {
    min-width: 0;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
  }

  body .post-event-head .event-main-cell img {
    width: 48px;
    height: 48px;
  }

  body .post-event-head .event-main-cell strong,
  body .post-event-head .event-main-cell p {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body .post-task-list {
    padding-left: 0;
    gap: 10px;
  }

  body .post-task-list::before {
    display: none;
  }

  body .post-task-card {
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas:
      "dot main"
      "dot pill"
      "label label"
      "actions actions";
    gap: 7px 10px;
    align-items: start;
    padding: 10px;
    overflow: hidden;
  }

  body .post-task-dot {
    position: static;
    grid-area: dot;
    width: 32px;
    height: 32px;
  }

  body .post-task-main {
    grid-area: main;
    min-width: 0;
  }

  body .post-task-main strong,
  body .post-task-main p {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body .post-task-card > .pill {
    grid-area: pill;
    justify-self: start;
    max-width: 100%;
  }

  body .post-task-label {
    grid-area: label;
    display: block;
    max-width: 100%;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
  }

  body .post-task-card > .actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
  }

  body .post-task-card > .actions .compact-action {
    min-height: 36px;
  }

  body .post-task-card > .actions .icon-only-action {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
  }

  body .post-task-card > .actions .compact-action:not(.icon-only-action) {
    flex: 0 1 auto;
    max-width: 100%;
  }

  body .action-menu > div,
  body .action-menu.drop-up > div,
  body .calendar-event-actions .action-menu > div {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(60dvh, 360px);
    overflow: auto;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
  }

  body .action-menu > div button {
    min-height: 42px;
    border-radius: 12px;
  }
}

@media (max-width: 760px) {
  .post-event-card {
    padding: 10px;
    overflow: hidden;
  }

  

  .post-event-head > .pill,
  .post-event-head > .actions {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .post-event-head .event-main-cell {
    min-width: 0;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
  }

  .post-event-head .event-main-cell img {
    width: 52px;
    height: 52px;
  }

  

  

  

  

  .post-task-main {
    grid-area: main;
    min-width: 0;
  }

  .post-task-main strong,
  .post-task-main p {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .post-task-card > .pill {
    grid-area: pill;
    justify-self: start;
    max-width: 100%;
  }

  .post-task-label {
    grid-area: label;
    display: block;
    max-width: 100%;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
  }

  

  .post-task-card > .actions .compact-action {
    min-height: 36px;
  }

  .post-task-card > .actions .icon-only-action {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
  }

  .post-task-card > .actions .compact-action:not(.icon-only-action) {
    flex: 0 1 auto;
    max-width: 100%;
  }

  .calendar-event-actions {
    overflow: visible;
  }

  .calendar-event-actions .action-menu,
  .calendar-event-actions .calendar-plus-menu {
    position: static;
  }

  .calendar-event-actions .action-menu > div,
  .action-menu > div {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(60dvh, 360px);
    overflow: auto;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
  }

  .action-menu.drop-up > div {
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  .action-menu > div button {
    min-height: 42px;
    border-radius: 12px;
  }
}

@media (max-width: 620px) {
  .toast-root {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: min(300px, calc(100vw - 20px));
  }

  .toast {
    padding: 8px 8px 8px 10px;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
  }

  .toast strong {
    -webkit-line-clamp: 2;
    font-size: 12px;
  }

  .toast span {
    font-size: 10px;
  }

  .toast button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  

  

  

  

  

  

  

  

  

  

  header {
    position: sticky;
    top: 0;
    z-index: 22;
    margin: 0 -8px 8px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px);
  }

  .header-actions {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding: 0 2px 1px;
    scrollbar-width: none;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-actions button {
    flex: 0 0 38px;
    width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 999px;
  }

  .view.is-working {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }

  .view.is-working::before {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 35;
    max-width: min(260px, calc(100vw - 20px));
    margin: 0;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 10px;
    box-shadow: 0 10px 24px rgba(16, 185, 129, .18);
  }

  .view.is-working > .panel:first-of-type,
  .view.is-working > .grid:first-child + .panel,
  .view.is-working > .settings-tabs + .panel {
    box-shadow: 0 0 0 1px rgba(16, 185, 129, .20), var(--shadow);
  }

  #production .panel {
    padding: 12px;
    border-radius: 12px;
  }

  #production .toolbar {
    gap: 8px;
    margin-bottom: 8px;
  }

  #production .toolbar h2 {
    font-size: 25px;
    line-height: 1;
  }

  #production .toolbar .actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  #production .toolbar .actions .muted {
    grid-column: 1 / -1;
    font-size: 14px;
    line-height: 1.28;
  }

  #production .toolbar .actions button {
    width: 100%;
    min-height: 40px;
  }

  #production .toolbar .actions button:first-of-type {
    color: var(--ink);
    background: var(--surface-soft);
  }

  #production .view-help {
    margin: 4px 0 12px;
  }

  #production .month-section {
    margin-top: 12px;
  }

  #production .month-head {
    margin-bottom: 8px;
  }

  #production .month-head h3 {
    font-size: 31px;
    line-height: 1;
  }

  #production .row.production {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "date main actions"
      ". status actions";
    gap: 8px 10px;
    padding: 10px;
    border-radius: 11px;
  }

  #production .row.production > .timeline-date {
    grid-area: date;
  }

  #production .row.production > .event-main-cell {
    grid-area: main;
    align-items: start;
    gap: 9px;
  }

  #production .row.production > .production-row-status {
    grid-area: status;
    justify-content: flex-start;
  }

  #production .row.production > .production-row-actions {
    grid-area: actions;
    align-self: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
  }

  #production .event-main-cell img,
  #production .event-logo,
  #production .client-logo {
    width: 42px;
    height: 42px;
    max-width: 42px;
    border-radius: 9px;
  }

  #production .event-main-cell strong {
    font-size: 17px;
    line-height: 1.1;
    letter-spacing: .02em;
  }

  #production .event-main-cell p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.25;
  }

  #production .timeline-date {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
  }

  #production .timeline-date span {
    font-size: 10px;
  }

  #production .timeline-date strong {
    width: 34px;
    min-width: 34px;
    height: 34px;
    font-size: 18px;
  }

  #production .production-row-actions .icon,
  #production .production-row-actions .attachment-action {
    width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 10px;
  }

  #production .production-row-actions .action-hint {
    max-width: 96px;
    min-height: 30px;
    padding: 0 8px;
    text-align: center;
    font-size: 11px;
    line-height: 1.05;
  }

  #production .production-row-status .pill {
    min-height: 26px;
    padding: 0 12px;
    font-size: 12px;
  }

  #production .row.production.is-production-ready {
    opacity: .58;
  }

  #production .row.production.is-production-ready:hover {
    opacity: .86;
  }
}

.dark-mode {
  color-scheme: dark;
  --bg: #0b0e12;
  --surface: #12171d;
  --surface-soft: #191f27;
  --ink: #f3f6f8;
  --muted: #aeb7c2;
  --line: #2b333d;
  --line-strong: #46515f;
  --accent: #28d0bd;
  --accent-ink: #041816;
  --accent-soft: rgba(40, 208, 189, .16);
  --blue-soft: rgba(112, 166, 255, .16);
  --blue-ink: #b7d4ff;
  --warn: #ffd38a;
  --warn-soft: rgba(255, 211, 138, .16);
  --danger: #ff8d86;
  --danger-soft: rgba(255, 141, 134, .15);
  --success: #5de3a3;
  --success-soft: rgba(93, 227, 163, .15);
  --shadow: 0 16px 42px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }





body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: 0; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: 0; }
h3 { font-size: 13px; line-height: 1.25; letter-spacing: 0; }

.auth-loading,
.auth-locked {
  display: block;
}

.auth-loading .sidebar,
.auth-loading main,
.auth-loading .login-screen,
.auth-locked .sidebar,
.auth-locked main {
  display: none;
}

.auth-loading::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg);
}

.app-hydrating .sidebar,
.app-hydrating main {
  visibility: hidden;
}

.app-hydrating::before {
  content: "EVENT CONTROL";
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 45%, rgba(40, 208, 189, .16), transparent 34%),
    var(--bg);
  font-size: clamp(22px, 7vw, 86px);
  font-weight: 900;
  letter-spacing: .14em;
  text-align: center;
  transform-origin: 50% 50%;
  will-change: transform, opacity, letter-spacing;
  animation: eventControlIntroZoom 1.18s cubic-bezier(.12, .82, .18, 1) forwards;
  pointer-events: none;
}

.dark-mode.app-hydrating::before {
  background:
    radial-gradient(circle at 50% 45%, rgba(40, 208, 189, .2), transparent 34%),
    var(--bg);
  color: var(--ink);
}

@keyframes eventControlIntroZoom {
  0% {
    opacity: 0;
    transform: scale(.12);
    filter: blur(2px);
    letter-spacing: .26em;
  }
  18% {
    opacity: 1;
    filter: blur(0);
  }
  62% {
    opacity: 1;
    transform: scale(1);
    letter-spacing: .14em;
  }
  100% {
    opacity: 0;
    transform: scale(9.5);
    filter: blur(0);
    letter-spacing: .02em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-hydrating::before {
    animation: eventControlIntroFade .16s ease-out forwards;
    transform: none;
    filter: none;
  }
}

@keyframes eventControlIntroFade {
  from { opacity: 1; }
  to { opacity: 0; }
}

.app-ready main,
.app-ready .sidebar {
  animation: appReadyFade .16s ease-out both;
}

@keyframes appReadyFade {
  from { opacity: .86; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .app-ready main,
  .app-ready .sidebar {
    animation: none;
  }
}

.login-screen { display: none; }

.auth-locked .login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(20, 27, 36, .10);
}

.login-card .mark { margin-bottom: 16px; }
.login-card h1 { margin: 0 0 8px; font-size: 30px; }
.login-card label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
.login-card input { width: 100%; }
.login-card label.login-trust-device { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.login-card label.login-trust-device input { width: auto; }

.toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: start;
  padding: 10px 10px 10px 12px;
  border: 1px solid #a8d9d2;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: #08433e;
  background: rgba(255,255,255,.98);
  box-shadow: 0 12px 30px rgba(20, 27, 36, .13);
  pointer-events: auto;
}

.toast span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.toast strong {
  grid-column: 1;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 13px;
  line-height: 1.28;
}

.toast button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
  background: #edf1f5;
}

.toast.success { border-color: #b6e4c8; border-left-color: var(--success); color: #17633a; }
.toast.error { border-color: #efb5ad; border-left-color: var(--danger); color: #7a1f17; }

.toast-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-actions small {
  min-width: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.toast .toast-actions button {
  grid-column: auto;
  grid-row: auto;
  width: auto;
  min-height: 30px;
  padding: 0 10px;
  color: var(--accent-ink);
  background: var(--accent);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 28;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: 104px auto;
  align-items: center;
  gap: 10px 14px;
  min-height: var(--topbar);
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(#0f1216 0 104px, #eef1f5 104px 100%);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(20, 27, 36, .06);
}

.brand {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 104px;
  padding: 0 20px;
  margin: 0 -20px;
  border: 0;
  color: #f8fafc;
  background: #0f1216;
  text-align: center;
}

.brand-home {
  justify-content: center;
  border-color: transparent;
}

.brand-home:hover {
  filter: none;
  background: #0f1216;
  box-shadow: none;
  transform: none;
}

.brand.nav.active {
  color: #f8fafc;
  background: #0f1216;
  border-color: transparent;
}

.brand.nav,
.brand.nav.active,
.brand.nav:hover,
.brand.nav.active:hover {
  color: #f8fafc;
  background: #0f1216;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 12px;
  color: var(--accent-ink);
  background:
    linear-gradient(135deg, var(--accent) 0 54%, color-mix(in srgb, var(--accent) 65%, #ffffff) 54% 100%);
  box-shadow: 0 12px 28px rgba(15, 118, 110, .18);
  font-weight: 950;
  letter-spacing: 0;
  overflow: hidden;
}

.app-mark::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  width: 15px;
  height: 20px;
  border: 3px solid currentColor;
  border-right: 0;
}

.app-mark::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 10px;
  width: 14px;
  height: 20px;
  border: 3px solid currentColor;
  border-left: 0;
}

.app-mark {
  font-size: 0;
}

.mark img {
  width: 100%;
  height: 100%;
  padding: 2px;
  object-fit: contain;
  background: var(--ink);
}

.brand .mark {
  border-color: rgba(255,255,255,.18);
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.brand .mark img {
  background: transparent;
}
.brand strong {
  display: block;
  line-height: 1.05;
  font-size: clamp(34px, 4.4vw, 64px);
  font-weight: 950;
  letter-spacing: .02em;
}

.brand small {
  display: block;
  margin-top: 8px;
  color: #b5beca;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 7px;
  padding: 0;
}

button,
.button-link {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button {
  color: var(--accent-ink);
  background: var(--accent);
}

button:disabled {
  cursor: default;
  opacity: .5;
}

button.is-busy {
  position: relative;
  padding-right: 34px;
}

button.is-busy::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 999px;
  background: currentColor;
  animation: procPulse .9s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes procPulse {
  0%, 100% { transform: scale(.55); opacity: .35; }
  50% { transform: scale(1); opacity: 1; }
}

.nav.is-working {
  position: relative;
  color: #064e3b;
  border-color: rgba(16, 185, 129, .45);
  background: rgba(209, 250, 229, .88);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .30);
  animation: workingGlow 1.55s ease-in-out infinite;
}

.nav.is-working::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .14);
}

.utility-nav .nav.is-working::after {
  right: 5px;
  top: 5px;
}

.view.is-working {
  position: relative;
  padding: 10px;
  margin: -10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(209, 250, 229, .38), rgba(240, 253, 250, .16));
  animation: workingViewPulse 1.8s ease-in-out infinite;
}

.view.is-working::before {
  content: var(--working-label, "Trabajando");
  position: sticky;
  top: 8px;
  justify-self: end;
  z-index: 8;
  width: max-content;
  max-width: min(360px, calc(100vw - 40px));
  margin-bottom: -42px;
  padding: 7px 12px;
  border: 1px solid rgba(16, 185, 129, .35);
  border-radius: 999px;
  color: #064e3b;
  background: rgba(209, 250, 229, .94);
  box-shadow: 0 14px 34px rgba(16, 185, 129, .18);
  font-size: 12px;
  font-weight: 950;
  pointer-events: none;
}

.view.is-working > .panel:first-of-type,
.view.is-working > .grid:first-child + .panel,
.view.is-working > .settings-tabs + .panel {
  border-color: rgba(16, 185, 129, .30);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, .08), var(--shadow);
}

@keyframes workingGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .18); }
  50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, .08); }
}

@keyframes workingViewPulse {
  0%, 100% { background-color: rgba(209, 250, 229, .16); }
  50% { background-color: rgba(209, 250, 229, .34); }
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: #eef2f6;
}

button:hover:not(:disabled),
.button-link:hover { filter: brightness(.98); }

.secondary { color: var(--ink); background: #eef2f6; }
.soft-action {
  color: #6b7280;
  background: #f1f4f7;
  border-color: #e3e8ef;
  opacity: .78;
}

.soft-action:hover {
  opacity: 1;
  background: #e9eef4;
}

.danger { color: #fff; background: var(--danger); }
.danger-text { color: var(--danger); }
.danger-icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efb5ad;
}

.danger-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.danger-icon:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}
.ghost { color: var(--accent); background: transparent; border-color: var(--line); }
.inline-link {
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: normal;
}

.inline-link:hover { filter: none; color: var(--accent-strong); }

.icon {
  width: 36px;
  padding: 0;
  color: var(--ink);
  background: #eef2f6;
  font-size: 20px;
}

.nav {
  width: auto;
  justify-content: center;
  min-height: 42px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  text-align: center;
  white-space: nowrap;
}

.workflow-nav {
  grid-column: 2;
  justify-content: center;
  min-width: 0;
}

.workflow-nav .nav {
  min-width: 132px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 900;
}

.workflow-nav .nav::before {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 950;
}

.workflow-nav .nav:nth-child(1)::before { content: "1"; }
.workflow-nav .nav:nth-child(2)::before { content: "2"; }
.workflow-nav .nav:nth-child(3)::before { content: "3"; }
.workflow-nav .nav:nth-child(4)::before { content: "4"; }

.workflow-nav .nav.active::before {
  color: var(--accent-ink);
  background: var(--accent);
}

.utility-nav {
  position: relative;
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.utility-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 2px;
  width: 220px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 24px 64px rgba(15, 23, 42, .24);
  backdrop-filter: blur(20px) saturate(1.3);
  transform-origin: calc(100% - 20px) -8px;
  animation: popover-in .16s ease-out;
}

.utility-menu.hidden {
  display: none;
}

.utility-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  text-align: left;
}

.utility-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.utility-menu-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

#utility-menu-toggle.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.utility-nav .nav {
  min-width: 0;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.utility-nav .icon-only {
  width: 42px;
  padding: 0;
}

.utility-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--accent-soft));
  filter: none;
}

.nav.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.nav.active.is-working,
.workflow-nav .nav.active.is-working,
.utility-nav .nav.active.is-working {
  color: #064e3b;
  border-color: rgba(16, 185, 129, .50);
  background: rgba(209, 250, 229, .92);
}

main {
  min-width: 0;
  width: 100%;
  padding: 22px 28px 48px;
}

header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.chrome-right header,
.chrome-right .header-actions {
  justify-content: flex-end;
}

.edit-bar {
  flex: 0 0 auto;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.edit-bar button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
}

.edit-bar button span {
  display: none;
}

.edit-bar svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.edit-popover {
  position: absolute;
  left: 0;
  top: 50px;
  z-index: 35;
  width: min(820px, calc(100vw - 48px));
  max-height: min(78vh, 720px);
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 30px 90px rgba(15, 23, 42, .26);
  backdrop-filter: blur(24px) saturate(1.3);
  transform-origin: 22px -8px;
  animation: popover-in .16s ease-out;
  overflow: auto;
}

.chrome-right .edit-popover {
  left: auto;
  right: 0;
  transform-origin: calc(100% - 22px) -8px;
}

.edit-popover.hidden {
  display: none;
}

@keyframes popover-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.edit-popover-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.edit-popover-head strong {
  font-size: 13px;
  font-weight: 950;
}

.edit-popover-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.edit-popover-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.edit-popover-options button,
.edit-popover-row {
  min-height: 54px;
  display: grid;
  gap: 3px;
  align-content: center;
  justify-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  text-align: left;
}

.edit-popover-options button.active {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
}

.edit-popover-options button span {
  color: currentColor;
  opacity: .68;
  font-size: 11px;
  font-weight: 750;
  white-space: normal;
}

.edit-popover-row {
  width: 100%;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
}

.edit-popover-row svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.edit-popover-section {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.edit-popover-section .technical-config-panel {
  margin: 0;
  padding: 10px;
  border-color: color-mix(in srgb, var(--line) 74%, transparent);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32);
}

.edit-popover-section .toolbar {
  align-items: start;
  margin-bottom: 8px;
}

.edit-popover-section .toolbar h2 {
  font-size: 14px;
}

.edit-popover-section .toolbar p {
  font-size: 11px;
  line-height: 1.25;
}

.edit-popover-section .grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.edit-popover-section .grid-form .span-2 {
  grid-column: span 2;
}

.edit-popover-section label {
  gap: 4px;
  font-size: 11px;
}

.edit-popover-section input,
.edit-popover-section select {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 13px;
}

.edit-popover-section textarea {
  min-height: 72px;
  padding: 7px 9px;
  font-size: 13px;
}

.field-help {
  display: block;
  margin: 2px 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

.check-row .field-help {
  margin: 2px 0 0;
}

.edit-popover-empty {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.edit-popover-empty p {
  margin-top: 4px;
  color: var(--muted);
}

.email-preview-sheet {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

.email-preview-meta {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.55;
}

.email-preview-meta strong {
  color: var(--ink);
}

.email-preview-body {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.email-preview-body p {
  margin: 0 0 14px;
}

.email-preview-footer img {
  display: block;
  max-width: 640px;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.mode-toggle.active,
.tech-config-button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.tech-config-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.tech-config-button svg {
  width: 18px;
  height: 18px;
}

.technical-config-panel {
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  border-style: dashed;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent-soft));
}

.technical-config-panel .toolbar {
  margin-bottom: 12px;
}

.technical-mode .view > .panel:first-child,
.technical-mode .view > .settings-tabs + .period-controls + .panel {
  box-shadow: var(--shadow);
}

.privacy-masked .amount,
.privacy-masked .metric strong,
.privacy-masked .tax-grid strong {
  letter-spacing: .04em;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.view { display: none; }
.view.active { display: grid; gap: 14px; }

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

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel { padding: 16px; }

.queue-progress {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 750;
}

.queue-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.queue-row {
  display: grid;
  grid-template-columns: 30px 90px minmax(180px, 1fr) 130px 100px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.queue-row span,
.queue-row em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stacked-list {
  display: grid;
  gap: 8px;
}

.mini-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.mini-row span,
.mini-row small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.card { padding: 16px; }

.metric span { font-size: 12px; }
.metric strong { display: block; margin-top: 9px; font-size: 24px; line-height: 1; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.compact-help {
  margin-top: -4px;
  margin-bottom: 8px;
  font-size: 13px;
}

.view-help {
  margin: -2px 0 12px;
}

.view-help summary {
  width: fit-content;
  cursor: pointer;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
  font-size: 11px;
  font-weight: 900;
  list-style: none;
}

.view-help summary::-webkit-details-marker {
  display: none;
}

.view-help summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  margin-right: 5px;
  color: var(--accent);
  font-weight: 950;
  text-align: center;
}

.view-help[open] summary {
  margin-bottom: 8px;
}

.view-help[open] summary::before {
  content: "−";
}

.view-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.view-help-grid div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
}

.view-help strong,
.view-help span {
  display: block;
  min-width: 0;
}

.view-help strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.view-help span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.expenses-panel .month-section {
  margin-top: 8px;
}

.toolbar > h2,
.toolbar > div:first-child {
  min-width: 0;
}

.segmented-control {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.segmented-control button.active {
  color: var(--accent-ink);
  background: var(--accent);
}

.toolbar-more,
.filter-more {
  display: contents;
}

.toolbar-more summary,
.filter-more summary {
  display: none;
}

.toolbar-more-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-more:not([open]) > .toolbar-more-menu {
  display: flex;
}

.filter-more:not([open]) > .expense-filter-bar {
  display: flex;
}

.events-calendar {
  display: grid;
  gap: 10px;
}

.calendar-pager {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.calendar-pager > div {
  display: grid;
  gap: 2px;
  text-align: center;
}

.calendar-pager strong {
  color: color-mix(in srgb, var(--muted) 68%, var(--ink));
  font-size: 26px;
  font-weight: 950;
  text-transform: capitalize;
}

.calendar-pager span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.calendar-month {
  display: grid;
  gap: 6px;
}

.calendar-month-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
}

.calendar-month-head h3 {
  color: color-mix(in srgb, var(--muted) 68%, var(--ink));
  font-size: 26px;
  font-weight: 950;
  text-transform: capitalize;
}

.calendar-month-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.calendar-weekdays {
  gap: 4px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.calendar-grid {
  gap: 4px;
}

.calendar-day {
  display: grid;
  grid-template-rows: auto minmax(52px, 1fr);
  min-height: 86px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.calendar-day.muted-day {
  background: var(--surface-soft);
  opacity: .58;
}

.calendar-day.today {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.calendar-day-number {
  justify-self: start;
  min-width: 21px;
  width: 21px;
  min-height: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.calendar-day-number.has-events {
  cursor: pointer;
}

.calendar-day-number.has-events:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.calendar-day-number:disabled {
  cursor: default;
  opacity: 1;
}

.calendar-day.today .calendar-day-number {
  color: var(--accent-ink);
  background: var(--accent);
}

.calendar-day-events {
  display: grid;
  align-content: start;
  gap: 4px;
  margin-top: 4px;
}

.calendar-event {
  --event-color: var(--accent);
  --event-ink: #ffffff;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.calendar-event.has-new-production {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  animation: calendarAttentionPulse 2.8s ease-in-out infinite;
}

.calendar-event.has-urgent-production {
  border-color: #f0b65d;
  background: #fff7e8;
  animation: calendarUrgentPulse 1.9s ease-in-out infinite;
}

.calendar-event.is-deleted {
  border-color: #efb5ad;
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.calendar-event.is-cancelled-event {
  border-color: #e8a29a;
  border-left-color: #b91c1c;
  background: color-mix(in srgb, var(--danger-soft) 62%, var(--surface-soft));
  opacity: .82;
}

.calendar-event.is-cancelled-event:hover {
  opacity: .96;
}

.calendar-event.is-past-event:not(.is-deleted):not(.is-cancelled-event):not(.has-urgent-production) {
  border-color: color-mix(in srgb, var(--line) 86%, #9ca3af);
  background: color-mix(in srgb, var(--surface-soft) 72%, #e5e7eb);
  filter: grayscale(.55);
  opacity: .72;
}

.calendar-event.is-past-event:not(.is-deleted):not(.is-cancelled-event):not(.has-urgent-production):hover {
  opacity: .92;
  filter: grayscale(.25);
}

.calendar-event.is-past-open:not(.is-deleted):not(.is-cancelled-event):not(.has-urgent-production) {
  border-color: #efc06f;
  background: var(--warn-soft);
  filter: none;
  opacity: 1;
}

.calendar-event.is-past-open:not(.is-deleted):not(.is-cancelled-event):not(.has-urgent-production):hover {
  border-color: #e3a53f;
  background: #ffefd0;
  filter: none;
  opacity: 1;
}

.calendar-event-title {
  display: block;
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  color: var(--event-ink);
  background: var(--event-color);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
}

.calendar-attention-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .28);
  vertical-align: middle;
}

.calendar-event-title:hover {
  color: var(--event-ink);
  filter: none;
  opacity: .88;
}

.calendar-event-meta {
  display: none !important;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.calendar-event .pill,
.calendar-event .event-indicators,
.calendar-event .compact-action[data-action="view-invoice"],
.calendar-event .compact-action[data-action="event-postproduction"] {
  display: none !important;
}

.calendar-event .compact-action[data-action="send-email"],
.calendar-event .compact-action[data-action="toggle-more"] {
  display: inline-flex !important;
}

.calendar-event-meta .pill {
  min-height: 18px;
  padding: 2px 6px;
  font-size: 10px;
}

.calendar-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.calendar-event-actions .compact-action {
  min-height: 22px;
  padding: 0 6px;
  font-size: 10px;
}

@keyframes calendarAttentionPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .16), 0 10px 22px rgba(15, 118, 110, .08);
    transform: translateY(-1px);
  }
}

@keyframes calendarUrgentPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .24), 0 12px 26px rgba(245, 158, 11, .16);
  }
}

.calendar-day-modal-list {
  display: grid;
  gap: 10px;
}

.calendar-day-modal-item .calendar-event {
  padding: 10px;
  border-radius: 8px;
}

.calendar-day-modal-item .calendar-event-title {
  font-size: 13px;
}

.expenses-calendar .calendar-pager strong {
  font-size: 22px;
}

.expenses-calendar-grid .expense-calendar-day {
  grid-template-rows: auto minmax(76px, 1fr);
  min-height: 118px;
  padding: 4px;
}

.expense-calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.expense-day-total {
  min-height: 20px;
  max-width: calc(100% - 27px);
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-calendar-day-events {
  gap: 3px;
  margin-top: 4px;
}

.expense-calendar-chip,
.expense-calendar-more {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 22px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  text-align: left;
}

.expense-calendar-chip:hover,
.expense-calendar-more:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
}

.expense-calendar-chip svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.expense-calendar-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-calendar-chip strong {
  font-size: 9px;
  font-weight: 950;
  white-space: nowrap;
}

.expense-calendar-chip.fuel { border-color: #bbf7d0; background: #ecfdf5; }
.expense-calendar-chip.taxi { border-color: #fde68a; background: #fffbeb; }
.expense-calendar-chip.flight,
.expense-calendar-chip.transport { border-color: #bfdbfe; background: #eff6ff; }
.expense-calendar-chip.invoice { border-color: #c7d2fe; background: #eef2ff; }
.expense-calendar-chip.meal { border-color: #fed7aa; background: #fff7ed; }
.expense-calendar-chip.parking { border-color: #e9d5ff; background: #faf5ff; }
.expense-calendar-chip.hotel { border-color: #fecaca; background: #fff1f2; }

.expense-calendar-more {
  display: inline-flex;
  justify-content: center;
  min-height: 20px;
  color: var(--accent);
  font-size: 10px;
}

.expense-calendar-modal-list .expenses-row {
  margin: 0;
}

@media (max-width: 760px) {
  .expenses-calendar-grid .expense-calendar-day {
    min-height: 76px;
    padding: 3px;
  }

  .expenses-calendar .calendar-pager strong {
    font-size: 18px;
  }

  .expense-day-total {
    max-width: calc(100% - 24px);
    min-height: 17px;
    padding: 0 4px;
    font-size: 8px;
  }

  .expense-calendar-chip {
    grid-template-columns: 13px minmax(0, 1fr);
    min-height: 18px;
    padding: 2px 3px;
    font-size: 8px;
  }

  .expense-calendar-chip svg {
    width: 11px;
    height: 11px;
  }

  .expense-calendar-chip strong {
    display: none;
  }

  .expense-calendar-more {
    min-height: 18px;
    font-size: 8px;
  }
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-tabs button {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.settings-tabs button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.settings-inline-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .72);
}

.settings-inline-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.settings-inline-card p {
  margin: 0;
}

.session-list {
  display: grid;
  gap: 0.65rem;
}

.session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
}

.session-row p {
  margin: 0.18rem 0 0;
  overflow-wrap: anywhere;
}

.dark-mode .session-row {
  background: rgba(15, 23, 42, 0.58);
}

.expense-tabs {
  margin-bottom: 12px;
}

.compact-form {
  margin-top: 14px;
}

.period-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.period-controls label { min-width: 150px; }

.period-controls.period-inline {
  align-items: center;
  gap: 6px;
  margin: 0;
  width: auto;
}

.period-controls.period-inline label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.period-controls.period-inline select {
  min-height: 34px;
  height: 34px;
  width: auto;
  min-width: 76px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  font-size: 14px;
}

.tax-panel {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

.smart-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.smart-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.smart-panel-head > div {
  min-width: 0;
}

.dashboard-period-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.smart-panel h2 {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1.15;
}

.smart-panel .eyebrow {
  margin-bottom: 4px;
}

.smart-overview {
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

.dashboard-donut-card {
  --donut-color: var(--warn);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 76px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.dashboard-donut-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 38px rgba(20, 27, 36, .10);
}

.dashboard-donut-card.ok { --donut-color: var(--success); }
.dashboard-donut-card.accent { --donut-color: var(--accent); }
.dashboard-donut-card.danger { --donut-color: var(--danger); }

.automation-health-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--success);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--success-soft));
}

.automation-health-card.needs-attention {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--surface) 88%, var(--warn-soft));
}

.automation-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.automation-health-head strong,
.automation-health-head span {
  display: block;
}

.automation-health-head strong {
  font-size: 13px;
}

.automation-health-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.automation-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px;
}

.automation-health-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.automation-health-item strong,
.automation-health-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-health-item strong {
  font-size: 11px;
}

.automation-health-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.automation-health-item small {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10px;
  font-weight: 950;
}

.automation-health-item.error small {
  color: var(--danger);
  background: var(--danger-soft);
}

.automation-health-item.stale small,
.automation-health-item.pending small {
  color: var(--warn);
  background: var(--warn-soft);
}

.automation-health-item.missing small,
.automation-health-item.disabled small {
  color: var(--muted);
  background: var(--surface-soft);
}

.donut-ring {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 55%, transparent 56%),
    conic-gradient(var(--donut-color) calc(var(--value) * 1%), #e6ebf0 0);
}

.donut-ring span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.dashboard-donut-card strong,
.dashboard-donut-card span,
.dashboard-donut-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-donut-card strong {
  font-size: 12px;
  line-height: 1.15;
}

.dashboard-donut-card span {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 950;
}

.dashboard-donut-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

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

.smart-card,
.tax-grid div {
  display: grid;
  align-content: center;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.smart-card.warning { border-color: #ecc38d; background: var(--warn-soft); }
.smart-card strong { font-size: 24px; line-height: 1; }
.smart-card span { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.tax-grid strong { display: block; margin-top: 7px; font-size: 19px; }

.smart-alert-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.smart-alert {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #ecc38d;
  border-radius: 8px;
  background: var(--warn-soft);
}

.smart-alert.post-alert {
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
}

.smart-alert span {
  display: block;
  margin-top: 3px;
}

.list,
.month-section {
  display: grid;
  gap: 6px;
}

.month-section { margin-top: 12px; }

.month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 8px;
  border-bottom: 1px solid var(--line);
}

.month-head h3 {
  color: color-mix(in srgb, var(--muted) 68%, var(--ink));
  font-size: 26px;
  font-weight: 950;
  text-transform: capitalize;
}

.month-head span {
  min-width: 28px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f6;
  font-size: 11px;
  font-weight: 850;
}

.task-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.task-hero article {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.task-hero article.warn {
  border-color: color-mix(in srgb, var(--warn) 44%, var(--line));
  background: color-mix(in srgb, var(--warn-soft) 72%, var(--surface));
}

.task-hero span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-hero strong {
  display: block;
  margin-top: 2px;
  font-size: 21px;
  line-height: 1;
}

.task-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 7px;
}

.quick-task-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 118px 104px 96px auto;
  gap: 5px;
  align-items: center;
  margin: 4px 0 7px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.quick-task-form input,
.quick-task-form select {
  min-height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.task-detail-button {
  gap: 6px;
  min-height: 34px;
}

.task-detail-button svg {
  width: 16px;
  height: 16px;
}

.task-filter-bar button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 23px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 10px;
  line-height: 1;
}

.task-filter-bar button.active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--accent-soft);
}

.task-filter-bar strong {
  min-width: 16px;
  min-height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  font-size: 9px;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 7px;
}

.task-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 280px);
  grid-template-columns: none;
  gap: 7px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.task-column {
  min-width: 0;
  min-height: 170px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-soft) 74%, transparent);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
  scroll-snap-align: start;
}

.task-columns-editor {
  margin: 4px 0 7px;
}

.task-columns-editor textarea {
  min-height: 82px;
  resize: vertical;
}

.task-column.is-dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent);
}

.task-column header {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 6px;
}

.task-column h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.1;
}

.task-column p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.task-column header > strong {
  min-width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
}

.task-column-list {
  display: grid;
  gap: 5px;
}

.task-empty {
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.task-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head actions"
    "meta actions"
    "progress actions"
    "context context"
    "tags tags";
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.task-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

.task-card.is-dragging {
  opacity: .58;
  transform: rotate(.5deg) scale(.99);
}

.task-card.is-drop-before {
  box-shadow: 0 -3px 0 var(--accent), 0 10px 22px rgba(15, 23, 42, .08);
}

.task-card.is-drop-after {
  box-shadow: 0 3px 0 var(--accent), 0 10px 22px rgba(15, 23, 42, .08);
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #9ca3af;
}

.task-card.priority-urgent::before { background: #b91c1c; }
.task-card.priority-high::before { background: #d97706; }
.task-card.priority-normal::before { background: var(--accent); }
.task-card.priority-low::before { background: #64748b; }

.task-card.due-overdue {
  border-color: color-mix(in srgb, var(--danger) 54%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 56%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 18%, transparent);
}

.task-card.due-today {
  border-color: color-mix(in srgb, var(--warn) 58%, var(--line));
  background: color-mix(in srgb, var(--warn-soft) 58%, #fff);
  animation: taskDuePulse var(--task-pulse-speed, 3.8s) ease-in-out infinite;
}

@keyframes taskDuePulse {
  0%, 100% {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 12%, transparent), 0 0 0 rgba(217,119,6,0);
  }
  50% {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 34%, transparent), 0 0 0 3px color-mix(in srgb, var(--warn) 14%, transparent);
  }
}

.task-card-head,
.task-meta,
.task-context,
.task-actions,
.task-tags {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}


.task-meta { grid-area: meta; }

.task-context { grid-area: context; }
.task-tags { grid-area: tags; }

.task-card-head {
  grid-area: head;
  justify-content: space-between;
  align-items: flex-start;
  gap: 5px;
}

.task-card-head strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.12;
}

.task-card-head p {
  margin-top: 2px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.task-meta,
.task-context,
.task-tags {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
}

.task-priority {
  color: var(--ink);
}

.task-progress {
  grid-area: progress;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.task-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.task-tags span {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--tag-color) 18%, white);
  border: 1px solid color-mix(in srgb, var(--tag-color) 46%, transparent);
}

.task-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ink);
}

.task-attachment-pill svg {
  width: 12px;
  height: 12px;
}

.task-attachment-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-soft) 62%, transparent);
}

.task-attachment-list {
  display: grid;
  gap: 6px;
}

.task-attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.task-attachment-row .button-link {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
}

.task-attachment-row .button-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-attachment-row svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.task-attachment-empty {
  padding: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.task-card-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.task-due-chip {
  min-height: 17px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  color: var(--muted);
  background: var(--surface-soft);
}

.task-due-chip.due-today {
  color: #7c2d12;
  background: color-mix(in srgb, var(--warn-soft) 88%, white);
}

.task-due-chip.due-overdue {
  color: #7f1d1d;
  background: color-mix(in srgb, var(--danger-soft) 82%, white);
}

.task-actions {
  grid-area: actions;
  position: static;
  align-self: center;
  justify-content: flex-end;
  margin-top: 0;
  opacity: .78;
  transition: opacity .14s ease;
}

.task-card:hover .task-actions,
.task-card:focus-within .task-actions {
  opacity: 1;
}

.task-actions .compact-action {
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.task-actions .danger-icon {
  width: 28px;
  height: 28px;
}

.task-inline-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.task-check-editor {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-editor-head,
.task-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-editor-head {
  justify-content: space-between;
}

.task-check-list {
  display: grid;
  gap: 6px;
}

.task-check-row input {
  flex: 1;
  min-width: 0;
}

.task-check-toggle {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: white;
  background: white;
}

.task-check-toggle.checked {
  border-color: var(--accent);
  background: var(--accent);
}

.task-advanced .grid-form {
  margin-top: 10px;
}

.row {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(110px, .65fr) minmax(110px, .65fr) minmax(96px, .5fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.row:hover { border-color: var(--line-strong); background: #fcfdff; }
.row-clickable {
  cursor: pointer;
}

.row-clickable:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line-strong));
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12), 0 0 0 3px color-mix(in srgb, var(--accent-soft) 70%, transparent);
  transform: translateY(-1px);
  backdrop-filter: blur(14px) saturate(1.15);
}

.row-clickable .actions,
.row-clickable a,
.row-clickable button {
  cursor: auto;
}

.timeline-date {
  position: relative;
  align-self: stretch;
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 50px;
  min-height: 44px;
  padding: 4px 6px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.timeline-date::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -11px;
  bottom: -11px;
  z-index: 0;
  width: 1px;
  background: color-mix(in srgb, var(--line) 82%, transparent);
}

.timeline-date span,
.timeline-date strong {
  position: relative;
  z-index: 1;
  background: var(--surface);
}

.timeline-date span {
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: capitalize;
  white-space: nowrap;
}

.timeline-date strong {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  margin-top: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.timeline-date.is-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.action-hint {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
}

.floating-upload {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 26;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(15, 118, 110, .24);
}

#expenses {
  padding-bottom: 118px;
}

.scroll-top,
.scroll-bottom {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  z-index: 27;
  width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  box-shadow: 0 16px 38px rgba(20, 27, 36, .18);
  transition: opacity .16s ease, transform .16s ease;
}

.scroll-top {
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 66px);
}

.scroll-bottom {
  bottom: max(22px, env(safe-area-inset-bottom));
}

.scroll-top.visible,
.scroll-bottom.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.row.row-focus,
.calendar-event.row-focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 18px 42px rgba(15, 118, 110, .16);
  animation: focusPulse 1.05s ease-in-out 3;
}

@keyframes focusPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.event-main-cell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.event-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.event-logo-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  background: var(--surface-strong);
}

.row.clients { grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 1fr) 120px; }

.form-danger-zone {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.client-save-zone {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.client-save-zone button {
  min-width: 170px;
}

.client-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid color-mix(in srgb, var(--client-color) 45%, #fff);
  border-radius: 999px;
  background: var(--client-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--client-color) 32%, transparent);
  vertical-align: -1px;
}
.row.events { grid-template-columns: 58px minmax(240px, 1.25fr) minmax(116px, .6fr) 105px auto; }
.row.events.is-past-event {
  border-color: color-mix(in srgb, var(--line) 86%, #9ca3af);
  background: color-mix(in srgb, var(--surface-soft) 76%, #e5e7eb);
  opacity: .74;
}

.row.events.is-past-event:hover {
  opacity: .94;
}

.row.events.is-past-event .event-main-cell,
.row.events.is-past-event .amount,
.row.events.is-past-event .date-badge {
  filter: grayscale(.45);
}

.row.events.is-cancelled-event {
  border-color: #e8a29a;
  background: color-mix(in srgb, var(--danger-soft) 58%, var(--surface-soft));
  opacity: .82;
}

.row.events.is-cancelled-event:hover {
  opacity: .96;
}

.row.events.is-past-open {
  border-color: #efc06f;
  background: var(--warn-soft);
  opacity: 1;
}

.row.events.is-past-open:hover {
  border-color: #e3a53f;
  background: #ffefd0;
  opacity: 1;
}

.row.events.is-past-open .event-main-cell,
.row.events.is-past-open .amount,
.row.events.is-past-open .date-badge {
  filter: none;
}

.row.production {
  grid-template-columns: 58px minmax(360px, 1fr) minmax(170px, .42fr) minmax(142px, auto);
  align-items: center;
  gap: 12px;
}
.row.postproduction { grid-template-columns: minmax(240px, 1.2fr) 150px minmax(190px, .8fr) auto; }
.row.postproduction-event {
  grid-template-columns: minmax(260px, 1.25fr) 120px 150px auto;
}
.row.postproduction-event > .post-task-list {
  grid-column: 1 / -1;
}

.event-main-cell strong {
  display: inline;
}

.new-badge {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid #f2b25d;
  border-radius: 999px;
  color: #7a3e00;
  background: #ffe4b5;
  box-shadow: 0 8px 20px rgba(217, 119, 6, .14);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .04em;
  vertical-align: middle;
  white-space: nowrap;
}

.production-row-date {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.row.production.is-production-ready {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
  opacity: .72;
  box-shadow: none;
}

.row.production.is-production-ready:hover {
  opacity: .94;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: 0 14px 34px rgba(20, 27, 36, .08), 0 0 0 1px rgba(15, 118, 110, .08);
}

.row.production.is-production-ready .event-main-cell,
.row.production.is-production-ready .production-row-date,
.row.production.is-production-ready .production-row-status {
  filter: grayscale(.22);
}

.production-view-action {
  flex: 0 0 auto;
}

.production-view-action svg {
  width: 17px;
  height: 17px;
}

.production-row-date span {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.production-row-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.production-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.production-row-status .pill,
.production-row-actions .action-hint {
  white-space: nowrap;
}

.production-row-actions .action-hint {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill.neutral {
  color: var(--muted);
  background: var(--surface-strong);
}

.post-event-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}



.post-event-head strong {
  font-size: 16px;
}







.post-task-card.post_create_invoice,
.post-task-card.post_review_invoice,
.post-task-card.post_send_invoice,
.post-task-card.post_client_payment_pending,
.post-task-card.post_missing_invoice,
.post-task-card.post_payment_pending {
  border-color: #ecc38d;
  background: #fffaf0;
}

.post-task-card.post_paid,
.post-task-card.post_invoice_sent,
.post-task-card.post_invoice_paid,
.post-task-card.post_client_paid {
  border-color: #b6e4c8;
  background: #f4fbf7;
}



.post-task-dot svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}



.row.travels { grid-template-columns: 58px minmax(220px, 1.1fr) 104px 104px minmax(180px, .9fr) auto; }
.row.travels.needs-checkin { border-color: #ecc38d; background: #fffaf0; }
.row.invoices {
  grid-template-columns: var(--invoice-grid);
  grid-template-areas: "date main amount status actions";
  align-items: center;
  min-height: 0;
  padding: 8px 10px;
  gap: 10px;
}

.row.invoices > .timeline-date {
  grid-area: date;
  align-self: center;
  min-height: 40px;
}

.row.invoices > div:not(.actions) { grid-area: main; }
.row.invoices > .amount { grid-area: amount; }
.row.invoices > .pill { grid-area: status; }
.row.invoices > .actions {
  grid-area: actions;
  justify-self: end;
  justify-content: flex-end;
}
.row.payments { grid-template-columns: 58px 120px minmax(220px, 1fr) minmax(190px, .8fr) auto; }
.row.expenses-row {
  grid-template-columns: 58px 44px minmax(240px, 1fr) minmax(132px, .28fr) minmax(118px, auto);
  grid-template-areas: "date icon main side actions";
  align-items: center;
  gap: 12px;
}

.row.expenses-row > .timeline-date { grid-area: date; }
.row.expenses-row > .expense-icon-cell { grid-area: icon; }
.row.expenses-row > .expense-main { grid-area: main; }
.row.expenses-row > .expense-side { grid-area: side; }
.row.expenses-row > .expense-actions { grid-area: actions; }

.row.expenses-row.row-selected {
  border-color: var(--danger);
  background: #fff8f7;
}

.row.files-row {
  grid-template-columns: minmax(260px, 1fr) 110px 170px auto;
  align-items: center;
  gap: 10px;
}

.file-main {
  min-width: 0;
  justify-content: flex-start;
  gap: 10px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.file-main:hover {
  color: var(--accent);
  background: transparent;
}

.file-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-ink);
  background: var(--blue-soft);
}

.file-icon.folder {
  color: var(--warn);
  background: var(--warn-soft);
}

.file-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.files-path {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.files-path > div {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nas-dropzone {
  min-height: 58px;
  margin-bottom: 10px;
}

.file-upload-button input {
  display: none;
}

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

.expense-main strong {
  display: block;
  line-height: 1.2;
}

.expense-main p {
  margin: 4px 0 0;
}

.expense-link-line {
  min-height: 18px;
}

.expense-side {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 0;
  text-align: right;
}

.expense-side .amount {
  font-size: 18px;
}

.expense-side small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.2;
}

.expense-status-line {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.expense-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  max-width: 180px;
}

.expense-actions .compact-action {
  white-space: nowrap;
}
.row.bank-connections { grid-template-columns: minmax(220px, 1fr) 130px minmax(145px, .65fr) minmax(180px, .85fr) auto; }

.row > * {
  min-width: 0;
}

.row strong,
.row span,
.row p {
  overflow-wrap: anywhere;
}

.expense-icon-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.expense-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #d5dee8;
  border-radius: 8px;
  color: #334155;
  background: #f1f5f9;
  line-height: 1;
}

.expense-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.expense-icon.invoice { color: #4338ca; background: #eef2ff; border-color: #c7d2fe; }
.expense-icon.taxi { color: #854d0e; background: #fef3c7; border-color: #fde68a; }
.expense-icon.fuel { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.expense-icon.flight { color: #075985; background: #e0f2fe; border-color: #bae6fd; }
.expense-icon.transport { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.expense-icon.parking { color: #6d28d9; background: #f3e8ff; border-color: #e9d5ff; }
.expense-icon.meal { color: #9a3412; background: #ffedd5; border-color: #fed7aa; }
.expense-icon.hotel { color: #7f1d1d; background: #fee2e2; border-color: #fecaca; }

.expense-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.expense-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  color: #334155;
  background: #fff;
  box-shadow: none;
}

.expense-filter svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.expense-filter span {
  white-space: nowrap;
}

.expense-filter small {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #64748b;
  background: #eef2f7;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.35;
}

.expense-fiscal-line {
  margin: 5px 0 0;
}

.fiscal-check {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #475569;
  background: #f8fafc;
}

.fiscal-check.ok {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.fiscal-check.warning {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.expense-period-shift {
  color: #92400e;
  font-weight: 700;
}

.fiscal-check.missing {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.fiscal-review {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.fiscal-review.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.fiscal-review.missing {
  border-color: #fecaca;
  background: #fef2f2;
}

.fiscal-review.ok {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.expense-filter:hover {
  border-color: #b9c5d2;
  background: #f8fafc;
}

.expense-filter.active {
  border-color: rgba(18, 128, 116, .45);
  color: var(--accent);
  background: var(--accent-soft);
}

.expense-filter.active small {
  color: #fff;
  background: var(--accent);
}

.expense-icon b {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 1px 4px rgba(20, 27, 36, .16);
}

.expense-icon b::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.select-row {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.select-row span {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.select-row.selected {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.select-row.selected span {
  position: relative;
  border-color: var(--danger);
  background: var(--danger);
}

.select-row.selected span::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.travel-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.travel-main strong,
.travel-main p,
.travel-event {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.travel-main p { max-width: 100%; }

.travel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.travel-tags span {
  max-width: 120px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f6;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.travel-tags span.warn {
  color: var(--warn);
  background: #f8e8c7;
}

.travel-event {
  display: block;
  font-weight: 750;
}

.travel-event small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-timeline {
  --timeline-axis: 90px;
  --timeline-dot-size: 14px;
  --timeline-dot-border: 3px;
  gap: 12px;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 4px 0;
  border: 1px solid rgba(40, 208, 189, .18);
  border-radius: 16px;
  background: radial-gradient(circle at top left, rgba(40, 208, 189, .12), transparent 26%),
    #081018;
  color: #d7e2ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  position: relative;
  display: grid;
}

.production-timeline::before {
  top: 8px;
  bottom: 8px;
  background: var(--line);
  opacity: .55;
  content: "";
  position: absolute;
  left: var(--timeline-axis);
  width: 2px;
  transform: translateX(-50%);
}

.production-mail {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 26px;
  min-width: 0;
  padding-left: 0;
  position: relative;
  display: grid;
  align-items: start;
}

.production-mail::before {
  top: 16px;
  border-color: #081018;
  content: "";
  position: absolute;
  left: var(--timeline-axis);
  width: var(--timeline-dot-size);
  height: var(--timeline-dot-size);
  border: var(--timeline-dot-border) solid var(--surface);
  border-radius: 999px;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
  transform: translateX(-50%);
}

.production-mail.outgoing::before { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.production-mail.needs-attention::before { background: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.production-mail.waiting-response::before { background: #8b5cf6; box-shadow: 0 0 0 1px #8b5cf6; }

.production-mail-time {
  padding-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  display: grid;
  gap: 3px;
  font-weight: 800;
  text-align: right;
}

.production-mail-time span {
  padding: 2px 7px;
  background: var(--surface-soft);
  color: #9aaabd;
  display: inline-flex;
  justify-self: end;
  border-radius: 999px;
}

.production-mail.outgoing .production-mail-time span {
  color: #07534d;
  background: var(--accent-soft);
}

.production-mail-card {
  gap: 8px;
  padding: 12px;
  border-color: rgba(148, 163, 184, .22);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  min-width: 0;
  border: 1px solid var(--line);
}

.production-mail.outgoing .production-mail-card {
  border-color: #b7ddd8;
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface));
}

.production-mail.needs-attention .production-mail-card {
  border-color: #ecc38d;
  background: var(--warn-soft);
}

.production-mail.waiting-response .production-mail-card {
  border-color: #d8b4fe;
  background: color-mix(in srgb, #8b5cf6 12%, var(--surface));
}

.production-mail-head {
  gap: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.production-mail-card p,
.production-mail-card strong {
  overflow-wrap: anywhere;
}

.mail-body-preview,
.mail-body-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  font-family: inherit;
  line-height: 1.45;
}

.mail-body-preview {
  max-height: 150px;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background: rgba(2, 6, 12, .36);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
}

.mail-body-text {
  max-height: min(62vh, 720px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
}

.production-attachments {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.production-attachments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.production-attachments-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.production-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.production-attachment-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.production-attachment-card:hover {
  border-color: var(--line-strong);
  background: #fbfcfd;
}

.production-attachment-card strong,
.production-attachment-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-attachment-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip-row span {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f6;
  font-size: 11px;
  font-weight: 800;
}

.table-head {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 0 12px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.table-head.invoices { grid-template-columns: var(--invoice-grid); }
.table-head.invoices span:nth-child(3),
.row.invoices > .amount { text-align: right; }
.table-head.invoices span:nth-child(4),
.row.invoices > .pill { justify-self: center; }
.table-head.invoices span:nth-child(5) { text-align: right; }

.client-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #edf1f5;
}

.empty-avatar { border: 1px dashed var(--line-strong); }
.muted { color: var(--muted); }
.amount { font-weight: 850; white-space: nowrap; }

.invoice-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.invoice-meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-main-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.invoice-title-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.invoice-title-line strong {
  flex: 0 0 auto;
}

.invoice-title-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 750;
}

.invoice-operational-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--warn);
  background: #f8e8c7;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.action-hint-button {
  border: 0;
  cursor: pointer;
}

.action-hint-button:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
}

.pill-action {
  border: 0;
  min-height: 0;
  cursor: pointer;
}

.production-mail.message-focus .production-mail-card {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .16), 0 20px 44px rgba(139, 92, 246, .16);
  animation: messageFocusPulse 1.05s ease-in-out 3;
}

@keyframes messageFocusPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.pill.approved { color: #111827; background: #f8e8c7; }
.pill.paid { color: var(--success); background: var(--success-soft); }
.pill.sent { color: var(--blue-ink); background: var(--blue-soft); }
.pill.draft { color: var(--warn); background: #f8e8c7; }
.pill.pending { color: var(--warn); background: #f8e8c7; }
.pill.linked { color: var(--success); background: var(--success-soft); }
.pill.ignored { color: #5b6470; background: #edf1f5; }
.pill.needs_attention { color: var(--warn); background: #f8e8c7; }
.pill.waiting_response { color: #6d28d9; background: #f3e8ff; }
.pill.closed { color: var(--success); background: var(--success-soft); }
.pill.post_paid { color: var(--success); background: var(--success-soft); }
.pill.task_open { color: var(--warn); background: var(--warn-soft); }
.pill.task_in_progress { color: var(--blue-ink); background: var(--blue-soft); }
.pill.task_blocked { color: #8d2b22; background: var(--danger-soft); }
.pill.task_done { color: var(--success); background: var(--success-soft); }
.pill.post_invoice_sent,
.pill.post_invoice_paid,
.pill.post_client_paid { color: var(--success); background: var(--success-soft); }
.pill.post_create_invoice,
.pill.post_review_invoice,
.pill.post_send_invoice { color: var(--warn); background: var(--warn-soft); }
.pill.post_client_payment_pending { color: var(--warn); background: var(--warn-soft); }
.pill.payment_pending { color: var(--warn); background: var(--warn-soft); }
.pill.post_payment_pending { color: var(--blue-ink); background: var(--blue-soft); }
.pill.post_missing_invoice { color: var(--warn); background: var(--warn-soft); }
.pill.post_none { color: var(--muted); background: #edf1f5; }
.pill.invoice_draft { color: var(--warn); background: #f8e8c7; }
.pill.cancelled { color: #5b6470; background: #edf1f5; }
.pill.event_cancelled { color: #7f1d1d; background: #fee2e2; }
.pill.scheduled,
.pill.drafted { color: #111827; background: #d9f7e7; }
.pill.in_course { color: #075985; background: #dff3ff; }
.pill.realized { color: #1f2937; background: #e5e7eb; }
.pill.ready { color: var(--accent); background: var(--accent-soft); }
.pill.unmatched,
.pill.calendar_deleted,
.pill.error,
.pill.type_rectifying { color: #8d2b22; background: var(--danger-soft); }
.pill.needs_provider { color: var(--warn); background: #f8e8c7; }
.pill.connected { color: var(--success); background: var(--success-soft); }
.pill.type_event { color: var(--accent); background: var(--accent-soft); }
.pill.type_manual { color: #4c5562; background: #edf1f5; }

.draft-number-hint {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.row .actions,
.expense-actions,
.production-row-actions,
.calendar-event-actions {
  justify-content: center;
  text-align: center;
}

.row .actions {
  justify-self: center;
}

.row.invoices .actions { flex-wrap: nowrap; }

.compact-action {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.compact-action.icon-only-action {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.compact-action.icon-only-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.more-action-button {
  gap: 6px;
}

.more-action-button svg,
.action-menu > button svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.event-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.event-indicators .pill {
  min-width: 0;
  min-height: 22px;
  padding: 0 8px;
  font-size: 10px;
}



.quick-worker-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.compact-details {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.compact-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
}

.compact-details[open] {
  display: grid;
  gap: 10px;
}

.two-factor-qr {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.two-factor-qr-box {
  width: min(250px, 100%);
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.two-factor-qr-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.two-factor-qr-copy strong {
  font-size: 18px;
}

.two-factor-qr-copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.two-factor-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .two-factor-qr {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .two-factor-qr-copy {
    text-align: center;
  }
}

.action-menu { position: relative; }

.action-menu > button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink);
  background: #eef2f6;
  font-weight: 800;
}

.action-menu.open > button { background: #dfe6ee; }

.action-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: none;
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(20, 27, 36, .14);
}

.action-menu.open > div { display: grid; }

.action-menu.drop-up > div {
  top: auto;
  bottom: calc(100% + 6px);
}

.action-menu > div button {
  justify-content: flex-start;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
}

.action-menu > div button:hover { background: var(--surface-soft); }
.action-menu > div .danger-text { color: var(--danger); }

.post-task-card .actions {
  min-width: 0;
}



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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
textarea,
select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input[type="checkbox"] {
  min-height: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-dropzone {
  display: grid;
  gap: 5px;
  place-items: center;
  min-height: 104px;
  padding: 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.file-dropzone strong {
  color: var(--ink);
  font-size: 15px;
}

.file-dropzone span,
.file-dropzone small {
  font-size: 12px;
}

.file-dropzone.has-file {
  border-style: solid;
  border-color: #8fcfbd;
  background: var(--success-soft);
}

/* Atajo a la camara del movil dentro de la zona de subida. Se pinta siempre que
   el input acepte imagenes; en escritorio tambien vale -abre la webcam- pero
   donde gana es en el movil, que abre la camara de un toque en vez de pasar por
   el menu de archivos del sistema. */
.ec-cam-btn {
  margin-top: 4px;
  padding: 9px 16px;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .16s ease, transform .08s ease;
}

.ec-cam-btn:hover { filter: brightness(1.08); }
.ec-cam-btn:active { transform: translateY(1px); }

.ec-cam-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .28);
}

/* En pantalla de movil el boton manda: a toda la anchura y bien alto para el dedo. */
@media (max-width: 640px) {
  .file-dropzone { min-height: 92px; padding: 14px; }
  .ec-cam-btn { width: 100%; min-height: 48px; font-size: 15px; }
}

.file-dropzone.is-dragging,
.file-dropzone:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row span {
  min-width: 0;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(15, 118, 110, .16);
  border-color: var(--accent);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.dark-mode .sidebar {
  background:
    linear-gradient(#050607 0 104px, #0f1318 104px 100%);
  border-color: #252c35;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .34);
}

.dark-mode,
.dark-mode body,
.dark-mode main {
  color: var(--ink);
  background: var(--bg);
}

.dark-mode header {
  color: var(--ink);
}

.dark-mode .brand,
.dark-mode .brand-home,
.dark-mode .brand.nav.active,
.dark-mode .brand-home:hover {
  color: #ffffff;
  background: #050607;
  border-color: transparent;
}

.dark-mode .brand strong {
  color: #ffffff;
  text-shadow: 0 0 22px rgba(255, 255, 255, .10);
}

.dark-mode .brand small {
  color: #c3ccd6;
}

.dark-mode .brand .mark,
.dark-mode .login-card .mark {
  color: #061513;
  background: linear-gradient(135deg, #ffffff 0 54%, #28d0bd 54% 100%);
  border-color: rgba(255, 255, 255, .28);
}

.dark-mode .toast,
.dark-mode .panel,
.dark-mode .card,
.dark-mode .automation-health-card,
.dark-mode .automation-health-item,
.dark-mode .settings-tabs,
.dark-mode .view-help summary,
.dark-mode .view-help-grid div,
.dark-mode .row,
.dark-mode .task-card,
.dark-mode .task-column,
.dark-mode .task-hero article,
.dark-mode .task-filter-bar button,
.dark-mode .quick-task-form,
.dark-mode .task-check-editor,
.dark-mode .task-check-toggle,
.dark-mode .post-event-card,
.dark-mode .post-task-card,
.dark-mode .mini-row,
.dark-mode .queue-row,
.dark-mode .empty,
.dark-mode .file-dropzone,
.dark-mode .modal,
.dark-mode .settings-inline-card,
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
  background: var(--surface);
  border-color: var(--line);
}

.dark-mode .row:hover,
.dark-mode .task-filter-bar button.active,
.dark-mode .button-link,
.dark-mode .secondary,
.dark-mode .icon,
.dark-mode .queue-progress,
.dark-mode .dashboard-donut-card,
.dark-mode .automation-health-item,
.dark-mode .view-help-grid div,
.dark-mode .smart-card,
.dark-mode .tax-grid div,
.dark-mode .month-head span,
.dark-mode .expense-filter,
.dark-mode .select-row,
.dark-mode .file-dropzone.is-dragging,
.dark-mode .file-dropzone:focus,
.dark-mode .calendar-day,
.dark-mode .calendar-event,
.dark-mode .post-task-dot {
  background: var(--surface-soft);
}

.dark-mode .row:hover {
  background: #151b22;
  border-color: var(--line-strong);
}

.dark-mode .row-clickable:hover {
  background: rgba(25, 31, 39, .72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .32), 0 0 0 2px rgba(40, 208, 189, .12);
}

.dark-mode .edit-bar,
.dark-mode .edit-popover,
.dark-mode .edit-popover-options button,
.dark-mode .edit-popover-row,
.dark-mode .edit-popover-section .technical-config-panel {
  color: var(--ink);
  background: rgba(18, 23, 29, .86);
  border-color: var(--line);
}

@media (min-width: 900px) {
  .dark-mode .floating-backdrop .modal {
    border-color: rgba(112, 128, 150, .34);
    background: rgba(18, 23, 29, .88);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .46);
  }

  .dark-mode .floating-backdrop .modal-head {
    background: rgba(25, 31, 39, .72);
  }

  .dark-mode .window-chrome {
    border-color: rgba(112, 128, 150, .24);
    background: rgba(8, 12, 18, .36);
  }

  .dark-mode .window-control:hover {
    background: rgba(148, 163, 184, .18);
  }

  .dark-mode .window-control.is-close:hover {
    background: #c6281d;
  }

  .dark-mode .floating-view-body {
    background: rgba(14, 18, 23, .66);
  }
}

.dark-mode .calendar-event:not(.is-deleted):not(.is-cancelled-event) {
  border-color: var(--line);
  background: var(--surface-soft);
}

.dark-mode .calendar-event.has-new-production {
  border-color: rgba(40, 208, 189, .46);
}

.dark-mode .calendar-event.has-urgent-production {
  border-color: rgba(246, 179, 61, .70);
  background: rgba(70, 47, 13, .58);
}

.dark-mode .calendar-event.is-cancelled-event,
.dark-mode .row.events.is-cancelled-event {
  border-color: rgba(239, 120, 108, .58);
  background: rgba(72, 25, 28, .62);
  opacity: .86;
}

.dark-mode .calendar-event.is-past-event:not(.is-deleted):not(.is-cancelled-event):not(.has-urgent-production),
.dark-mode .row.events.is-past-event:not(.is-cancelled-event) {
  border-color: #2a313b;
  background: color-mix(in srgb, var(--surface-soft) 72%, #1f2933);
  opacity: 1;
  filter: none;
}

.dark-mode .calendar-event.is-past-event:not(.is-deleted):not(.is-cancelled-event):not(.has-urgent-production):hover,
.dark-mode .row.events.is-past-event:not(.is-cancelled-event):hover {
  opacity: 1;
  filter: none;
}

.dark-mode .calendar-event:not(.is-deleted):not(.is-cancelled-event) .calendar-event-title {
  color: var(--event-ink);
  background: var(--event-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--event-color) 38%, transparent);
}

.dark-mode .calendar-event.is-past-open:not(.is-deleted):not(.is-cancelled-event):not(.has-urgent-production),
.dark-mode .row.events.is-past-open {
  border-color: rgba(255, 193, 104, .72);
  background: rgba(86, 55, 14, .62);
  filter: none;
  opacity: 1;
}

.dark-mode .calendar-event.is-past-open:not(.is-deleted):not(.has-urgent-production):hover,
.dark-mode .row.events.is-past-open:hover {
  border-color: rgba(255, 210, 137, .9);
  background: rgba(105, 68, 17, .72);
  filter: none;
  opacity: 1;
}

.dark-mode .email-preview-sheet,
.dark-mode .email-preview-body,
.dark-mode .mail-body-text,
.dark-mode .mail-body-preview,
.dark-mode .production-timeline,
.dark-mode .production-attachments,
.dark-mode .attachment-folder-modal,
.dark-mode .attachment-folder-card {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-color: var(--line);
}

.dark-mode .mail-body-preview,
.dark-mode .email-preview-meta {
  color: var(--muted);
}

.dark-mode .attachment-folder-card strong {
  color: #f6f8fb;
}

.dark-mode .attachment-folder-card small,
.dark-mode .attachment-folder-card em {
  color: #c8d1dc;
}

.dark-mode .production-timeline::before {
  background: var(--line-strong);
}

.dark-mode .production-mail::before {
  border-color: var(--bg);
}

.dark-mode .production-mail-time span {
  color: var(--muted);
  background: #202832;
}

.dark-mode .production-mail-card {
  color: var(--ink);
  background: #111820;
  border-color: #2f3945;
}

.dark-mode .production-mail.outgoing .production-mail-card {
  background: rgba(40, 208, 189, .10);
  border-color: rgba(40, 208, 189, .32);
}

.dark-mode .production-mail.needs-attention .production-mail-card,
.dark-mode .row.travels.needs-checkin {
  background: rgba(255, 211, 138, .11);
  border-color: rgba(255, 211, 138, .34);
}

.dark-mode .production-mail.waiting-response .production-mail-card {
  background: rgba(139, 92, 246, .12);
  border-color: rgba(216, 180, 254, .38);
}

.dark-mode .modal-head,
.dark-mode .modal-actions {
  background: var(--surface);
  border-color: var(--line);
}

.dark-mode .modal-body,
.dark-mode .file-preview-body,
.dark-mode .invoice-preview-body {
  background: var(--surface-soft);
}

.dark-mode .file-preview-body.is-pdf {
  background: #0d1117;
}

.dark-mode .file-preview-body img {
  background: transparent;
}

.dark-mode .pdf-page-stack img,
.dark-mode .pdf-page-stack canvas {
  background: #fff;
}

.dark-mode .toast {
  color: var(--ink);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .38);
}

.dark-mode .toast button,
.dark-mode .secondary,
.dark-mode .button-link,
.dark-mode .icon,
.dark-mode .utility-nav .nav,
.dark-mode .workflow-nav .nav {
  color: var(--ink);
  background: #1d252e;
  border-color: #333d49;
}



.dark-mode .donut-ring {
  background:
    radial-gradient(circle at center, var(--surface-soft) 0 55%, transparent 56%),
    conic-gradient(var(--donut-color) calc(var(--value) * 1%), #313b47 0);
}

.dark-mode .workflow-nav .nav::before {
  color: #dbe4ee;
  background: #10151b;
}

.dark-mode .nav:hover,
.dark-mode .secondary:hover,
.dark-mode .button-link:hover,
.dark-mode .icon:hover {
  color: #ffffff;
  background: #202832;
  filter: none;
}

.dark-mode .brand:hover,
.dark-mode .brand-home:hover,
.dark-mode .brand.nav.active:hover {
  color: #ffffff;
  background: #050607;
  box-shadow: none;
  transform: none;
}

.dark-mode .nav.active,
.dark-mode .workflow-nav .nav.active,
.dark-mode .utility-nav .nav.active {
  color: #ffffff;
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
}

.dark-mode .nav.is-working,
.dark-mode .nav.active.is-working,
.dark-mode .workflow-nav .nav.active.is-working,
.dark-mode .utility-nav .nav.active.is-working {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, .42);
  background: rgba(6, 78, 59, .58);
}

.dark-mode .view.is-working {
  background: linear-gradient(135deg, rgba(6, 78, 59, .34), rgba(15, 23, 42, .10));
}

.dark-mode .view.is-working::before {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, .38);
  background: rgba(6, 78, 59, .92);
  box-shadow: 0 14px 34px rgba(16, 185, 129, .12);
}

.dark-mode .workflow-nav .nav.active::before {
  color: var(--accent-ink);
  background: var(--accent);
}

.dark-mode .event-logo {
  background: #ffffff;
  border-color: var(--line-strong);
}

.dark-mode button,
.dark-mode .button-link,
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
  color: var(--ink);
}

.dark-mode .toolbar-more summary,
.dark-mode .filter-more summary {
  color: var(--ink);
  background: var(--surface-soft);
}

.dark-mode .danger {
  color: #1f0d0d;
}

.dark-mode .danger-text {
  color: var(--danger);
}

.dark-mode .danger-icon {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 141, 134, .35);
}

.dark-mode .soft-action {
  color: #c7d0dc;
  background: #161d24;
  border-color: #303946;
}

.dark-mode .settings-tabs button.active {
  color: #050910;
  background: var(--accent);
  border-color: var(--accent);
}

.dark-mode .chip-row span,
.dark-mode .production-attachment-card,
.dark-mode .invoice-preview-body,
.dark-mode .receipt-preview,
.dark-mode .image-preview,
.dark-mode .expense-editor,
.dark-mode .tax-panel,
.dark-mode .smart-panel {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
}

.dark-mode .production-attachment-card:hover {
  background: #202832;
  border-color: var(--line-strong);
}

.dark-mode button:not(.secondary):not(.icon):not(.nav):not(.button-link):not(.inline-link):not(.danger):not(.danger-icon):not(.ghost):not(.soft-action) {
  color: var(--accent-ink);
  background: var(--accent);
}

.dark-mode .brand,
.dark-mode .brand strong,
.dark-mode .brand small {
  color: #ffffff;
}

.dark-mode .fiscal-check {
  color: var(--muted);
  background: #151b23;
  border-color: var(--line);
}

.dark-mode .fiscal-check.ok,
.dark-mode .fiscal-review.ok {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.24);
  border-color: rgba(34, 197, 94, 0.35);
}

.dark-mode .fiscal-check.warning,
.dark-mode .fiscal-review.warning {
  color: #fde68a;
  background: rgba(146, 64, 14, 0.24);
  border-color: rgba(245, 158, 11, 0.35);
}

.dark-mode .expense-period-shift {
  color: #fde68a;
}

.dark-mode .fiscal-check.missing,
.dark-mode .fiscal-review.missing {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(248, 113, 113, 0.35);
}

.dark-mode .expense-day-total,
.dark-mode .expense-calendar-chip,
.dark-mode .expense-calendar-more {
  color: var(--ink);
  background: #151b23;
  border-color: var(--line);
}

.dark-mode .expense-calendar-chip.fuel { background: rgba(22, 101, 52, .22); border-color: rgba(34, 197, 94, .32); }
.dark-mode .expense-calendar-chip.taxi { background: rgba(146, 64, 14, .22); border-color: rgba(245, 158, 11, .32); }
.dark-mode .expense-calendar-chip.flight,
.dark-mode .expense-calendar-chip.transport { background: rgba(29, 78, 216, .22); border-color: rgba(96, 165, 250, .32); }
.dark-mode .expense-calendar-chip.invoice { background: rgba(67, 56, 202, .22); border-color: rgba(129, 140, 248, .32); }
.dark-mode .expense-calendar-chip.meal { background: rgba(154, 52, 18, .22); border-color: rgba(251, 146, 60, .32); }
.dark-mode .expense-calendar-chip.parking { background: rgba(109, 40, 217, .22); border-color: rgba(192, 132, 252, .32); }
.dark-mode .expense-calendar-chip.hotel { background: rgba(127, 29, 29, .22); border-color: rgba(248, 113, 113, .32); }

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

.image-preview,
.receipt-preview {
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.image-preview img {
  max-width: 180px;
  max-height: 120px;
  border-radius: 8px;
  object-fit: contain;
}

.receipt-preview { min-height: 180px; }
.receipt-preview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  object-fit: contain;
}

.scanner-preview {
  min-height: 220px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, .12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, .12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, .12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, .12) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.scanner-preview img {
  max-height: 420px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
}

.scan-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.scan-options label {
  display: inline-flex;
  width: auto;
  min-height: 42px;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: .92rem;
}

.scan-options input {
  width: auto;
  min-height: 0;
}

.form-warning {
  padding: 12px 14px;
  border: 1px solid #f0cf95;
  border-radius: 8px;
  color: #7a520f;
  background: var(--warn-soft);
}

.form-divider {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.expense-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.expense-editor h3 { grid-column: 1 / -1; }

.invoice-line-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 34px;
  align-items: end;
  gap: 10px;
}

.line-remove {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--danger);
  background: #f7ecea;
  font-size: 20px;
  line-height: 1;
}

.line-remove:hover { background: #f1d8d4; }

.quote-sections {
  display: grid;
  gap: 14px;
}

.quote-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.quote-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
}

.quote-section-head input {
  font-weight: 800;
}

.quote-section-desc {
  min-height: 56px;
  resize: vertical;
}

.quote-items {
  display: grid;
  gap: 8px;
}

.quote-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 100px 80px 100px 34px;
  gap: 8px;
  align-items: center;
}

.quote-item-row-head {
  padding: 0 2px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-item-amount {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-weight: 800;
  padding: 0 4px;
}

.quote-section-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.quote-editor-actions {
  display: flex;
  justify-content: flex-start;
}

.quote-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 14px;
}

.quote-totals strong {
  font-size: 16px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(23, 27, 34, .46);
  z-index: 30;
  animation: backdrop-in .16s ease-out;
  overscroll-behavior: contain;
}

.preview-backdrop {
  background: rgba(23, 27, 34, .52);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0,0,0,.24);
  animation: modal-in .18s cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 900px) {
  .floating-backdrop {
    inset: 0;
    display: block;
    padding: 0;
    background: transparent;
    pointer-events: none;
    animation: none;
  }

  .floating-backdrop .modal {
    position: fixed;
    left: var(--float-left, 96px);
    top: var(--float-top, 88px);
    width: min(840px, calc(100vw - 48px));
    min-width: 360px;
    min-height: 280px;
    max-height: calc(100vh - 32px);
    resize: both;
    border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: 0 26px 80px rgba(15, 23, 42, .24);
    backdrop-filter: blur(24px) saturate(1.25);
    pointer-events: auto;
  }

  .floating-backdrop .modal::after {
    content: "";
    position: sticky;
    right: 8px;
    bottom: 8px;
    float: right;
    width: 16px;
    height: 16px;
    margin: -20px 8px 8px 0;
    border-right: 2px solid color-mix(in srgb, var(--muted) 58%, transparent);
    border-bottom: 2px solid color-mix(in srgb, var(--muted) 58%, transparent);
    border-radius: 0 0 4px 0;
    pointer-events: none;
  }

  .floating-backdrop .modal-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding-right: 128px;
    cursor: grab;
    user-select: none;
    background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
    backdrop-filter: blur(18px);
  }

  .floating-backdrop.is-dragging .modal-head {
    cursor: grabbing;
  }

  .floating-backdrop .modal-head h2 {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .floating-backdrop.is-maximized .modal {
    resize: none;
    border-radius: 14px;
  }

  .floating-backdrop.is-maximized .modal-head {
    cursor: default;
  }

  .floating-backdrop .invoice-preview-modal,
  .floating-backdrop .file-preview-modal {
    width: min(960px, calc(100vw - 48px));
    height: min(82vh, 860px);
    min-width: 420px;
    min-height: 360px;
  }

  .floating-view-modal {
    width: min(920px, calc(100vw - 48px));
    height: min(78vh, 760px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .floating-view-body {
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 10px;
    background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
  }

  .floating-view-clone {
    container-type: inline-size;
    display: grid;
    gap: 8px;
    font-size: 12px;
    line-height: 1.25;
  }

  .floating-view-clone .toolbar {
    position: static;
    gap: 8px;
    margin-bottom: 2px;
  }

  .floating-view-clone .panel,
  .floating-view-clone .card {
    border-radius: 7px;
  }

  .floating-view-clone .panel {
    padding: 9px;
  }

  .floating-view-clone .list,
  .floating-view-clone .month-section {
    gap: 4px;
  }

  .floating-view-clone .month-section {
    margin-top: 6px;
  }

  .floating-view-clone .month-head {
    padding: 5px 1px 4px;
  }

  .floating-view-clone .month-head h3 {
    font-size: 16px;
  }

  .floating-view-clone .month-head span {
    min-width: 24px;
    min-height: 18px;
    font-size: 11px;
  }

  .floating-view-clone .row {
    border-radius: 7px;
  }

  .floating-view-clone .row.events {
    grid-template-columns: 42px minmax(170px, 1fr) 78px 82px minmax(130px, auto);
    gap: 7px;
    padding: 7px;
  }

  .floating-view-clone .row.invoices {
    grid-template-columns: 42px minmax(180px, 1fr) 86px 92px minmax(130px, auto);
    gap: 7px;
    padding: 7px;
  }

  .floating-view-clone .row.expenses-row {
    grid-template-columns: 42px 34px minmax(180px, 1fr) 98px minmax(118px, auto);
    gap: 7px;
    padding: 7px;
  }

  .floating-view-clone .task-hero {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .floating-view-clone .task-hero article {
    padding: 8px 9px;
  }

  .floating-view-clone .task-hero strong {
    font-size: 20px;
  }

  .floating-view-clone .task-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 7px;
  }

  .floating-view-clone .task-card {
    padding: 10px 10px 9px 14px;
    gap: 7px;
  }

  .floating-view-clone .event-main-cell {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .floating-view-clone .event-logo {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    padding: 2px;
  }

  .floating-view-clone .event-main-cell strong,
  .floating-view-clone .invoice-main strong,
  .floating-view-clone .expense-main strong {
    font-size: 13px;
    line-height: 1.15;
  }

  .floating-view-clone .muted,
  .floating-view-clone .event-main-cell p,
  .floating-view-clone .invoice-meta,
  .floating-view-clone .expense-status-line {
    font-size: 11px;
    line-height: 1.2;
  }

  .floating-view-clone .timeline-date {
    min-height: 0;
    padding: 0 7px 0 0;
    gap: 1px;
  }

  .floating-view-clone .timeline-date span {
    font-size: 10px;
  }

  .floating-view-clone .timeline-date strong {
    font-size: 18px;
  }

  .floating-view-clone .pill {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .floating-view-clone .amount {
    font-size: 13px;
  }

  .floating-view-clone .compact-action,
  .floating-view-clone .actions button,
  .floating-view-clone .button-link {
    min-height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
  }

  .floating-view-clone .actions {
    gap: 5px;
  }

  .floating-window-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }

  .floating-window-tools .secondary {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 7px;
  }

  .window-chrome {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    height: 36px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
    border-top: 0;
    border-right: 0;
    border-radius: 0 18px 0 10px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 10px 22px rgba(15, 23, 42, .08);
  }

  .window-control {
    width: 40px;
    height: 36px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    box-shadow: none;
  }

  .window-control + .window-control {
    border-left: 1px solid color-mix(in srgb, var(--line) 42%, transparent);
  }

  .window-control svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
  }

  .window-control:hover {
    transform: none;
    color: var(--ink);
    background: color-mix(in srgb, var(--line) 54%, transparent);
  }

  .window-control.is-close {
    width: 46px;
    font-size: 22px;
    line-height: 1;
  }

  .window-control.is-close:hover {
    color: #fff;
    background: #c6281d;
  }

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

  .preset-actions button {
    justify-content: center;
  }

  .preset-actions svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    vertical-align: -3px;
  }

  @container (max-width: 720px) {
    .floating-view-clone .table-head {
      display: none;
    }

    .floating-view-clone .row,
    .floating-view-clone .row.events,
    .floating-view-clone .row.invoices,
    .floating-view-clone .row.expenses-row,
    .floating-view-clone .row.production,
    .floating-view-clone .row.postproduction,
    .floating-view-clone .row.postproduction-event,
    .floating-view-clone .row.travels {
      grid-template-columns: 1fr;
      gap: 5px;
      padding: 7px;
    }

    .floating-view-clone .event-main-cell,
    .floating-view-clone .invoice-main,
    .floating-view-clone .expense-main,
    .floating-view-clone .travel-main,
    .floating-view-clone .production-mail-main {
      min-width: 0;
      max-width: 100%;
    }

    .floating-view-clone .event-logo {
      width: 28px;
      height: 28px;
      object-fit: contain;
    }

    .floating-view-clone .timeline-date {
      width: fit-content;
      min-height: 0;
      grid-template-columns: auto auto;
      justify-content: start;
      justify-items: start;
      gap: 6px;
      padding: 0;
      border-right: 0;
    }

    .floating-view-clone .event-indicators,
    .floating-view-clone .invoice-meta,
    .floating-view-clone .expense-status-line {
      gap: 4px;
    }

    .floating-view-clone .timeline-date::before {
      display: none;
    }

    .floating-view-clone .actions,
    .floating-view-clone .expense-actions,
    .floating-view-clone .production-row-actions,
    .floating-view-clone .calendar-event-actions {
      justify-content: flex-start;
      flex-wrap: wrap;
    }

    .floating-view-clone .amount,
    .floating-view-clone .row.invoices > .amount {
      text-align: left;
    }
  }

  @container (max-width: 520px) {
    .floating-view-clone .toolbar,
    .floating-view-clone .panel > .toolbar {
      grid-template-columns: 1fr;
      align-items: start;
    }

    .floating-view-clone .toolbar .actions {
      width: 100%;
      justify-content: flex-start;
    }

    .floating-view-clone .compact-action,
    .floating-view-clone .actions button,
    .floating-view-clone .button-link {
      min-height: 26px;
      padding: 0 7px;
      font-size: 11px;
    }

    .floating-view-clone .pill {
      min-width: 0;
      white-space: normal;
    }
  }
}

@keyframes backdrop-in {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.975); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-backdrop.is-closing {
  pointer-events: none;
  animation: backdrop-out .18s cubic-bezier(.4, 0, 1, 1) forwards;
}

.modal-backdrop.is-closing .modal {
  animation: modal-out .18s cubic-bezier(.4, 0, 1, 1) forwards;
}

@keyframes backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; backdrop-filter: blur(0); }
}

@keyframes modal-out {
  from { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  to { opacity: 0; transform: translateY(8px) scale(.94); filter: blur(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal,
  .modal-backdrop.is-closing,
  .modal-backdrop.is-closing .modal,
  .calendar-event.has-new-production,
  .calendar-event.has-urgent-production {
    animation-duration: .01ms;
  }
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface-soft);
}

.modal-body { padding: 18px; }

.invoice-preview-modal {
  width: min(1120px, calc(100vw - 28px));
  height: min(92vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.invoice-preview-body { min-height: 0; background: var(--surface-soft); }
.invoice-preview-body:has(.file-preview-card) { display: grid; place-items: center; min-height: 320px; }
.invoice-preview-body iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

.file-preview-modal {
  width: min(1120px, calc(100vw - 28px));
  height: min(92vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.file-preview-body {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  background: var(--surface-soft);
}

.file-preview-body iframe {
  display: block;
  width: min(100%, 920px);
  height: 100%;
  border: 0;
  background: #fff;
}

.file-preview-body video {
  width: min(100%, 960px);
  max-height: 100%;
  border-radius: 10px;
  background: #000;
  box-shadow: var(--shadow);
}

.file-preview-body audio {
  width: min(720px, calc(100% - 32px));
}

.file-preview-body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  box-shadow: var(--shadow);
}







.pdf-controls [data-pdf-zoom="in"],
.pdf-controls [data-pdf-zoom="out"] {
  width: 36px;
  padding: 0;
  font-size: 18px;
}

.pdf-zoom-label {
  min-width: 74px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}



.pdf-page-stack.is-rendering {
  opacity: .92;
}

.pdf-page-stack img,
.pdf-page-stack canvas {
  display: block;
  max-width: none;
  height: auto;
  max-height: none;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
}

.pdf-page-loading {
  width: min(100%, 980px);
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 850;
}

.pdf-truncated {
  width: min(100%, 980px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.file-preview-body.is-image {
  padding: 18px;
}

.file-preview-body.is-generic {
  padding: 22px;
}

.file-preview-card {
  width: min(440px, 100%);
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .12);
  text-align: center;
  backdrop-filter: blur(18px);
}

.file-preview-card span {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  min-height: 64px;
  padding: 0 12px;
  border-radius: 16px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 14px;
  font-weight: 950;
}

.file-preview-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.file-preview-card p {
  color: var(--muted);
  line-height: 1.45;
}

.attachment-action {
  position: relative;
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.attachment-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment-action span {
  position: absolute;
  right: -4px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 10px;
  font-weight: 950;
}

.folder-backdrop {
  backdrop-filter: blur(14px);
}

.attachment-folder-modal {
  width: min(860px, calc(100vw - 28px));
  max-height: min(82vh, 780px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 30px 90px rgba(15, 23, 42, .26);
  backdrop-filter: blur(24px) saturate(1.3);
}

.attachment-folder-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.folder-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 16px 34px rgba(15, 118, 110, .18);
}

.folder-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment-folder-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.attachment-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.attachment-folder-card {
  min-height: 156px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  justify-items: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 16px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  text-align: left;
  white-space: normal;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  backdrop-filter: blur(12px);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.attachment-folder-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 18px 46px rgba(15, 23, 42, .16);
}

.attachment-folder-card > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.attachment-folder-card svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment-folder-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.attachment-folder-card small,
.attachment-folder-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}
.confirm-modal { width: min(460px, 100%); }
.confirm-modal .modal-body p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }

.empty {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.notice {
  padding: 12px 14px;
  border: 1px solid #a8d9d2;
  border-radius: 8px;
  color: #08433e;
  background: var(--accent-soft);
  font-weight: 800;
  margin-bottom: 14px;
}

.notice.error { border-color: #efb5ad; color: #7a1f17; background: var(--danger-soft); }
.notice.success { border-color: #b6e4c8; color: #17633a; background: var(--success-soft); }
.notice.hidden { display: none; }

@media (max-width: 1120px) {
  :root { --invoice-grid: 58px minmax(300px, 1.35fr) 104px 104px minmax(176px, auto); }
  .task-board {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .sidebar {
    grid-template-columns: 1fr;
    grid-template-rows: 104px auto auto;
    gap: 8px;
    background:
      linear-gradient(#0f1216 0 104px, #eef1f5 104px 100%);
  }
  .utility-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0 2px 4px;
    scrollbar-width: none;
  }
  .workflow-nav {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .workflow-nav::-webkit-scrollbar,
  .utility-nav::-webkit-scrollbar { display: none; }
  .workflow-nav .nav {
    min-width: min(30vw, 156px);
  }
  .utility-nav .nav {
    flex: 0 0 auto;
    min-width: 42px;
    padding: 0 10px;
  }
  .utility-nav .nav span {
    display: none;
  }
  main { padding: 22px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-donuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .smart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  html,
  body,
  #app {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    grid-template-rows: auto auto;
    align-content: start;
    grid-auto-rows: auto;
  }

  .file-input-native {
    position: static;
    width: 100%;
    height: auto;
    opacity: 1;
    pointer-events: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .file-dropzone {
    min-height: 54px;
    padding: 12px;
  }

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

  .task-grid {
    grid-template-columns: 1fr;
  }

  .task-board {
    grid-auto-flow: column;
    grid-auto-columns: min(340px, 82vw);
    grid-template-columns: none;
    scroll-snap-type: x mandatory;
  }

  .task-column {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .task-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .task-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .task-filter-bar button {
    flex: 0 0 auto;
  }

  .quick-task-form,
  .task-inline-fields {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "head actions"
      "meta actions"
      "progress actions"
      "context context"
      "tags tags";
    padding-right: 7px;
  }

  .task-card-head {
    align-items: flex-start;
    flex-direction: row;
  }

  .task-card-status {
    max-width: 76px;
    overflow: hidden;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .task-due-chip {
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }

  .task-actions {
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    width: auto;
  }

  .task-actions .compact-action {
    min-width: 42px;
    padding: 0 7px;
  }

  .task-actions .danger-icon {
    width: 30px;
    height: 30px;
  }

  .sidebar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px;
    min-height: 0;
    padding: 0 12px 10px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    background:
      linear-gradient(#0f1216 0 58px, #eef1f5 58px 100%);
  }

  .brand {
    grid-column: 1;
    width: calc(100% + 24px);
    min-height: 58px;
    padding: 0 12px;
    gap: 0;
    margin: 0 -12px;
    justify-content: center;
    text-align: center;
  }

  .brand strong {
    width: 100%;
    overflow: hidden;
    font-size: clamp(18px, 5.8vw, 24px);
    line-height: 1;
    letter-spacing: .08em;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small {
    margin-top: 5px;
    font-size: 10px;
    letter-spacing: .14em;
  }

  .workflow-nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    justify-self: stretch;
    scrollbar-width: none;
  }

  .workflow-nav::-webkit-scrollbar,
  .utility-nav::-webkit-scrollbar {
    display: none;
  }

  .workflow-nav .nav {
    display: inline-grid;
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    align-items: center;
    justify-items: center;
    flex: 1 0 104px;
    min-width: 104px;
    min-height: 44px;
    padding: 5px 4px;
    font-size: 10px;
    gap: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.1;
  }

  .workflow-nav .nav::before {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .utility-nav {
    grid-column: 1;
    display: flex;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    justify-self: stretch;
    scrollbar-width: none;
  }

  .utility-nav .nav {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
  }

  .utility-nav .nav span {
    display: none;
  }

  .utility-nav svg {
    width: 18px;
    height: 18px;
  }

  main {
    width: 100%;
    max-width: 100%;
    padding: 12px;
  }

  header {
    align-items: center;
    flex-direction: column;
  }

  .header-actions { justify-content: center; }
  .chrome-right .header-actions { justify-content: flex-end; }
  .edit-popover {
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 24px);
    max-height: 76vh;
  }
  .chrome-right .edit-popover {
    left: auto;
    right: 12px;
    transform: none;
    width: calc(100vw - 24px);
  }
  .edit-popover-section .grid-form {
    grid-template-columns: 1fr;
  }
  .edit-popover-section .grid-form .span-2 {
    grid-column: span 1;
  }

  .dark-mode .sidebar {
    background:
      linear-gradient(#050607 0 58px, #0f1318 58px 100%);
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 0;
  }
  .period-controls { justify-content: flex-start; margin-left: 0; width: 100%; }
  .period-controls label { min-width: min(150px, 48%); }
  .period-controls.period-inline {
    width: auto;
    flex: 0 1 auto;
  }
  .period-controls.period-inline label {
    min-width: 0;
  }
  .period-controls.period-inline select {
    min-width: 70px;
  }
  .smart-panel-head {
    flex-direction: column;
    gap: 10px;
  }
  .dashboard-donuts {
    grid-template-columns: 1fr;
  }
  .view-help-grid {
    grid-template-columns: 1fr;
  }
  .tax-panel,
  .tax-grid,
  .smart-panel,
  .smart-grid { grid-template-columns: 1fr; }
  .smart-alert {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .table-head { display: none; }

  .row,
  .row.clients,
  .row.events,
  .row.production,
  .row.postproduction,
  .row.postproduction-event,
  .row.travels,
  .row.invoices,
  .row.payments,
  .row.expenses-row,
  .row.bank-connections {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    padding: 12px;
  }

  .row strong,
  .row p,
  .row span,
  .event-main,
  .invoice-main,
  .travel-main,
  .post-task-main,
  .production-mail-main {
    max-width: 100%;
  }

  .timeline-date {
    align-self: start;
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
    gap: 6px;
    width: fit-content;
    min-height: 0;
    padding: 0;
    border-right: 0;
  }

  .timeline-date::before {
    display: none;
  }

  .timeline-date span,
  .timeline-date strong {
    margin: 0;
  }

  .production-row-date {
    justify-content: flex-start;
    width: 100%;
  }

  .production-row-date span {
    width: auto;
  }

  .production-row-status,
  .production-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .pill,
  .action-hint {
    justify-self: start;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: left;
  }

  .actions,
  .header-actions,
  .toolbar-more-menu,
  .expense-filter-bar {
    max-width: 100%;
    min-width: 0;
  }

  .expense-icon-cell {
    justify-content: flex-start;
  }

  .expense-side,
  .expense-status-line,
  .expense-actions {
    justify-items: start;
    justify-content: flex-start;
    text-align: left;
  }

  .row.expenses-row {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas:
      "date main"
      "icon main"
      "side side"
      "actions actions";
    align-items: start;
    gap: 8px 10px;
    padding-right: 12px;
  }

  .row.expenses-row > .timeline-date {
    width: 34px;
  }

  .row.expenses-row > .expense-main {
    align-self: start;
  }

  .row.expenses-row > .expense-side {
    display: grid;
    grid-template-columns: minmax(0, auto) 1fr;
    align-items: center;
    justify-items: start;
    gap: 4px 10px;
    width: 100%;
    text-align: left;
  }

  .row.expenses-row > .expense-side .amount {
    font-size: 16px;
    line-height: 1.1;
  }

  .row.expenses-row > .expense-side small {
    grid-column: 1 / -1;
  }

  .row.expenses-row > .expense-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
    max-width: none;
  }

  .row.expenses-row > .expense-actions > button,
  .row.expenses-row > .expense-actions .action-menu,
  .row.expenses-row > .expense-actions .action-menu > button {
    width: 100%;
  }

  #expenses {
    padding-bottom: 142px;
  }

  #expenses .floating-upload {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-height: 46px;
    max-width: min(210px, calc(100vw - 96px));
    padding: 0 16px;
  }

  .row.invoices .actions,
  .actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .row .actions,
  .expense-actions,
  .production-row-actions,
  .calendar-event-actions {
    justify-content: center;
    text-align: center;
  }

  .row .actions {
    justify-self: center;
  }

  .row.invoices > .amount,
  .table-head.invoices span:nth-child(3) {
    text-align: left;
  }

  .row.invoices > .pill {
    justify-self: start;
  }

    body .row.invoices {
      grid-template-columns: 48px minmax(0, 1fr) auto;
      grid-template-areas:
        "date main actions"
        "date amount status";
      align-items: center;
      min-height: 0;
      padding: 10px;
      gap: 6px 10px;
    }

    body .row.invoices > .timeline-date {
      grid-area: date;
      align-self: center;
      width: 48px;
      min-height: 46px;
      grid-template-columns: 1fr;
      justify-items: center;
    }

    body .row.invoices > div:not(.actions) { grid-area: main; }
    body .row.invoices > .amount { grid-area: amount; }
    body .row.invoices > .pill {
      grid-area: status;
      justify-self: end;
    }
    body .row.invoices > .actions {
      grid-area: actions;
      justify-self: end;
      justify-content: flex-end;
      flex-wrap: nowrap;
    }

    body .row.invoices .compact-action {
      min-height: 34px;
      padding: 0 10px;
    }

    body .row.invoices .invoice-meta {
      align-items: center;
      flex-direction: row;
      flex-wrap: wrap;
      gap: 4px 6px;
      margin: 3px 0 0;
    }

    body .row.invoices .invoice-meta > span {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
      white-space: normal;
    }

  .post-event-head,
  .post-task-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .post-event-card,
  .post-task-card,
  .production-mail,
  .smart-alert,
  .panel,
  .card {
    max-width: 100%;
    overflow: hidden;
  }

  .post-task-list {
    padding-left: 24px;
  }

  .post-task-dot {
    position: absolute;
    top: 12px;
    left: -18px;
    width: 28px;
    height: 28px;
  }

  .file-preview-modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .file-preview-body {
    overflow: auto;
    place-items: start center;
  }

  .file-preview-body iframe {
    width: 100%;
    min-height: 74dvh;
  }

  .file-preview-body.is-pdf {
    padding: 8px;
  }

  

  .pdf-page-stack img,
  .pdf-page-stack canvas {
    max-width: none;
    border-radius: 2px;
  }

  

  .production-timeline {
    --timeline-axis: 13px;
  }

  .production-mail {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-left: 28px;
  }

  .production-mail::before {
    left: var(--timeline-axis);
  }

  .production-mail-time {
    padding-top: 0;
    text-align: left;
  }

  .production-mail-time span {
    justify-self: start;
  }

  .production-mail-head {
    grid-template-columns: 1fr;
  }

  .invoice-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .invoice-meta > span {
    white-space: normal;
  }

  .action-menu > div {
    left: auto;
    right: 0;
    max-width: min(280px, calc(100vw - 28px));
  }

  .events-calendar {
    overflow-x: hidden;
    padding-bottom: 4px;
    max-width: 100%;
  }

  .calendar-pager,
  .calendar-month {
    min-width: 0;
    width: 100%;
  }

  .calendar-pager {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 6px;
  }

  .calendar-pager button {
    width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .calendar-day {
    min-height: 58px;
    padding: 3px;
    border-radius: 6px;
  }

  .calendar-event {
    padding: 3px;
    border-radius: 5px;
  }

  .calendar-event-title {
    font-size: 10px;
    line-height: 1.15;
  }

  .calendar-event-meta .amount,
  .calendar-event-actions {
    display: none;
  }

  .calendar-event-meta .pill {
    min-height: 16px;
    padding: 1px 5px;
    min-width: 0;
    font-size: 8px;
  }
}

@media (max-width: 620px) {
    main {
    padding: 10px;
  }
  h1 { font-size: 24px; }
  .calendar-pager strong,
  .calendar-month-head h3,
  .month-head h3 {
    font-size: 22px;
  }
    .sidebar {
    gap: 8px;
    padding: 0 10px 8px;
    background: linear-gradient(#0f1216 0 56px, #eef1f5 56px 100%);
    grid-template-columns: 1fr;
  }

    .dark-mode .sidebar {
    background: linear-gradient(#050607 0 56px, #0f1318 56px 100%);
  }
  .brand,
  .utility-nav,
  .workflow-nav {
    grid-column: 1;
  }
    .brand {
    width: calc(100% + 24px);
    min-height: 56px;
    margin: 0 -12px;
    padding: 0 10px;
    min-width: 0;
    justify-content: center;
    text-align: center;
  }

    .brand strong {
    font-size: clamp(18px, 6vw, 23px);
    letter-spacing: .08em;
    width: 100%;
    text-align: center;
  }

    .utility-nav {
    gap: 6px;
    padding-bottom: 2px;
    justify-content: stretch;
    width: 100%;
  }

    .workflow-nav {
    gap: 6px;
    width: 100%;
    padding-bottom: 2px;
  }

    .workflow-nav .nav {
    flex: 1 0 96px;
    min-width: 96px;
    min-height: 44px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 9px;
    grid-template-columns: 1fr;
    gap: 2px;
  }

    .workflow-nav .nav::before {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

    .utility-nav .nav {
    flex: 0 0 38px;
    width: 100%;
    min-height: 38px;
  }

  .grid,
  form.grid-form,
  .grid-form,
  .expense-editor {
    grid-template-columns: 1fr;
  }
  .invoice-line-row {
    grid-template-columns: minmax(0, 1fr) 110px 34px;
  }
  .span-2 { grid-column: auto; }
  .panel,
  .card {
    padding: 12px;
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .toolbar .actions {
    width: 100%;
    justify-content: flex-start;
  }
  .toolbar .actions > * {
    max-width: 100%;
  }
  .actions button,
  .actions .button-link {
    flex: 0 1 auto;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
  }

  .actions .icon,
  .actions .danger-icon,
  .utility-nav .icon-only {
    flex: 0 0 36px;
    width: 36px;
    padding: 0;
  }

  
  .toolbar-more,
  .filter-more {
    display: block;
    width: 100%;
  }
  .toolbar-more summary,
  .filter-more summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #eef2f6;
    font-weight: 850;
    cursor: pointer;
    list-style: none;
  }
  .toolbar-more summary::-webkit-details-marker,
  .filter-more summary::-webkit-details-marker {
    display: none;
  }
  .toolbar-more summary::after,
  .filter-more summary::after {
    content: "▾";
    margin-left: 8px;
    color: var(--muted);
    font-size: 12px;
  }
  .toolbar-more[open] summary::after,
  .filter-more[open] summary::after {
    transform: rotate(180deg);
  }
  .toolbar-more:not([open]) > .toolbar-more-menu,
  .filter-more:not([open]) > .expense-filter-bar {
    display: none;
  }
  .toolbar-more-menu {
    justify-content: flex-start;
    margin-top: 8px;
  }
  .filter-more .expense-filter-bar {
    margin-top: 8px;
  }
    button,
  .button-link {
    min-height: 34px;
    max-width: 100%;
  }
  .modal-backdrop { padding: 12px; }
  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
  }
  .modal-head,
  .modal-actions,
  .modal-body { padding: 14px; }

  .floating-upload {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-height: 42px;
    max-width: calc(100vw - 24px);
    padding: 0 14px;
  }

  .scroll-top,
  .scroll-bottom {
    right: max(12px, env(safe-area-inset-right));
    width: 42px;
    min-height: 42px;
  }

  .scroll-top {
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 58px);
  }

  .scroll-bottom {
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .calendar-weekdays {
    gap: 2px;
  }

  .calendar-weekdays span {
    font-size: 9px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .calendar-day {
    grid-template-rows: auto minmax(36px, 1fr);
    min-height: 50px;
    padding: 2px;
  }

  .calendar-day-number {
    min-width: 17px;
    min-height: 17px;
    font-size: 9px;
  }

  .calendar-event {
    padding: 2px;
  }

  .calendar-event-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 8px;
  }
}

@media (max-width: 620px) {
    body .sidebar {
    gap: 6px;
    padding: 0 10px 8px;
    background: linear-gradient(#050607 0 46px, var(--bg) 46px 100%);
  }

    body.dark-mode .sidebar {
    background: linear-gradient(#050607 0 46px, var(--bg) 46px 100%);
  }

    body .brand {
    width: calc(100% + 20px);
    min-height: 46px;
    margin: 0 -10px;
    padding: 0 10px;
  }

    body .brand strong {
    font-size: clamp(17px, 5.2vw, 21px);
    letter-spacing: .12em;
  }

    body .workflow-nav .nav {
    flex: 1 0 96px;
    min-width: 96px;
    min-height: 38px;
    padding: 3px 5px;
    border-radius: 999px;
    font-size: 9px;
  }

    body .utility-nav .nav,
  body .header-actions button {
    flex: 0 0 38px;
    width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 999px;
  }

    body main {
    padding: 8px;
  }

    body header {
    position: sticky;
    top: 0;
    z-index: 22;
    margin: 0 -8px 8px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px);
  }

    body .header-actions {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding: 0 2px 1px;
    scrollbar-width: none;
  }

    body .header-actions::-webkit-scrollbar {
    display: none;
  }

    body .view.is-working {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }

    body .view.is-working::before {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 35;
    max-width: min(260px, calc(100vw - 20px));
    margin: 0;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 10px;
  }

    body .toast-root {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: min(300px, calc(100vw - 20px));
  }

    body .toast {
    padding: 8px 8px 8px 10px;
    border-radius: 10px;
  }

    body .toast strong {
    -webkit-line-clamp: 2;
    font-size: 12px;
  }

    body #production .panel {
    padding: 12px;
    border-radius: 12px;
  }

    body #production .toolbar {
    gap: 8px;
    margin-bottom: 8px;
  }

    body #production .toolbar h2 {
    font-size: 25px;
    line-height: 1;
  }

    body #production .toolbar .actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    width: 100%;
  }

    body #production .toolbar .actions .muted {
    grid-column: 1 / -1;
    font-size: 14px;
    line-height: 1.28;
  }

    body #production .toolbar .actions button {
    width: 100%;
    min-height: 40px;
  }

    body #production .toolbar .actions button:first-of-type {
    color: var(--ink);
    background: var(--surface-soft);
  }

    body #production .month-section {
    margin-top: 12px;
  }

    body #production .month-head h3 {
    font-size: 31px;
    line-height: 1;
  }

    body #production .row.production {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "date main actions"
      ". status actions";
    gap: 8px 10px;
    padding: 10px;
    border-radius: 11px;
  }

    body #production .row.production > .timeline-date {
    grid-area: date;
  }

    body #production .row.production > .event-main-cell {
    grid-area: main;
    align-items: start;
    gap: 9px;
  }

    body #production .row.production > .production-row-status {
    grid-area: status;
    justify-content: flex-start;
  }

    body #production .row.production > .production-row-actions {
    grid-area: actions;
    align-self: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
  }

    body #production .event-main-cell img,
  body #production .event-logo,
  body #production .client-logo {
    width: 42px;
    height: 42px;
    max-width: 42px;
    border-radius: 9px;
  }

    body #production .event-main-cell strong {
    font-size: 17px;
    line-height: 1.1;
  }

    body #production .event-main-cell p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.25;
  }

    body #production .timeline-date {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
  }

    body #production .timeline-date span {
    font-size: 10px;
  }

    body #production .timeline-date strong {
    width: 34px;
    min-width: 34px;
    height: 34px;
    font-size: 18px;
  }

    body #production .production-row-actions .icon,
  body #production .production-row-actions .attachment-action {
    width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 10px;
  }

    body #production .production-row-actions .action-hint {
    max-width: 96px;
    min-height: 30px;
    padding: 0 8px;
    text-align: center;
    font-size: 11px;
    line-height: 1.05;
  }

    body #production .production-row-status .pill {
    min-height: 26px;
    padding: 0 12px;
    font-size: 12px;
  }
}
body.worker-mode .nav:not([data-view='events']):not([data-view='production']),
body.worker-mode [data-action='go-invoices'],
body.worker-mode [data-action='go-postproduction'],
body.worker-mode [data-action='go-settings-email'],
body.worker-mode [data-action='undo-last'],
body.worker-mode [data-action='open-floating-view'],
body.worker-mode [data-action='tile-floating-windows'],
body.worker-mode [data-action='window-presets'],
body.worker-mode [data-action='toggle-edit-popover'],
body.worker-mode [data-action='set-ui-mode'],
body.worker-mode #privacy-toggle,
body.worker-mode #theme-toggle,
body.worker-mode #ui-mode-toggle,
body.worker-mode #edit-popover,
body.worker-mode #floating-view-button,
body.worker-mode #tile-windows-button,
body.worker-mode #window-presets-button {
}
body.worker-mode .app-shell {
  --worker-accent: #0f766e;
}

.production-message-detail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.production-detail-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.production-detail-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.production-detail-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.production-detail-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.12;
}

.production-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.production-detail-meta span,
.production-detail-summary,
.production-detail-attention {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 84%, transparent);
  margin: 0;
  padding: 8px 10px;
}

.production-detail-meta span {
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-detail-meta strong,
.production-detail-attention strong {
  color: var(--text);
  margin-right: 5px;
}

.production-detail-summary,
.production-detail-attention {
  color: var(--muted);
  font-weight: 750;
}

.production-detail-attention {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  color: var(--text);
}

.production-detail-body .mail-body-text {
  margin: 0;
  min-height: 0;
  max-height: min(62vh, 760px);
  padding: 14px 16px;
  line-height: 1.45;
}

.production-message-detail + .stacked-list,
.production-message-detail + .empty {
  margin-top: 0;
}

@media (max-width: 760px) {
  
  
  
}

/* Postproduction alignment polish: keep task rows scannable and compact. */
.post-task-list {
  position: relative;
  display: grid;
  gap: 8px;
  padding-left: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.post-task-list::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 5px;
  width: 2px;
  background: var(--line);
}

.post-task-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(300px, 1fr) 148px minmax(220px, max-content) max-content;
  gap: 8px 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  grid-template-areas: "dot main status label actions";
}

.post-task-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: #fff;
  grid-area: dot;
}

.post-task-main {
  min-width: 0;
  grid-area: main;
}

.post-task-main strong,
.post-task-main p {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-task-card > .pill {
  grid-area: status;
  justify-self: start;
  min-width: 132px;
  text-align: center;
}

.post-task-label {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  grid-area: label;
  justify-self: start;
  max-width: 340px;
  white-space: normal;
}

.post-task-card > .actions {
  grid-area: actions;
  justify-self: end;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.post-task-card .compact-action:not(.icon-only-action) {
  min-width: 82px;
}

@media (max-width: 1120px) {
  .post-task-card {
    grid-template-columns: 32px minmax(220px, 1fr) max-content max-content;
    grid-template-areas:
      "dot main status actions"
      "dot label label actions";
  }

  .post-task-card > .pill {
    min-width: 0;
  }

  .post-task-label {
    max-width: none;
  }
}

@media (max-width: 760px) {
    .post-task-list {
    padding-left: 24px;
    gap: 10px;
  }

    .post-task-list::before {
    display: none;
    left: 8px;
  }

    .post-task-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main"
      "status"
      "label"
      "actions";
    gap: 7px 10px;
    align-items: start;
    padding: 10px 12px;
    overflow: hidden;
  }

    .post-task-dot {
    position: absolute;
    grid-area: dot;
    width: 28px;
    height: 28px;
    top: 12px;
    left: -18px;
  }

    .post-task-card > .actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    justify-self: stretch;
  }
}

/* Postproduction event header alignment: match task-row rhythm. */
.post-event-head {
  display: grid;
  grid-template-columns: 86px minmax(360px, 1fr) 168px max-content;
  gap: 10px 14px;
  align-items: center;
  grid-template-areas: "date main status actions";
}

.post-event-head > .timeline-date {
  grid-area: date;
}

.post-event-head > .event-main-cell {
  grid-area: main;
  min-width: 0;
}

.post-event-head > .pill {
  grid-area: status;
  justify-self: start;
  min-width: 150px;
  text-align: center;
}

.post-event-head > .actions {
  grid-area: actions;
  justify-self: end;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

@media (max-width: 1120px) {
  .post-event-head {
    grid-template-columns: 78px minmax(0, 1fr) max-content;
    grid-template-areas:
      "date main actions"
      "date status actions";
  }

  .post-event-head > .pill {
    min-width: 0;
  }
}

@media (max-width: 760px) {
    .post-event-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    grid-template-areas: "date"
      "main"
      "status"
      "actions";
  }

  .post-event-head > .actions {
    justify-self: stretch;
    flex-wrap: wrap;
  }
}

/* Global compact search */
.global-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: min(260px, 28vw);
  min-width: 180px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
}

.global-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.global-search input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.global-search .mini-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
}

@media (max-width: 760px) {
  .global-search {
    order: 10;
    width: 100%;
    min-width: 0;
  }
}

/* Compact desktop chrome polish */
@media (min-width: 980px) {
  .sidebar {
    grid-template-columns: minmax(0, auto) minmax(430px, 1fr) minmax(300px, auto);
    grid-template-rows: 68px auto;
    gap: 8px 14px;
    min-height: 128px;
    padding: 0 18px 10px;
    background: linear-gradient(#07090b 0 68px, var(--bg) 68px 100%);
  }

  .brand {
    min-height: 68px;
    padding: 0 18px;
    margin: 0 -18px;
    background: #07090b;
  }

  .brand strong {
    font-size: clamp(28px, 3.1vw, 46px);
    line-height: 1;
  }

  .brand small,
  .brand .mark {
    display: none;
  }

  .workflow-nav {
    justify-content: flex-end;
    gap: 7px;
  }

  .workflow-nav .nav {
    min-width: 118px;
    min-height: 36px;
    padding: 0 13px;
    gap: 7px;
  }

  .utility-nav {
    justify-content: flex-start;
    gap: 6px;
    overflow: visible;
  }

  .utility-nav .nav {
    width: 40px;
    min-width: 40px;
    min-height: 36px;
    padding: 0;
    gap: 0;
  }

  .utility-nav .nav span {
    display: none;
  }

  .utility-nav svg {
    width: 17px;
    height: 17px;
  }

  .utility-nav .nav.active {
    width: 46px;
    min-width: 46px;
  }

  main {
    padding-top: 16px;
  }

  .view.active {
    gap: 10px;
  }

  #invoices > .grid:first-child {
    gap: 10px;
    margin-bottom: -2px;
  }

  #invoices > .grid:first-child .metric {
    min-height: 86px;
    padding: 14px 16px;
  }

  #invoices > .grid:first-child .metric strong {
    margin-top: 8px;
    font-size: 21px;
  }
}

@media (min-width: 980px) and (max-width: 1320px) {
  .sidebar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 60px auto auto;
    min-height: 150px;
  }

  .brand {
    min-height: 60px;
  }

  .workflow-nav,
  .utility-nav {
    grid-column: 1;
    justify-content: center;
  }
}

/* Expenses mobile alignment rescue */
@media (max-width: 920px) {
  #expenses .row.expenses-row {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas:
      "main side"
      "actions actions";
    align-items: start;
    gap: 8px 12px;
    padding: 12px;
  }

  #expenses .row.expenses-row > .timeline-date,
  #expenses .row.expenses-row > .expense-icon-cell {
    display: none;
  }

  #expenses .row.expenses-row > .expense-main {
    grid-area: main;
    min-width: 0;
    align-self: start;
    text-align: left;
  }

  #expenses .expense-main strong,
  #expenses .expense-main p,
  #expenses .expense-link-line {
    text-align: left;
  }

  #expenses .expense-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #expenses .expense-main p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.22;
  }

  #expenses .row.expenses-row > .expense-side {
    grid-area: side;
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 3px;
    min-width: 86px;
    width: auto;
    text-align: right;
  }

  #expenses .expense-side .amount {
    font-size: 16px;
    line-height: 1;
  }

  #expenses .expense-status-line,
  #expenses .expense-side small {
    max-width: 96px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.12;
    text-align: right;
  }

  #expenses .row.expenses-row > .expense-actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  #expenses .row.expenses-row > .expense-actions > button,
  #expenses .row.expenses-row > .expense-actions .action-menu > button {
    width: auto;
    min-width: 132px;
  }

  #expenses .row.expenses-row > .expense-actions .action-menu {
    width: auto;
  }
}

@media (max-width: 520px) {
  #expenses .row.expenses-row {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 8px 10px;
  }

  #expenses .row.expenses-row > .expense-actions > button,
  #expenses .row.expenses-row > .expense-actions .action-menu > button {
    min-width: 0;
    flex: 1 1 0;
  }
}

/* Postproduction command polish */
@media (min-width: 900px) {
  #postproduction .post-event-head {
    grid-template-columns: 86px minmax(360px, 1fr) 190px max-content;
    grid-template-areas: "date main status actions";
    column-gap: 16px;
  }

  #postproduction .post-task-card {
    grid-template-columns: 34px minmax(360px, 1fr) 190px max-content;
    grid-template-areas: "dot main status actions";
    column-gap: 16px;
    min-height: 58px;
    padding: 9px 10px;
  }

  #postproduction .post-task-label {
    display: none;
  }

  #postproduction .post-event-head > .pill,
  #postproduction .post-task-card > .pill {
    grid-area: status;
    justify-self: end;
    align-self: center;
    min-width: 168px;
    max-width: 168px;
    min-height: 28px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 28px;
    text-align: center;
  }

  #postproduction .post-event-head > .actions,
  #postproduction .post-task-card > .actions {
    grid-area: actions;
    justify-self: end;
    align-self: center;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0;
  }

  #postproduction .post-task-card .compact-action,
  #postproduction .post-event-head .compact-action {
    min-width: 78px;
    min-height: 34px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 900;
  }

  #postproduction .post-task-card .icon-only-action {
    min-width: 34px;
    width: 34px;
    padding: 0;
  }

  #postproduction .post-task-main strong,
  #postproduction .post-task-main p,
  #postproduction .event-main-cell strong,
  #postproduction .event-main-cell p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 900px) and (max-width: 1280px) {
  #postproduction .post-event-head,
  #postproduction .post-task-card {
    grid-template-columns: 72px minmax(260px, 1fr) 160px max-content;
  }

  #postproduction .post-event-head > .pill,
  #postproduction .post-task-card > .pill {
    min-width: 148px;
    max-width: 148px;
  }
}

/* Postproduction dedupe event pills */


#postproduction .post-event-head > .pill {
  display: none;
}



@media (max-width: 1280px) {
  #postproduction .post-event-head {
    grid-template-columns: 72px minmax(260px, 1fr) max-content;
  }
}

@media (max-width: 760px) {
  
}

/* Postproduction action rail polish - final alignment pass */










#postproduction .post-task-list::before {
  left: 14px;
  opacity: .45;
}



#postproduction .post-task-card:first-child {
  border-top: 0 !important;
}



#postproduction .post-task-main {
  grid-area: main !important;
  min-width: 0;
}



#postproduction .post-task-label {
  display: none !important;
}









@media (max-width: 1120px) {
  

  

  

  #postproduction .post-task-card > .actions {
    grid-template-columns: minmax(70px, 1fr) 38px minmax(70px, 1fr);
  }

  #postproduction .post-task-card > .actions .icon-only-action {
    width: 38px !important;
    min-width: 38px !important;
  }
}

@media (max-width: 760px) {
  

  

  

  

  

  

  
}
/* Postproduction slim action rail - undo bulky button feel */
#postproduction .post-event-card {
  padding: 10px 16px 8px !important;
}

#postproduction .post-event-head {
  grid-template-columns: 84px minmax(0, 1fr) auto !important;
  grid-template-areas: "date main actions" !important;
  column-gap: 14px !important;
  align-items: center;
  min-height: 54px !important;
}

#postproduction .post-event-head > .actions {
  grid-area: actions;
  justify-self: end !important;
  display: inline-flex !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px !important;
  width: auto !important;
}

#postproduction .post-event-head > .actions .compact-action {
  width: auto !important;
  min-width: 86px !important;
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 13px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
}

#postproduction .post-task-list {
  padding: 6px 0 0 72px !important;
  gap: 0 !important;
  padding-top: 2px !important;
  padding-left: 66px !important;
}

#postproduction .post-task-card {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) auto auto !important;
  grid-template-areas: "dot main status actions" !important;
  align-items: center !important;
  gap: 8px 12px !important;
  min-height: 48px !important;
  padding: 7px 0 7px 14px !important;
  border: 0 !important;
  border-top: 1px solid rgba(148, 163, 184, .16) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#postproduction .post-task-dot {
  grid-area: dot !important;
  position: static !important;
  width: 30px !important;
  height: 30px !important;
}

#postproduction .post-task-main strong {
  font-size: 14px !important;
  line-height: 1.1 !important;
}

#postproduction .post-task-main p {
  font-size: 13px !important;
  line-height: 1.15 !important;
}

#postproduction .post-task-card > .pill {
  grid-area: status !important;
  justify-self: end !important;
  align-self: center !important;
  width: auto !important;
  max-width: 140px !important;
  min-width: 112px !important;
  height: 28px !important;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  padding: 0 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
}

#postproduction .post-task-card > .actions {
  grid-area: actions !important;
  justify-self: end !important;
  width: auto !important;
  display: inline-flex !important;
  grid-template-columns: minmax(78px, 1fr) 42px minmax(78px, 1fr);
  gap: 7px !important;
  align-items: center;
  justify-content: flex-end !important;
}

#postproduction .post-task-card > .actions .compact-action {
  width: auto !important;
  min-width: 72px !important;
  min-height: 34px !important;
  padding-inline: 12px !important;
  border-radius: 7px !important;
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
}

#postproduction .post-task-card > .actions .icon-only-action {
  width: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  height: 34px !important;
}

#postproduction .post-task-card > .actions .compact-action:not(.icon-only-action):last-child:nth-child(2) {
  grid-column: auto !important;
}

#postproduction .post-task-card > .actions .compact-action[data-action="mark-worker-expense-paid"],
#postproduction .post-task-card > .actions .compact-action[data-action="send-email"] {
  min-width: 76px !important;
}

@media (max-width: 1120px) {
    #postproduction .post-event-head {
    grid-template-columns: 72px minmax(0, 1fr) auto !important;
  }

    #postproduction .post-task-list {
    padding-left: 48px !important;
  }

    #postproduction .post-task-card {
    grid-template-columns: 34px minmax(0, 1fr) auto auto !important;
    gap: 8px 10px !important;
  }
}

@media (max-width: 760px) {
  

  

  

  #postproduction .post-task-card > .pill,
  #postproduction .post-task-card > .actions {
    justify-self: start !important;
  }
}

/* Worker access management */
.worker-access-card { gap: 14px; }
.worker-user-list { display: grid; gap: 8px; }
.worker-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .28);
}
.worker-user-row.is-disabled { opacity: .58; }
.worker-user-row .actions { display: inline-flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.worker-user-row .compact-action { min-height: 32px; padding: 0 11px; font-size: 12px; }
body.worker-mode #settings,
body.worker-mode #dashboard,
body.worker-mode #expenses,
body.worker-mode #postproduction,
body.worker-mode #tasks,
body.worker-mode #travels,
body.worker-mode #files,
body.worker-mode #invoices { display: none !important; }
@media (max-width: 760px) {
  .worker-user-row { grid-template-columns: minmax(0, 1fr); }
  .worker-user-row .actions { justify-content: flex-start; }
}

/* Narrow-pane rescue: keep data rows readable instead of showing orphan amount columns */
@media (max-width: 860px) {
  body .panel .row.events,
  body .panel .row.travels,
  body .panel .row.invoices,
  body .panel .row.expenses,
  body .floating-view-clone .row.events,
  body .floating-view-clone .row.travels,
  body .floating-view-clone .row.invoices,
  body .floating-view-clone .row.expenses {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 7px !important;
    min-height: 0 !important;
    padding: 10px 12px !important;
    border-radius: 9px !important;
    overflow: hidden !important;
  }

  body .panel .row.events > *,
  body .panel .row.travels > *,
  body .panel .row.invoices > *,
  body .panel .row.expenses > *,
  body .floating-view-clone .row.events > *,
  body .floating-view-clone .row.travels > *,
  body .floating-view-clone .row.invoices > *,
  body .floating-view-clone .row.expenses > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body .panel .row.events .date-badge,
  body .panel .row.travels .date-badge,
  body .floating-view-clone .row.events .date-badge,
  body .floating-view-clone .row.travels .date-badge {
    justify-self: start !important;
    width: auto !important;
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  body .panel .row.events .event-main-cell,
  body .panel .row.travels .event-main-cell,
  body .floating-view-clone .row.events .event-main-cell,
  body .floating-view-clone .row.travels .event-main-cell {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 9px !important;
    align-items: center !important;
  }

  body .panel .row strong,
  body .panel .row p,
  body .panel .row .muted,
  body .panel .row .travel-event,
  body .floating-view-clone .row strong,
  body .floating-view-clone .row p,
  body .floating-view-clone .row .muted,
  body .floating-view-clone .row .travel-event {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body .panel .row .amount,
  body .floating-view-clone .row .amount,
  body .panel .row > span:not(.pill):not(.muted):not(.travel-event),
  body .floating-view-clone .row > span:not(.pill):not(.muted):not(.travel-event) {
    justify-self: start !important;
    text-align: left !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  body .panel .row .pill,
  body .floating-view-clone .row .pill {
    justify-self: start !important;
    min-height: 26px !important;
    height: 26px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }

  body .panel .row .actions,
  body .panel .row .production-row-actions,
  body .floating-view-clone .row .actions,
  body .floating-view-clone .row .production-row-actions {
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 0 !important;
  }

  body .panel .row .actions button,
  body .panel .row .actions .button,
  body .floating-view-clone .row .actions button,
  body .floating-view-clone .row .actions .button {
    min-height: 30px !important;
    height: 30px !important;
    padding: 0 10px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
  }

  body .panel .row.travels.needs-checkin,
  body.dark-mode .panel .row.travels.needs-checkin,
  body .floating-view-clone .row.travels.needs-checkin {
    background: color-mix(in srgb, #7c2d12 18%, var(--panel) 82%) !important;
    border-color: rgba(251, 191, 36, .32) !important;
  }
}


/* Mobile PDF viewer with real zoom controls */
.invoice-pdf-modal { grid-template-rows: auto minmax(0, 1fr) auto; }
.invoice-preview-body.is-pdf { display: block; overflow: auto; padding: 12px; }
.file-preview-body.is-pdf {
  display: block;
  padding: 12px;
  background: #eef1f5;
  overscroll-behavior: contain;
}
.pdf-controls {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 12px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  backdrop-filter: blur(16px) saturate(1.2);
  touch-action: manipulation;
  -webkit-overflow-scrolling: touch;
}
.pdf-controls button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.pdf-page-stack {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: max-content;
  min-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px;
}
.pdf-page-stack canvas { transform-origin: top center; }
@media (max-width: 860px) {
  .invoice-preview-modal,
  .invoice-pdf-modal,
  .file-preview-modal {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .invoice-preview-body.is-pdf,
  .file-preview-body.is-pdf {
    padding: 6px !important;
    overflow: auto !important;
    place-items: initial !important;
  }
    .pdf-controls {
    max-width: calc(100vw - 12px) !important;
    overflow-x: auto;
    justify-content: flex-start !important;
    position: sticky;
    top: 0;
    width: calc(100vw - 12px) !important;
    margin: 0 0 8px !important;
    padding: 6px !important;
    border-radius: 10px !important;
  }
  .pdf-controls button {
    min-height: 34px !important;
    height: 34px !important;
    padding: 0 11px !important;
    font-size: 13px !important;
  }
  .pdf-controls [data-pdf-zoom="in"],
  .pdf-controls [data-pdf-zoom="out"] {
    width: 38px !important;
    min-width: 38px !important;
    font-size: 19px !important;
  }
  .pdf-zoom-label {
    min-width: 58px !important;
    font-size: 12px !important;
  }
    .pdf-page-stack {
    gap: 8px !important;
    justify-items: start !important;
    align-items: start !important;
    width: max-content !important;
    min-width: 100% !important;
    padding: 0 0 12px !important;
  }
  .pdf-page-stack canvas {
    max-width: none !important;
    border-radius: 2px !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .2) !important;
  }
  .file-preview-modal .modal-actions,
  .invoice-pdf-modal .modal-actions {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .file-preview-modal .modal-actions > *,
  .invoice-pdf-modal .modal-actions > * {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }
}


/* Invoice and PDF mobile preview cleanup */
.invoice-html-modal {
  width: min(1120px, calc(100vw - 28px));
  height: min(92vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.invoice-html-modal .invoice-preview-body {
  min-height: 0;
  overflow: auto;
  background: var(--surface-soft);
}
.invoice-html-modal .invoice-preview-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
@media (max-width: 860px) {
  .invoice-html-modal {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .invoice-html-modal .invoice-preview-body {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .invoice-html-modal .invoice-preview-body iframe {
    width: 100% !important;
    height: 100% !important;
  }
}


/* Postproduction mobile compact correction */
@media (max-width: 760px) {
  #postproduction .panel { padding-inline: 10px !important; }
  #postproduction .toolbar { gap: 8px !important; }
  #postproduction .toolbar > .actions { gap: 8px !important; }
    #postproduction .post-event-card {
    padding: 9px 10px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }
  
  
  #postproduction .post-event-head > .timeline-date::before, #postproduction .post-event-head > .timeline-date span { display: none !important; }
  #postproduction .post-event-head > .timeline-date strong { width: 31px !important; height: 31px !important; margin: 0 !important; font-size: 15px !important; line-height: 1 !important; }
  #postproduction .post-event-head .event-main-cell { grid-area: main !important; display: grid !important; grid-template-columns: 56px minmax(0, 1fr) !important; gap: 8px !important; align-items: center !important; min-width: 0 !important; }
  #postproduction .post-event-head .event-main-cell img, #postproduction .post-event-head .event-logo, #postproduction .post-event-head .logo-box { width: 52px !important; height: 52px !important; border-radius: 8px !important; }
  #postproduction .post-event-head .event-main-cell strong { display: block !important; max-width: 100% !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; font-size: 13.5px !important; line-height: 1.05 !important; letter-spacing: 0 !important; font-weight: 950 !important; }
  #postproduction .post-event-head .event-main-cell p { margin-top: 3px !important; max-width: 100% !important; font-size: 10.5px !important; line-height: 1.14 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  
  #postproduction .post-event-head > .actions .compact-action { min-width: 0 !important; width: 100% !important; height: 34px !important; min-height: 34px !important; padding: 0 10px !important; font-size: 13px !important; }
    #postproduction .post-task-list {
    padding-left: 0 !important;
    padding: 7px 0 0 42px !important;
    gap: 0 !important;
  }
  #postproduction .post-task-list::before { display: none !important; }
    #postproduction .post-task-card {
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    grid-template-areas: "dot main actions" !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 8px 0 !important;
    margin-top: 8px;
    min-height: 42px !important;
    display: grid !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    border-top: 1px solid rgba(148, 163, 184, .18) !important;
    background: transparent !important;
    box-shadow: none !important;
  }
    #postproduction .post-task-card:first-child {
    border-top: 1px solid rgba(148, 163, 184, .18) !important;
  }
  #postproduction .post-task-dot { grid-area: dot !important; width: 25px !important; height: 25px !important; position: static !important; }
  #postproduction .post-task-main { grid-area: main !important; min-width: 0 !important; }
  #postproduction .post-task-main strong { font-size: 15px !important; line-height: 1.05 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  #postproduction .post-task-main p { margin-top: 2px !important; font-size: 12px !important; line-height: 1.1 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  #postproduction .post-task-card > .pill, #postproduction .post-task-label { display: none !important; }
    #postproduction .post-task-card > .actions {
    grid-template-columns: minmax(76px, 1fr) 40px minmax(76px, 1fr);
    grid-area: actions !important;
    justify-self: end !important;
    display: inline-flex !important;
    width: auto !important;
    gap: 6px !important;
  }
  #postproduction .post-task-card > .actions .compact-action { width: auto !important; min-width: 78px !important; height: 34px !important; min-height: 34px !important; padding: 0 11px !important; font-size: 13px !important; border-radius: 7px !important; }
  #postproduction .post-task-card > .actions .icon-only-action { width: 34px !important; min-width: 34px !important; padding: 0 !important; }
}


/* Events mobile layout correction */
@media (max-width: 760px) {
  

  

  
  

  

  

  #events .row.events > .event-main-cell img,
  #events .row.events > .event-main-cell .event-logo,
  #events .row.events > .event-main-cell .logo-box {
    width: 42px !important;
    height: 42px !important;
    border-radius: 8px !important;
    object-fit: contain !important;
  }

  

  

  

  

  

  #events .row.events .event-indicators .pill,
  #events .row.events .event-indicators .calendar-shortcut {
    max-width: 145px !important;
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  

  

  

  

  

  

  #events .row.events .action-menu,
  #events .row.events .calendar-plus-menu {
    justify-self: end !important;
  }
}


/* Mobile modal close action always reachable */
@media (max-width: 760px) {
    .modal-backdrop {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    align-items: stretch !important;
    place-items: stretch !important;
  }

    .modal {
    width: 100% !important;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top) + env(safe-area-inset-bottom))) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .modal-head {
    flex: 0 0 auto !important;
  }

    .modal-body {
    overflow-x: hidden;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 88px !important;
  }

  .modal-actions {
    position: sticky !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 5 !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    padding: 10px max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) 12px !important;
    background: color-mix(in srgb, var(--surface-soft) 94%, transparent) !important;
    backdrop-filter: blur(12px) saturate(1.1);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, .08) !important;
  }

  .modal-actions .close,
  .modal-actions button.close,
  .modal-actions button[type="button"]:only-child {
    min-width: 86px !important;
    min-height: 44px !important;
    font-size: 14px !important;
  }
}


/* Events mobile hard reset */
@media (max-width: 760px) {
  

  

  
  
  

  

  #events .row.events > .event-main-cell .event-logo,
  #events .row.events > .event-main-cell img.event-logo,
  #events .row.events > .event-main-cell .event-logo-empty {
    display: none !important;
  }

  

  

  

  

  

  

  

  

    #events .row.events > .actions .compact-action {
    min-width: 48px !important;
    width: auto !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }

    #events .row.events > .actions .compact-action:not(.icon-only-action) {
    min-width: 76px !important;
  }

    #events .row.events > .actions .icon-only-action {
    width: 48px !important;
    min-width: 48px !important;
    padding: 0 !important;
  }
}


/* Production mobile hard reset */
@media (max-width: 760px) {
  

  

  
  
  

  

  #production .row.production > .event-main-cell .event-logo,
  #production .row.production > .event-main-cell img.event-logo,
  #production .row.production > .event-main-cell .event-logo-empty {
    display: none !important;
  }

  

  

  

  #production .row.production .new-badge {
    display: inline-grid !important;
    min-height: 18px !important;
    margin: 4px 0 0 0 !important;
    padding: 0 8px !important;
    font-size: 10px !important;
  }

  

  

  

  #production .row.production > .production-row-actions .action-hint,
  #production .row.production > .production-row-actions .action-hint-button {
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 124px) !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 0 10px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #production .row.production > .production-row-actions .icon,
  #production .row.production > .production-row-actions .attachment-action,
  #production .row.production > .production-row-actions .production-view-action {
    width: 42px !important;
    min-width: 42px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 7px !important;
  }
}


/* Immediate action feedback */
.has-pending-action {
  cursor: progress;
}

.is-updating {
  position: relative !important;
  pointer-events: none;
  opacity: .72;
  transition: opacity .12s ease, transform .12s ease, filter .12s ease;
}

.is-updating:not(.modal)::after {
  content: "Actualizando";
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px 0 25px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.is-updating:not(.modal)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 7;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 45%, var(--accent) 55%, transparent 100%);
  background-size: 220% 100%;
  animation: sweepBar 1.15s ease-in-out infinite;
}

@keyframes sweepBar {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

.is-removing {
  opacity: .48;
  filter: grayscale(.35);
  transform: scale(.992);
}

button.is-action-pending,
button[aria-busy="true"] {
  opacity: 1 !important;
  pointer-events: none;
}

button.is-action-pending:not(.icon-only-action):not(.icon) {
  padding-right: 34px !important;
}

button.is-action-pending::after,
button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 999px;
  background: currentColor;
  animation: procPulse .9s ease-in-out infinite;
}

@media (max-width: 760px) {
  .is-updating:not(.modal)::after {
    right: 8px;
    bottom: 6px;
    min-height: 22px;
    padding: 0 8px 0 23px;
    font-size: 10px;
  }

  .is-updating:not(.modal)::before {
    right: calc(8px + 88px);
    bottom: 11px;
    width: 10px;
    height: 10px;
  }
}

/* Sticky navigation compact correction 20260705 */


body.auth-loading .sidebar,
body.auth-locked .sidebar {
  position: static !important;
}

body:not(.auth-loading):not(.auth-locked) .sidebar {
  position: sticky !important;
  top: 0 !important;
  z-index: 120 !important;
  isolation: isolate;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08) !important;
}

body:not(.auth-loading):not(.auth-locked) main > header {
  position: sticky !important;
  top: var(--ec-desktop-nav-height) !important;
  z-index: 118 !important;
  margin-top: 0 !important;
  background: color-mix(in srgb, var(--bg) 88%, transparent) !important;
  backdrop-filter: blur(16px) saturate(1.04) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent) !important;
  box-shadow: 0 10px 18px rgba(15, 23, 42, .045) !important;
}

@media (min-width: 980px) {
  body:not(.auth-loading):not(.auth-locked) .sidebar {
    grid-template-rows: 58px 48px !important;
    min-height: var(--ec-desktop-nav-height) !important;
    padding: 0 18px 9px !important;
    gap: 7px 12px !important;
    background: linear-gradient(#07090b 0 58px, color-mix(in srgb, var(--bg) 94%, transparent) 58px 100%) !important;
    backdrop-filter: blur(18px) saturate(1.08) !important;
  }

  body:not(.auth-loading):not(.auth-locked) .brand {
    min-height: 58px !important;
    padding: 0 18px !important;
    margin: 0 -18px !important;
  }

  body:not(.auth-loading):not(.auth-locked) .brand strong {
    font-size: clamp(25px, 2.55vw, 38px) !important;
    letter-spacing: .12em !important;
  }

  body:not(.auth-loading):not(.auth-locked) .workflow-nav .nav {
    min-height: 34px !important;
    min-width: 116px !important;
    padding: 0 12px !important;
  }

  body:not(.auth-loading):not(.auth-locked) .utility-nav .nav {
    width: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
  }

  body:not(.auth-loading):not(.auth-locked) main > header {
    top: var(--ec-desktop-nav-height) !important;
    padding: 7px 18px !important;
  }
}

@media (max-width: 760px) {
  

  body:not(.auth-loading):not(.auth-locked) .sidebar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 54px 48px 48px !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: calc(var(--ec-mobile-nav-height) + env(safe-area-inset-top)) !important;
    padding: env(safe-area-inset-top) 10px 8px !important;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent) !important;
    background: color-mix(in srgb, var(--bg) 91%, transparent) !important;
    backdrop-filter: blur(18px) saturate(1.08) !important;
  }

  body:not(.auth-loading):not(.auth-locked) .brand {
    grid-column: 1 !important;
    min-height: 54px !important;
    height: 54px !important;
    margin: 0 -10px !important;
    padding: 0 10px !important;
    border-radius: 0 0 14px 14px !important;
    background: #07090b !important;
  }

  body:not(.auth-loading):not(.auth-locked) .brand strong {
    font-size: clamp(22px, 8.4vw, 34px) !important;
    line-height: 1 !important;
    letter-spacing: .13em !important;
  }

  body:not(.auth-loading):not(.auth-locked) .workflow-nav,
  body:not(.auth-loading):not(.auth-locked) .utility-nav {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body:not(.auth-loading):not(.auth-locked) .workflow-nav::-webkit-scrollbar,
  body:not(.auth-loading):not(.auth-locked) .utility-nav::-webkit-scrollbar {
    display: none !important;
  }

  body:not(.auth-loading):not(.auth-locked) .workflow-nav {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(118px, 1fr) !important;
    gap: 8px !important;
  }

  body:not(.auth-loading):not(.auth-locked) .workflow-nav .nav {
    width: auto !important;
    min-width: 118px !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
  }

  body:not(.auth-loading):not(.auth-locked) .workflow-nav .nav::before {
    width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
  }

  body:not(.auth-loading):not(.auth-locked) .utility-nav {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  body:not(.auth-loading):not(.auth-locked) .utility-nav .nav {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 999px !important;
  }

  body:not(.auth-loading):not(.auth-locked) .utility-nav .nav span {
    display: none !important;
  }

  body:not(.auth-loading):not(.auth-locked) main > header {
    top: calc(var(--ec-mobile-nav-height) + env(safe-area-inset-top)) !important;
    z-index: 119 !important;
    display: flex !important;
    justify-content: flex-end !important;
    padding: 7px 10px !important;
  }

  body:not(.auth-loading):not(.auth-locked) main > header .edit-bar {
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    margin-left: auto !important;
    padding: 5px !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--surface) 86%, transparent) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08) !important;
  }

  body:not(.auth-loading):not(.auth-locked) main > header .edit-bar button {
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 999px !important;
  }

  body:not(.auth-loading):not(.auth-locked) #notice {
    scroll-margin-top: calc(var(--ec-mobile-nav-height) + 64px + env(safe-area-inset-top)) !important;
  }
}

/* Fixed floating navigation and pressed nav state 20260706 */
:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #171b22;
  --muted: #68707d;
  --line: #e1e6ee;
  --line-strong: #c9d2df;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e7f5f2;
  --blue-soft: #eaf2ff;
  --blue-ink: #265985;
  --warn: #956019;
  --warn-soft: #fff4df;
  --danger: #b42318;
  --danger-soft: #fde8e4;
  --success: #137547;
  --success-soft: #e4f7ec;
  --shadow: 0 1px 2px rgba(20, 27, 36, .06);
  --topbar: 76px;
  --invoice-grid: 58px minmax(420px, 1.8fr) 104px 104px minmax(190px, auto);
  --ec-mobile-nav-height: 178px;
  --ec-desktop-nav-height: 124px;
  --ec-fixed-nav-height: 124px;
  --ec-fixed-actions-height: 58px;
  --ec-fixed-total-top: calc(var(--ec-fixed-nav-height) + var(--ec-fixed-actions-height));
}

body.app-ready:not(.auth-loading):not(.auth-locked) {
  padding-top: var(--ec-fixed-total-top) !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .sidebar {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  z-index: 500 !important;
  min-height: var(--ec-fixed-nav-height) !important;
  height: var(--ec-fixed-nav-height) !important;
  transform: none !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .10) !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) main > header {
  position: fixed !important;
  inset: var(--ec-fixed-nav-height) 0 auto 0 !important;
  z-index: 490 !important;
  min-height: var(--ec-fixed-actions-height) !important;
  height: var(--ec-fixed-actions-height) !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  background: color-mix(in srgb, var(--bg) 92%, transparent) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent) !important;
  backdrop-filter: blur(18px) saturate(1.08) !important;
  box-shadow: 0 10px 18px rgba(15, 23, 42, .045) !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) main {
  padding-top: 14px !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  color: #111418 !important;
  background: #fff !important;
  border: 1px solid color-mix(in srgb, #111418 10%, var(--line)) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04), inset 0 -1px 0 rgba(15, 23, 42, .04) !important;
  transform: translateY(0) !important;
  transition: background .14s ease, color .14s ease, border-color .14s ease, transform .12s ease, box-shadow .14s ease !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav::before {
  flex: 0 0 auto !important;
  display: inline-grid !important;
  place-items: center !important;
  margin: 0 !important;
  color: #111418 !important;
  background: #f0f2f5 !important;
  border: 1px solid #e2e6ec !important;
  line-height: 1 !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav:hover {
  border-color: rgba(17, 20, 24, .24) !important;
  background: #f7f8fa !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav.active {
  color: #fff !important;
  background: #07090b !important;
  border-color: #07090b !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .32), 0 1px 0 rgba(255, 255, 255, .24) !important;
  transform: translateY(1px) !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav.active::before {
  color: #07090b !important;
  background: #fff !important;
  border-color: rgba(255, 255, 255, .82) !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav .nav.active {
  color: #fff !important;
  background: #07090b !important;
  border-color: #07090b !important;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.30) !important;
  transform: translateY(1px) !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav .nav.active svg {
  stroke: currentColor !important;
}

body.app-ready:not(.auth-loading):not(.auth-locked) .edit-bar button.active,
body.app-ready:not(.auth-loading):not(.auth-locked) .edit-bar button[aria-pressed="true"] {
  color: #fff !important;
  background: #07090b !important;
  border-color: #07090b !important;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.30) !important;
}

@media (min-width: 980px) {
  :root {
    --ec-fixed-nav-height: 112px;
    --ec-fixed-actions-height: 54px;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .sidebar {
    grid-template-columns: minmax(0, auto) minmax(390px, 1fr) minmax(276px, auto) !important;
    grid-template-rows: 54px 42px !important;
    gap: 6px 12px !important;
    padding: 0 18px 8px !important;
    background: linear-gradient(#07090b 0 54px, color-mix(in srgb, var(--bg) 95%, transparent) 54px 100%) !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .brand {
    min-height: 54px !important;
    height: 54px !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .brand strong {
    font-size: clamp(26px, 2.6vw, 38px) !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav {
    min-height: 34px !important;
    height: 34px !important;
    min-width: 126px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav .nav {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 999px !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) main > header {
    padding: 7px 18px !important;
  }
}

@media (max-width: 760px) {
  

  

  

  

  

  

  

  

  body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav::-webkit-scrollbar,
  body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav::-webkit-scrollbar {
    display: none !important;
  }

  

  

  

  body.app-ready:not(.auth-loading):not(.auth-locked) main > header .edit-bar {
    max-width: calc(100vw - 20px) !important;
    padding: 5px !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) main > header .edit-bar button {
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 999px !important;
  }
}

/* Mobile chrome repair 20260706 */
@media (max-width: 760px) {
    :root {
    --ec-mobile-nav-height: 174px;
    --ec-fixed-nav-height: calc(160px + env(safe-area-inset-top));
    --ec-fixed-actions-height: 0px;
    --ec-fixed-total-top: var(--ec-fixed-nav-height);
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) {
    padding-top: var(--ec-fixed-nav-height) !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .sidebar {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 50px 44px 44px !important;
    gap: 6px !important;
    padding: env(safe-area-inset-top) 12px 8px !important;
    background: rgba(245, 247, 251, .96) !important;
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    z-index: 700 !important;
    width: 100vw !important;
    height: var(--ec-fixed-nav-height) !important;
    min-height: var(--ec-fixed-nav-height) !important;
    display: grid !important;
    align-items: center !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-bottom: 1px solid rgba(209, 216, 226, .9) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10) !important;
    backdrop-filter: blur(18px) saturate(1.08) !important;
  }

  body.dark-mode.app-ready:not(.auth-loading):not(.auth-locked) .sidebar {
    background: rgba(11, 16, 21, .96) !important;
    border-bottom-color: rgba(47, 60, 74, .95) !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .brand {
    height: 50px !important;
    min-height: 50px !important;
    border-radius: 0 !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: calc(100vw - 24px) !important;
    margin: 0 !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 0 !important;
    background: #07090b !important;
    box-shadow: none !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .brand strong {
    font-size: clamp(22px, 8vw, 33px) !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    color: #fff !important;
    line-height: 1 !important;
    letter-spacing: .11em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(122px, 1fr) !important;
    gap: 6px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 44px !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav {
    height: 44px !important;
    min-height: 44px !important;
    min-width: 0 !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    font-size: clamp(9px, 2.7vw, 12px) !important;
    white-space: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    color: #07090b !important;
    background: #fff !important;
    border: 1px solid rgba(17, 20, 24, .12) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .04), 0 1px 2px rgba(15, 23, 42, .04) !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav::before {
    width: 18px !important;
    height: 18px !important;
    font-size: 9px !important;
    flex: 0 0 18px !important;
    margin: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    color: #07090b !important;
    background: #f1f3f6 !important;
    border: 1px solid rgba(17, 20, 24, .08) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav.active {
    color: #fff !important;
    background: #07090b !important;
    border-color: #07090b !important;
    transform: translateY(1px) !important;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .36) !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav.active::before {
    color: #07090b !important;
    background: #fff !important;
    border-color: rgba(255, 255, 255, .82) !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    grid-column: 1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav .nav {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    color: var(--muted) !important;
    background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
    border: 1px solid color-mix(in srgb, var(--line) 82%, transparent) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05) !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav .nav span {
    display: none !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav .nav.active {
    color: #fff !important;
    background: #07090b !important;
    border-color: #07090b !important;
    transform: translateY(1px) !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,.34) !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) main > header {
    padding: 4px 0 !important;
    position: static !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .header-actions-toggle {
    display: inline-grid !important;
    place-items: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 999px !important;
    border: 1px solid color-mix(in srgb, var(--line) 82%, transparent) !important;
    background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
    color: var(--muted) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05) !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .header-actions-toggle svg {
    width: 16px !important;
    height: 16px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    transition: transform .18s ease !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .header-actions-toggle.is-open svg {
    transform: rotate(180deg) !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .header-actions.edit-bar {
    display: none !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .header-actions.edit-bar.is-open {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    margin-top: 6px !important;
    width: 100% !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) main {
    width: 100% !important;
    max-width: 100vw !important;
    padding-top: 10px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .view.active {
    scroll-margin-top: calc(var(--ec-fixed-nav-height) + 10px) !important;
  }
}

/* Mobile events card repair 20260706 */
@media (max-width: 760px) {
  #events .month-section {
    overflow: visible !important;
  }

  #events .month-list,
  #events .timeline-list,
  #events .panel {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  

  

    #events .row.events > .timeline-date::before {
    display: none !important;
  }

  

  

  

  

  

  

  

  

    #events .row.events .event-indicators {
    display: none !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-top: 5px !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

    #events .row.events > .amount {
    display: none !important;
  }

  

  

  

  #events .row.events > .actions .compact-action,
  #events .row.events > .actions .icon-only-action,
  #events .row.events > .actions .calendar-plus-menu > button,
  #events .row.events > .actions [data-action="toggle-more"] {
    display: grid !important;
    place-items: center !important;
    justify-content: center !important;
    align-content: center !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 10px !important;
    line-height: 1 !important;
    text-align: center !important;
  }

  

  

  #events .row.events .action-menu > div,
  #events .row.events .calendar-plus-menu > div {
    right: 0 !important;
    left: auto !important;
  }

  .scroll-top,
  .scroll-bottom {
    right: max(10px, env(safe-area-inset-right)) !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 999px !important;
    z-index: 180 !important;
  }

    .scroll-top {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    width: 46px;
    height: 46px;
  }

  .scroll-bottom {
    bottom: calc(18px + env(safe-area-inset-bottom)) !important;
  }
}

/* Mobile events logo compact repair 20260706 */
@media (max-width: 760px) {
  

  

  

  

  

  

    #events .row.events > .event-main-cell > div {
    min-width: 0 !important;
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  

  

    #events .row.events .new-badge {
    display: inline-grid !important;
    min-height: 20px !important;
    margin: 7px 0 0 !important;
    padding: 0 8px !important;
    font-size: 10px !important;
    vertical-align: top !important;
    place-items: center !important;
    width: fit-content !important;
    min-width: 48px !important;
    height: 20px !important;
    border-radius: 999px !important;
    line-height: 1 !important;
    margin-top: 5px !important;
  }

  

  

  

    #events .row.events > .actions .action-menu,
  #events .row.events > .actions .calendar-plus-menu {
    display: grid !important;
    place-items: center !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-self: end !important;
    align-self: start !important;
  }

  #events .row.events > .actions .icon-only-action,
  #events .row.events > .actions [data-action="toggle-more"] {
    display: grid !important;
    place-items: center !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    text-align: center !important;
  }

    #events .row.events > .actions [data-action="toggle-more"] svg,
  #events .row.events > .actions .icon-only-action svg {
    display: block !important;
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
}

/* Web app no zoom 20260706 */
html {
  min-width: 320px;
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable both-edges;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

button,
a,
.nav,
.compact-action,
.icon,
input,
select,
textarea,
[role="button"] {
  touch-action: manipulation;
}

@media (max-width: 760px) {
    input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Mobile events four column repair 20260706 */
@media (max-width: 760px) {
  

  

  

  

  

    #events .row.events > .event-main-cell .event-logo,
  #events .row.events > .event-main-cell img.event-logo,
  #events .row.events > .event-main-cell .event-logo-empty,
  #events .row.events > .event-main-cell > img,
  #events .row.events > .event-main-cell > picture {
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 7px !important;
    object-fit: contain !important;
    align-self: start !important;
    margin: 2px 0 0 0 !important;
    z-index: 0 !important;
  }

    #events .row.events > .event-main-cell strong {
    display: block !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    font-size: 13.5px !important;
    line-height: 1.05 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: var(--ink) !important;
    font-weight: 950 !important;
  }

    #events .row.events > .event-main-cell p {
    margin-top: 3px !important;
    max-width: 100% !important;
    font-size: 10.5px !important;
    line-height: 1.14 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 4px 0 0 !important;
  }

  

  

    #events .row.events > .actions .compact-action:not(.icon-only-action):not([data-action="toggle-more"]) {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 6px !important;
    font-size: 10.5px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  #events .row.events > .actions .action-menu,
  #events .row.events > .actions .calendar-plus-menu,
  #events .row.events > .actions .icon-only-action,
  #events .row.events > .actions [data-action="toggle-more"] {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }

  #events .row.events > .actions [data-action="toggle-more"] {
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
  }

  #events .row.events > .actions [data-action="toggle-more"] svg {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
  }
}

/* Mobile production restore compact 20260706 */
@media (max-width: 760px) {
    #production .row.production {
    grid-template-columns: 44px minmax(0, 1fr) 86px !important;
    grid-template-areas: "date main actions"
      "date status actions" !important;
    padding: 10px !important;
    display: grid !important;
    align-items: start !important;
    gap: 8px 9px !important;
    min-height: 112px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

    #production .row.production > .timeline-date {
    grid-area: date !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 0 !important;
    border: 0 !important;
    align-self: start !important;
    justify-self: center !important;
    display: grid !important;
    grid-template-rows: 13px 34px !important;
    place-items: center !important;
    overflow: hidden !important;
  }

    #production .row.production > .timeline-date::before {
    display: none !important;
  }

    #production .row.production > .timeline-date span {
    display: block !important;
    max-width: 38px !important;
    background: transparent !important;
    font-size: 8px !important;
    line-height: 13px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    width: 38px !important;
    height: 13px !important;
    text-align: center !important;
  }

    #production .row.production > .timeline-date strong {
    width: 32px !important;
    height: 32px !important;
    margin-top: 2px !important;
    font-size: 15px !important;
    display: grid !important;
    place-items: center !important;
    min-width: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    line-height: 1 !important;
  }

    #production .row.production > .event-main-cell {
    grid-area: main !important;
    display: grid !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 7px !important;
    align-items: start !important;
    overflow: hidden !important;
  }

  #production .row.production > .event-main-cell .event-logo,
  #production .row.production > .event-main-cell img.event-logo,
  #production .row.production > .event-main-cell .event-logo-empty,
  #production .row.production > .event-main-cell > img {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    border-radius: 7px !important;
    object-fit: contain !important;
  }

    #production .row.production > .event-main-cell > div {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

    #production .row.production > .event-main-cell strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 13.5px !important;
    line-height: 1.06 !important;
    letter-spacing: 0 !important;
  }

    #production .row.production > .event-main-cell p {
    display: block !important;
    margin-top: 3px !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10.5px !important;
    line-height: 1.15 !important;
  }

    #production .row.production > .production-row-status {
    grid-area: status !important;
    justify-self: start !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    align-self: start !important;
    overflow: hidden !important;
  }

    #production .row.production > .production-row-status .pill {
    max-width: 120px !important;
    min-height: 25px !important;
    height: 25px !important;
    padding: 0 9px !important;
    font-size: 11px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

    #production .row.production > .production-row-actions {
    grid-area: actions !important;
    display: grid !important;
    flex-flow: row wrap;
    justify-content: flex-start;
    gap: 7px !important;
    justify-self: end !important;
    flex-wrap: wrap !important;
    width: 86px !important;
    min-width: 86px !important;
    align-self: start !important;
    justify-items: end !important;
    max-width: 86px !important;
    overflow: visible !important;
  }

  #production .row.production > .production-row-actions .action-hint,
  #production .row.production > .production-row-actions .action-hint-button,
  #production .row.production > .production-row-actions .compact-action:not(.icon-only-action),
  #production .row.production > .production-row-actions .production-view-action:not(.icon-only-action) {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  #production .row.production > .production-row-actions .icon,
  #production .row.production > .production-row-actions .attachment-action,
  #production .row.production > .production-row-actions .icon-only-action {
    display: grid !important;
    place-items: center !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    border-radius: 10px !important;
  }

  #production .row.production > .production-row-actions .attachment-action svg,
  #production .row.production > .production-row-actions .icon-only-action svg {
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
  }
}

/* Mobile event date stack repair 20260706 */
@media (max-width: 760px) {
  

  

  #events .row.events > .timeline-date::before,
  #events .row.events > .timeline-date::after {
    display: none !important;
  }

    #events .row.events > .timeline-date span {
    display: block !important;
    max-width: 44px !important;
    font-size: 8px !important;
    line-height: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    background: transparent !important;
    width: 44px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--muted) !important;
    font-weight: 900 !important;
    text-align: center !important;
    position: static !important;
    transform: none !important;
  }

    #events .row.events > .timeline-date strong {
    width: 32px !important;
    height: 32px !important;
    margin-top: 2px !important;
    font-size: 15px !important;
    line-height: 1 !important;
    display: grid !important;
    place-items: center !important;
    min-width: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 999px !important;
    font-weight: 950 !important;
    text-align: center !important;
    z-index: 0 !important;
    position: static !important;
    transform: none !important;
    inset: auto !important;
  }

  

  
}
/* Mobile date badge unified repair 20260706 */
@media (max-width: 760px) {
  

  #events .row.events > .timeline-date::before,
  #events .row.events > .timeline-date::after,
  #postproduction .post-event-head > .timeline-date::before,
  #postproduction .post-event-head > .timeline-date::after {
    display: none !important;
  }

  

  

  
}

/* Mobile date no-overlap final 20260707 */
@media (max-width: 760px) {
  

  

    #events .row.events > .timeline-date,
  #postproduction .post-event-head > .timeline-date {
    grid-area: date !important;
    position: relative !important;
    transform: none !important;
    inset: auto !important;
    justify-self: start !important;
    align-self: start !important;
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 54px !important;
    min-height: 54px !important;
    display: grid !important;
    grid-template-rows: 16px 34px !important;
    justify-items: center !important;
    align-items: start !important;
    gap: 2px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    z-index: 1 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    translate: none !important;
    pointer-events: none !important;
  }

  

  

  #events .row.events > .event-main-cell,
  #postproduction .post-event-head > .event-main-cell {
    grid-area: main !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  #events .row.events > .event-main-cell .event-logo,
  #events .row.events > .event-main-cell img.event-logo,
  #postproduction .post-event-head .event-main-cell .event-logo,
  #postproduction .post-event-head .event-main-cell img.event-logo {
    position: static !important;
    transform: none !important;
    translate: none !important;
    z-index: 0 !important;
  }

  

  
}


/* Mobile date rail hard fix 20260707 */
@media (max-width: 760px) {
    #events .row.events {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 82px !important;
    grid-template-areas: "main actions"
      "state actions" !important;
    align-items: start !important;
    gap: 8px 8px !important;
    min-height: 110px !important;
    padding: 10px 8px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    column-gap: 8px !important;
    row-gap: 8px !important;
    padding-left: 78px !important;
  }

    #events .row.events > .timeline-date {
    grid-area: date !important;
    align-self: start !important;
    min-width: 54px !important;
    width: 54px !important;
    min-height: 52px !important;
    padding: 0 !important;
    border-right: 0 !important;
    max-width: 54px !important;
    border: 0 !important;
    justify-self: center !important;
    display: grid !important;
    grid-template-rows: 15px 33px !important;
    place-items: center !important;
    margin: 0 !important;
    overflow: hidden !important;
    z-index: 5 !important;
    position: absolute !important;
    transform: none !important;
    inset: auto !important;
    height: 52px !important;
    justify-items: center !important;
    align-items: start !important;
    gap: 2px !important;
    left: 12px !important;
    top: 12px !important;
    right: auto !important;
    bottom: auto !important;
    translate: none !important;
    pointer-events: none !important;
  }

    #events .row.events > .event-main-cell {
    grid-area: main !important;
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 7px !important;
    align-items: start !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    align-self: start !important;
    margin: 0 !important;
    overflow: hidden !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

    #events .row.events > .pill {
    grid-area: state !important;
    justify-self: start !important;
    align-self: start !important;
    width: auto !important;
    max-width: calc(100vw - 224px) !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    display: inline-grid !important;
    place-items: center !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-left: 39px !important;
  }

    #events .row.events > .actions {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: start !important;
    display: grid !important;
    grid-auto-rows: min-content !important;
    gap: 8px !important;
    width: 82px !important;
    min-width: 82px !important;
    place-items: center !important;
    max-width: 82px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    justify-items: end !important;
    align-items: start !important;
  }

    #postproduction .post-event-head {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "main"
      "actions" !important;
    row-gap: 8px;
    align-items: start !important;
    gap: 6px 8px !important;
    min-height: 74px !important;
    column-gap: 8px !important;
    display: grid !important;
    overflow: hidden !important;
    position: relative !important;
    padding-left: 78px !important;
  }

    #postproduction .post-event-head > .timeline-date {
    grid-area: date !important;
    align-self: start !important;
    min-width: 54px !important;
    min-height: 52px !important;
    padding: 0 !important;
    border-right: 0 !important;
    position: absolute !important;
    left: 8px !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    translate: none !important;
    width: 54px !important;
    max-width: 54px !important;
    height: 52px !important;
    display: grid !important;
    grid-template-rows: 15px 33px !important;
    justify-items: center !important;
    align-items: start !important;
    gap: 2px !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    z-index: 5 !important;
    pointer-events: none !important;
  }

  

  

  #postproduction .post-event-head > .event-main-cell {
    grid-area: main !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 8px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

    #postproduction .post-event-head > .actions {
    width: 100% !important;
    max-width: none !important;
    grid-area: actions !important;
    justify-self: stretch !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }
}

/* Mobile fix 20260714: el widget "Trabajo pendiente" del dashboard reutiliza .row.events
   pero vivía fuera del selector #events, así que nunca recibía el layout mobile de arriba
   y la fecha circular se montaba encima del texto. Mismo arreglo, con el scope correcto. */
@media (max-width: 760px) {
  #dashboard .row.events {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 82px !important;
    grid-template-areas:
      "main actions"
      "state actions" !important;
    column-gap: 8px !important;
    padding-left: 78px !important;
    min-height: 110px !important;
    overflow: hidden !important;
  }

  #dashboard .row.events > .timeline-date {
    position: absolute !important;
    left: 12px !important;
    top: 12px !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    translate: none !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 52px !important;
    min-height: 52px !important;
    display: grid !important;
    grid-template-rows: 15px 33px !important;
    justify-items: center !important;
    align-items: start !important;
    gap: 2px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    z-index: 5 !important;
    pointer-events: none !important;
  }

  #dashboard .row.events > .timeline-date span {
    position: static !important;
    display: block !important;
    width: 54px !important;
    height: 15px !important;
    max-width: 54px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: var(--muted) !important;
    font-size: 8px !important;
    font-weight: 850 !important;
    line-height: 15px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  #dashboard .row.events > .timeline-date strong {
    position: static !important;
    display: grid !important;
    place-items: center !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 999px !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    font-size: 15px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 5 !important;
  }

  #dashboard .row.events > .event-main-cell {
    grid-area: main !important;
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 7px !important;
    align-items: start !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #dashboard .row.events > .pill {
    grid-area: state !important;
    margin-left: 39px !important;
    max-width: calc(100vw - 224px) !important;
  }

  #dashboard .row.events > .actions {
    grid-area: actions !important;
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
  }
}


/* Mobile horizontal swipe containment 20260707 */
@media (max-width: 760px) {
  html,
  body,
  #app,
  main,
  .view {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    overscroll-behavior-x: none !important;
  }

    body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
    touch-action: pan-y !important;
  }

  body.is-view-swiping {
    overflow-x: hidden !important;
  }
}


/* Mobile production mail detail compact 20260707 */
@media (max-width: 760px) {
  .production-message-detail {
    gap: 8px !important;
  }

    .production-detail-topline {
    grid-template-columns: 1fr;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-bottom: 2px !important;
  }

    .production-detail-topline .actions {
    justify-content: flex-start;
    display: flex !important;
    gap: 6px !important;
    flex: 0 0 auto !important;
  }

  .production-detail-topline .actions button {
    min-height: 34px !important;
    height: 34px !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
  }

  .production-detail-title {
    min-width: 0 !important;
    display: block !important;
  }

  .production-detail-title span {
    display: none !important;
  }

  .production-detail-title strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
  }

  .production-detail-meta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    margin: 0 !important;
  }

    .production-detail-meta span {
    white-space: nowrap !important;
    display: block !important;
    min-height: 0 !important;
    padding: 7px 9px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .production-detail-summary {
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .production-detail-attention {
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
  }

  .production-detail-body {
    margin-top: 2px !important;
  }

  .production-detail-body .mail-body-text {
    padding: 12px !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }
}


/* Mobile date number visible final 20260707 */
@media (max-width: 760px) {
    #events .row.events > .timeline-date strong,
  #postproduction .post-event-head > .timeline-date strong {
    position: static !important;
    transform: none !important;
    inset: auto !important;
    display: grid !important;
    place-items: center !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #111827 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .18) !important;
    font-size: 15px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 5 !important;
    translate: none !important;
    border: 1px solid rgba(15, 23, 42, .10) !important;
    text-indent: 0 !important;
    -webkit-text-fill-color: #111827 !important;
  }

  body.dark-mode #events .row.events > .timeline-date strong,
  body.dark-mode #postproduction .post-event-head > .timeline-date strong {
    color: #f8fafc !important;
    background: #101720 !important;
    border-color: rgba(248, 250, 252, .14) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35) !important;
    -webkit-text-fill-color: #f8fafc !important;
  }

    #events .row.events > .timeline-date span,
  #postproduction .post-event-head > .timeline-date span {
    position: static !important;
    transform: none !important;
    display: block !important;
    width: 54px !important;
    max-width: 54px !important;
    height: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: #64748b !important;
    font-size: 8px !important;
    font-weight: 850 !important;
    line-height: 15px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: #64748b !important;
  }

  body.dark-mode #events .row.events > .timeline-date span,
  body.dark-mode #postproduction .post-event-head > .timeline-date span {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
  }
}


/* Timeline date badge hard markup 20260707 */
@media (max-width: 760px) {
  .timeline-date {
    color: inherit !important;
  }

  .timeline-date .date-badge-weekday,
  .timeline-date > span:first-child {
    display: block !important;
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-indent: 0 !important;
  }

  .timeline-date .date-badge-number,
  .timeline-date > strong {
    display: grid !important;
    place-items: center !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border-radius: 999px !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, .12) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .20) !important;
    font-size: 15px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-indent: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    filter: none !important;
    mix-blend-mode: normal !important;
  }

  body.dark-mode .timeline-date .date-badge-weekday,
  body.dark-mode .timeline-date > span:first-child {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
  }

  body.dark-mode .timeline-date .date-badge-number,
  body.dark-mode .timeline-date > strong {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: #111923 !important;
    border-color: rgba(255, 255, 255, .18) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42) !important;
  }
}


/* Modal and attachment preview above mobile chrome 20260707 */
.modal-backdrop,
.preview-backdrop,
.folder-backdrop {
  z-index: 5000 !important;
  isolation: isolate !important;
}

.modal-backdrop .modal,
.preview-backdrop .modal,
.folder-backdrop .modal,
.attachment-folder-modal,
.file-preview-modal,
.pdf-preview-modal,
.invoice-preview-modal {
  position: relative !important;
  z-index: 5001 !important;
}

@media (max-width: 760px) {
  body.modal-open .sidebar,
  body.modal-open main > header,
  body.modal-open .scroll-top,
  body.modal-open .floating-upload {
    pointer-events: none !important;
  }

  .folder-backdrop,
  .preview-backdrop,
  .modal-backdrop {
    align-items: stretch !important;
    place-items: stretch !important;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    background: rgba(3, 7, 12, .74) !important;
    backdrop-filter: blur(8px) saturate(1.05) !important;
  }

  .attachment-folder-modal,
  .file-preview-modal,
  .pdf-preview-modal,
  .invoice-preview-modal,
  .modal-backdrop > .modal {
    width: 100% !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }

  .attachment-folder-modal {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .attachment-folder-head {
    flex: 0 0 auto !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
  }

  .attachment-folder-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
  }

  .attachment-folder-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .attachment-folder-card {
    min-height: 76px !important;
    padding: 14px !important;
    text-align: left !important;
  }
}


/* Desktop geometry repair 20260707 */
@media (min-width: 761px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  

  body.app-ready:not(.auth-loading):not(.auth-locked) .view.active {
    scroll-margin-top: calc(var(--ec-fixed-total-top, 166px) + 18px) !important;
  }

  

  

  body.app-ready:not(.auth-loading):not(.auth-locked) .brand strong {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }

  

  

  

  .modal-backdrop:not(.floating-backdrop),
  .preview-backdrop:not(.floating-backdrop) {
    align-items: center !important;
    justify-items: center !important;
    padding: 24px !important;
  }

  .invoice-preview-modal,
  .invoice-pdf-modal,
  .invoice-html-modal,
  .file-preview-modal {
    width: min(1040px, calc(100vw - 56px)) !important;
    height: min(86dvh, 860px, calc(100dvh - 56px)) !important;
    max-width: calc(100vw - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
    min-width: min(420px, calc(100vw - 56px)) !important;
    min-height: min(360px, calc(100dvh - 56px)) !important;
    overflow: hidden !important;
  }

  .floating-backdrop .modal {
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100dvh - 32px) !important;
  }

  .floating-backdrop .invoice-preview-modal,
  .floating-backdrop .invoice-pdf-modal,
  .floating-backdrop .invoice-html-modal,
  .floating-backdrop .file-preview-modal {
    width: min(1040px, calc(100vw - 48px)) !important;
    height: min(84dvh, 840px, calc(100dvh - 48px)) !important;
    min-width: min(420px, calc(100vw - 48px)) !important;
    min-height: min(340px, calc(100dvh - 48px)) !important;
  }

  .invoice-preview-body,
  .file-preview-body,
  .invoice-html-modal .invoice-preview-body {
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: auto !important;
  }

  .invoice-preview-body iframe,
  .invoice-html-modal .invoice-preview-body iframe,
  .file-preview-body iframe {
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
  }

  .file-preview-body.is-pdf,
  .invoice-preview-body.is-pdf {
    display: block !important;
    overflow: auto !important;
    padding: 10px !important;
  }

  .pdf-controls {
    max-width: 100% !important;
  }

  
}

@media (min-width: 761px) and (max-width: 1180px) {
  body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav {
    max-width: calc(100vw - 360px) !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav {
    min-width: 112px !important;
    padding-inline: 12px !important;
  }
}


/* Desktop overlay and floating-window hard fix 20260707 */
@media (min-width: 761px) {
  :root {
    --ec-fixed-actions-height: 0px !important;
    --ec-fixed-total-top: var(--ec-fixed-nav-height, 112px) !important;
  }

  body.app-ready:not(.auth-loading):not(.auth-locked) {
    padding-top: var(--ec-fixed-nav-height, 112px) !important;
  }

  

  

  body.app-ready:not(.auth-loading):not(.auth-locked) main > header:empty {
    display: none !important;
    margin: 0 !important;
  }

  

  .floating-backdrop {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
    pointer-events: none !important;
    overflow: hidden !important;
  }

  

  .floating-backdrop .modal-head.is-draggable,
  .floating-backdrop .modal-head {
    touch-action: none !important;
    cursor: grab !important;
  }

  .floating-backdrop.is-dragging .modal-head {
    cursor: grabbing !important;
  }
}


/* Mobile production timeline containment 20260709 */
@media (max-width: 760px) {
  .modal-backdrop:not(.floating-backdrop) .modal-body,
  .modal-backdrop:not(.floating-backdrop) .grid-form,
  .modal-backdrop:not(.floating-backdrop) .production-timeline {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  

  .modal-backdrop:not(.floating-backdrop) .production-timeline::before {
    left: var(--timeline-axis) !important;
  }

  

  .modal-backdrop:not(.floating-backdrop) .production-mail::before {
    left: calc(var(--timeline-axis) - 5px) !important;
    top: 12px !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-time {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-time strong {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-time span {
    flex: 0 0 auto !important;
    justify-self: start !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-card,
  .modal-backdrop:not(.floating-backdrop) .production-mail-head,
  .modal-backdrop:not(.floating-backdrop) .production-mail-head > div,
  .modal-backdrop:not(.floating-backdrop) .mail-body-preview {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  

  

  .modal-backdrop:not(.floating-backdrop) .production-mail-card strong,
  .modal-backdrop:not(.floating-backdrop) .production-mail-card p,
  .modal-backdrop:not(.floating-backdrop) .production-mail-card .muted,
  .modal-backdrop:not(.floating-backdrop) .mail-body-preview {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  

  

  
}

/* CSS stability layer 20260710
   Final cascade layer for the current production issues:
   - desktop edit toolbar must never cover page content
   - top workflow nav must remain visually centered
   - floating windows must not jump while dragging
   - PDF previews open fitted to the available viewport
   - production timeline modals stay inside the mobile viewport
*/
@media (min-width: 761px) {
    body.app-ready:not(.auth-loading):not(.auth-locked) .sidebar {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 6px 14px !important;
    padding: 10px 28px 12px !important;
    column-gap: 18px !important;
    min-height: 92px !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .brand {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    justify-self: stretch !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    text-align: center !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: center !important;
    align-self: center !important;
    width: max-content !important;
    max-width: min(720px, calc(100vw - 420px)) !important;
    display: flex !important;
    justify-content: center !important;
    overflow: visible !important;
    margin-inline: auto !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav {
    grid-column: 3 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    align-self: center !important;
    max-width: calc((100vw - min(720px, calc(100vw - 420px))) / 2 - 42px) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    width: max-content !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) .utility-nav::-webkit-scrollbar {
    display: none !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) main {
    min-width: 0 !important;
    padding-top: 18px !important;
    scroll-padding-top: calc(var(--ec-fixed-total-top, 166px) + 18px) !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) main > header {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding-inline: clamp(18px, 2vw, 30px) !important;
    position: relative !important;
    inset: auto !important;
    z-index: 2 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    pointer-events: auto !important;
  }

    body.app-ready:not(.auth-loading):not(.auth-locked) main > header .edit-bar {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    max-width: min(520px, 100%) !important;
    margin: 0 !important;
    box-shadow: var(--shadow) !important;
  }

    .floating-backdrop .modal,
  .modal-backdrop.floating-backdrop .modal,
  .preview-backdrop.floating-backdrop .modal,
  .floating-backdrop .invoice-preview-modal,
  .floating-backdrop .invoice-pdf-modal,
  .floating-backdrop .invoice-html-modal,
  .floating-backdrop .file-preview-modal {
    position: fixed !important;
    left: var(--float-left, 96px) !important;
    top: var(--float-top, 88px) !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    pointer-events: auto !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
  }

  .invoice-preview-modal,
  .invoice-pdf-modal,
  .file-preview-modal {
    width: min(980px, calc(100vw - 64px)) !important;
    height: min(86dvh, 820px) !important;
  }

  .invoice-preview-body.is-pdf,
  .file-preview-body.is-pdf {
    overflow: auto !important;
    padding: 10px !important;
  }

    .pdf-page-stack {
    min-width: 0 !important;
    width: 100% !important;
    align-items: center !important;
  }

  .pdf-page-stack canvas,
  .pdf-page-stack img {
    max-width: 100% !important;
    height: auto !important;
  }
}

@media (max-width: 760px) {
  .modal-backdrop:not(.floating-backdrop) .modal,
  .preview-backdrop:not(.floating-backdrop) .modal,
  .folder-backdrop:not(.floating-backdrop) .modal {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    overflow: hidden !important;
  }

  .modal-backdrop:not(.floating-backdrop) .modal-body {
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  

  
}

/* Production modal mobile actions 20260710 */
@media (max-width: 760px) {
    .modal-backdrop:not(.floating-backdrop) .production-timeline {
    --timeline-axis: 10px !important;
    --timeline-dot-size: 10px !important;
    --timeline-dot-border: 2px !important;
    display: grid !important;
    gap: 8px !important;
    padding: 10px 8px 10px 18px !important;
    border-radius: 10px !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 6px !important;
    overflow: visible !important;
    padding-bottom: 12px !important;
  }

    .modal-backdrop:not(.floating-backdrop) .production-mail {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 5px !important;
    padding: 0 0 0 10px !important;
    margin: 0 !important;
    align-items: stretch !important;
    overflow: visible !important;
  }

  

    .modal-backdrop:not(.floating-backdrop) .production-mail-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 6px !important;
    align-items: start !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-card > p:not(.muted) {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-card .muted,
  .modal-backdrop:not(.floating-backdrop) .production-mail-card .chip-row,
  .modal-backdrop:not(.floating-backdrop) .mail-body-preview {
    display: none !important;
  }

  

  

  .modal-backdrop:not(.floating-backdrop) .modal-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 4 !important;
    margin-inline: -14px !important;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) !important;
    background: color-mix(in srgb, var(--surface) 92%, transparent) !important;
    border-top: 1px solid var(--line) !important;
    backdrop-filter: blur(10px) !important;
  }
}

/* Production modal compact readable actions 20260710 */
@media (max-width: 760px) {
    .modal-backdrop:not(.floating-backdrop) .production-mail-card {
    padding: 9px 10px !important;
    border-radius: 9px !important;
    overflow: visible !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: grid !important;
    gap: 6px !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-card .muted {
    display: block !important;
    margin: 0 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    color: color-mix(in srgb, currentColor 62%, transparent) !important;
  }

    .modal-backdrop:not(.floating-backdrop) .mail-body-preview {
    white-space: pre-wrap !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    max-height: 4.8em !important;
    overflow: hidden !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    color: color-mix(in srgb, currentColor 72%, transparent) !important;
    background: transparent !important;
    border: 0 !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-card .chip-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

    .modal-backdrop:not(.floating-backdrop) .production-mail-card .actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    margin-top: 2px !important;
  }

    .modal-backdrop:not(.floating-backdrop) .production-mail-card .actions button {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    min-height: 28px !important;
    padding: 0 9px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    line-height: 1 !important;
  }

  .modal-backdrop:not(.floating-backdrop) .production-mail-card .actions button[data-action="mark-production-attended"] {
    flex-basis: auto !important;
    min-width: 82px !important;
  }
}

/* Mobile fix 20260714: en #invoices, la regla "Narrow-pane rescue" (grid-template-columns:
   minmax(0,1fr) !important) colapsa la columna "date" a 0px porque compite con el
   grid-template-areas de 3 columnas de otra regla anterior. El badge de fecha (ancho fijo)
   se queda en una columna de 0px y su contenido se desborda encima de .invoice-main-cell.
   Se pasa la fila a flex-column con el badge posicionado en absoluto, igual que ya se
   arregló para #events. Selector con #invoices para ganar por especificidad sin tocar
   las reglas compartidas con .row.events/.row.travels/.row.expenses. */
@media (max-width: 760px) {
  #invoices .row.invoices {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding: 10px 10px 10px 62px !important;
    min-height: 0 !important;
  }

  #invoices .row.invoices > .timeline-date {
    position: absolute !important;
    left: 10px !important;
    top: 10px !important;
    right: auto !important;
    bottom: auto !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-right: 0 !important;
    z-index: 2 !important;
  }

  #invoices .row.invoices > .timeline-date::before { display: none !important; }

  #invoices .row.invoices > .timeline-date span {
    max-width: 44px !important;
    font-size: 9px !important;
  }

  #invoices .row.invoices > .timeline-date strong {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
  }

  #invoices .row.invoices > .invoice-main-cell,
  #invoices .row.invoices > div:not(.actions):not(.timeline-date) {
    width: 100% !important;
    min-width: 0 !important;
  }

  #invoices .row.invoices > .amount,
  #invoices .row.invoices > .pill {
    justify-self: auto !important;
    text-align: left !important;
  }

  #invoices .row.invoices > .actions {
    justify-self: auto !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Mobile fix 20260714: los botones de acción dentro de filas/tarjetas (Editar, Enviar
   email, Más, Crear factura...) quedaban en 26-38px de alto, por debajo del mínimo táctil
   recomendado de 44px. Se sube el alto mínimo solo dentro de listas/tarjetas (nunca en la
   cabecera fija, que tiene overflow:hidden y presupuesto de alto ajustado) para no arriesgar
   recortes. Los contextos que ya fijan su propio alto compacto con !important (p. ej. el
   chat de correos de producción) siguen ganando por especificidad/orden y no se ven afectados. */
@media (max-width: 760px) {
  body .panel .row .actions button,
  body .panel .row .actions .button,
  body .floating-view-clone .row .actions button,
  body .floating-view-clone .row .actions .button,
  .list .actions button,
  .post-event-card .actions button,
  .task-card .actions button,
  .expenses-row .actions button {
    min-height: 44px !important;
  }
}

/* Mobile fix 20260714: en Eventos/Postproducción el número del día no se veía (tapado por
   el logo del evento). Causa: una regla posterior y genérica ("Timeline date badge hard
   markup 20260707") fuerza display:grid + margin:0 auto en .date-badge-number, lo que rompe
   el centrado que ya tenía el badge dentro de .timeline-date y lo saca de su sitio. Se pasa
   .timeline-date a flex column (más predecible que grid anidado) y se resetea la posición de
   sus hijos, ganando por ir después en el CSS. Producción no tenía este problema porque su
   badge no usa las clases .date-badge-weekday/.date-badge-number que dispara esa regla. */
@media (max-width: 760px) {
  #events .row.events > .timeline-date,
  #dashboard .row.events > .timeline-date,
  #postproduction .post-event-head > .timeline-date {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 2px !important;
  }

  #events .row.events > .timeline-date > *,
  #dashboard .row.events > .timeline-date > *,
  #postproduction .post-event-head > .timeline-date > * {
    position: static !important;
    margin: 0 !important;
  }
}

/* Mobile fix 20260714 (pre-existente, no relacionado con la limpieza de hoy): en Gastos
   la etiqueta de estado ("Pago trabajador"...) se quedaba en ~34px de ancho y el texto se
   partía letra a letra. Causa: ".expense-side, .expense-status-line, .expense-actions"
   pone justify-items:start en el contenedor grid .expense-side, así que sus hijos se
   encogen a su ancho de contenido en vez de ocupar la columna; el contenido de la etiqueta
   (un <span class="pill"> en flex) calcula un ancho mínimo diminuto. Se fuerza a que ocupe
   toda la columna y se deja el texto en una sola línea. */
@media (max-width: 920px) {
  #expenses .expense-side {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #expenses .expense-side .expense-status-line {
    justify-self: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #expenses .expense-side .expense-status-line .pill {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: flex-start !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* Selector Asesor (facturas/gastos del trimestre) */
.asesor-pick-section {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.asesor-pick-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asesor-pick-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.asesor-pick-section-actions {
  display: flex;
  gap: 6px;
}

.asesor-pick-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.asesor-pick-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.asesor-pick-row.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.asesor-pick-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.asesor-pick-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.asesor-pick-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asesor-pick-main small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asesor-pick-amount {
  font-weight: 800;
  white-space: nowrap;
}

.asesor-pick-actions {
  margin-top: 14px;
}

/* Widget flotante de progreso de exportación: no bloquea la app, se puede cerrar sin cancelar el job */
.export-progress-widget {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 39;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(20, 27, 36, .18);
}

.export-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-progress-head strong {
  font-size: 13px;
}

.export-progress-widget p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.export-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}

.export-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width .25s ease;
}

.export-progress-download {
  justify-self: start;
}

.export-progress-error {
  color: var(--danger, #b3261e);
}

.export-progress-warning {
  color: #92400e;
}

@media (max-width: 760px) {
  .export-progress-widget {
    left: max(12px, env(safe-area-inset-left));
    bottom: max(84px, calc(12px + env(safe-area-inset-bottom)));
    width: calc(100vw - 24px);
  }
}


/* Postproduccion row: forced exact parity with Eventos/Produccion row style 20260717 */
@media (max-width: 760px) {
  #postproduction .post-event-head .event-main-cell {
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 7px !important;
    align-items: start !important;
    min-width: 0 !important;
    padding: 0 !important;
  }
  #postproduction .post-event-head .event-main-cell img,
  #postproduction .post-event-head .event-logo,
  #postproduction .post-event-head .logo-box {
    width: 32px !important;
    height: 32px !important;
    border-radius: 7px !important;
    object-fit: contain !important;
  }
  #postproduction .post-event-head .event-main-cell strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 13.5px !important;
    line-height: 14.175px !important;
    letter-spacing: normal !important;
    font-weight: 950 !important;
    color: var(--ink) !important;
    margin: 0 !important;
    text-transform: none !important;
  }
  #postproduction .post-event-head .event-main-cell p {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10.5px !important;
    line-height: 11.97px !important;
    letter-spacing: normal !important;
    font-weight: 400 !important;
    color: var(--muted) !important;
    margin: 4px 0 0 !important;
    text-transform: none !important;
  }
}


/* post-task-card: respond to the actual floating-window width, not viewport, 20260718 */
.post-task-card {
  container-type: inline-size;
}
@container (max-width: 700px) {
  .post-task-card {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    grid-template-areas:
      "dot main"
      "status status"
      "label label"
      "actions actions" !important;
    row-gap: 6px !important;
  }
  .post-task-card > .pill {
    justify-self: start !important;
    width: max-content !important;
    min-width: 0 !important;
  }
  .post-task-label {
    max-width: 100% !important;
    white-space: normal !important;
  }
  .post-task-card > .actions {
    justify-self: stretch !important;
    width: 100% !important;
    flex-wrap: wrap !important;
  }
  .post-task-card > .actions .compact-action {
    flex: 1 1 auto !important;
  }
}


/* workflow-nav pills: equal width on desktop, 20260718 */
@media (min-width: 761px) {
  body.app-ready:not(.auth-loading):not(.auth-locked) .workflow-nav .nav {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    justify-content: center !important;
  }
}


/* cola de trabajo priorizada en el panel principal, 20260803 */
.work-queue-panel {
  display: grid;
  gap: 14px;
}

.work-queue-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.work-queue-title h2 {
  margin: 2px 0 4px;
}

.work-queue-title .muted {
  margin: 0;
}

.work-queue-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.work-band {
  display: grid;
  gap: 8px;
  padding: 12px 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}

.work-band-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.work-band-head h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: .01em;
}

.work-band-head small {
  color: var(--muted);
}

.work-band-count {
  font-variant-numeric: tabular-nums;
  font-size: .82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.work-band-urgent { border-left-color: var(--danger); }
.work-band-now { border-left-color: var(--warn); }
.work-band-soon { border-left-color: var(--accent); }
.work-band-later { border-left-color: var(--line-strong); }

.work-item {
  display: grid;
  gap: 4px;
}

.work-item-why {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
}

.work-flag {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.work-item-urgent .work-flag {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.work-item-now .work-flag {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--warn-soft);
}

.work-item-soon .work-flag {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dashboard-metrics > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
  color: var(--muted);
}

.dashboard-metrics-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

@media (max-width: 760px) {
  .work-band {
    padding: 10px 8px 12px;
  }
  .work-queue-pager {
    justify-content: flex-start;
  }
}


/* Cotejo de movimientos bancarios.
   Cada veredicto con su color: lo que cuadra se lee de un vistazo y lo que no,
   tambien. Sin color, una tabla de treinta lineas obliga a leerlas todas para
   encontrar las tres que fallan. */
.tabla-cotejo { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.tabla-cotejo th {
  text-align: left; font-weight: 600; opacity: 0.55;
  padding: 0.25rem 0.4rem; position: sticky; top: 0;
  background: var(--panel, #16181d);
}
.tabla-cotejo td { padding: 0.2rem 0.4rem; border-top: 1px solid rgba(255,255,255,0.06); }
.tabla-cotejo tr.cot-ok   td { background: rgba(34, 197, 94, 0.10); }
.tabla-cotejo tr.cot-duda td { background: rgba(245, 158, 11, 0.10); }
.tabla-cotejo tr.cot-mal  td { background: rgba(239, 68, 68, 0.12); }
.tabla-cotejo tr.cot-repe td { opacity: 0.5; }
.tabla-cotejo td.muted, .tabla-cotejo .muted { opacity: 0.6; }
