:root {
  --bg: #f4f6f5;
  --surface: #fff;
  --soft: #eef3f1;
  --line: #d9e1e3;
  --ink: #253036;
  --muted: #66747b;
  --teal: #147d7f;
  --teal-dark: #0b5e63;
  --teal-soft: #d9eeee;
  --on-primary: #fff;
  --input-bg: #fff;
  --topbar-bg: rgba(255, 255, 255, 0.96);
  --tabs-bg: rgba(244, 246, 245, 0.96);
  --menu-text: #66747b;
  --coral: #cb5548;
  --coral-soft: #fde8e4;
  --green: #35845c;
  --green-soft: #dff0e7;
  --amber: #b7791f;
  --amber-soft: #fff2d8;
  --panel-dark: #424947;
  --navy-icon: #0b2f55;
  --shadow: 0 18px 50px rgba(37, 48, 54, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  overflow-x: hidden;
}

button, input, select, textarea { max-width: 100%; font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.55; cursor: progress; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.18rem; overflow-wrap: anywhere; }
h2 { font-size: 1.08rem; line-height: 1.25; }
h3 { font-size: 0.94rem; }
p { color: var(--muted); line-height: 1.45; }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  outline: none;
}

textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 125, 127, 0.14);
}
input[readonly] {
  background: var(--soft);
  color: var(--ink);
  cursor: default;
}
input.needs-config {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.field-hint {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.35;
}

.primary, .secondary, .ghost, .danger, .summary-button, .menu-button, .push-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 900;
}

.primary { background: var(--teal); color: var(--on-primary); }
.secondary { background: var(--teal-soft); color: var(--teal-dark); }
.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.danger { background: var(--coral-soft); border-color: var(--coral-soft); color: var(--coral); }
.danger:disabled { opacity: 0.45; cursor: not-allowed; }
.summary-button { background: var(--ink); color: #fff; }
.push-button { background: var(--green-soft); color: var(--green); border-color: var(--green-soft); }
.push-button.notification-off,
.app-tabs .notification-off {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-soft);
}
.push-button.notification-on,
.app-tabs .notification-on {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-soft);
}
.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.excel-mail-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 24px;
}
.excel-mail-icon svg {
  display: block;
  width: 34px;
  height: 24px;
}
.excel-mail-icon .icon-line {
  fill: none;
  stroke: #101416;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.excel-mail-icon .icon-fill-green {
  fill: #1f9d55;
}
.excel-mail-icon .icon-line-light {
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.excel-download-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}
.excel-download-icon svg {
  display: block;
  width: 30px;
  height: 30px;
}
.excel-download-icon .excel-file {
  fill: none;
  stroke: #6f777b;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.excel-download-icon .excel-badge,
.excel-download-icon .excel-arrow-fill {
  fill: #1f9d55;
}
.excel-download-icon .excel-arrow {
  fill: none;
  stroke: #1f9d55;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.excel-download-icon .excel-text {
  fill: #fff;
  font-family: Arial, sans-serif;
  font-size: 4.3px;
  font-weight: 900;
}
.push-button.notification-blocked,
.app-tabs .notification-blocked {
  background: var(--coral-soft);
  color: var(--coral);
  border-color: var(--coral-soft);
}
.push-button.notification-busy,
.app-tabs .notification-busy {
  background: var(--soft);
  color: var(--muted);
  border-color: var(--line);
}
.menu-button { background: #fff; border-color: var(--line); color: var(--ink); }
.button-badge, .nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--coral);
  color: var(--on-primary);
  font-size: 0.7rem;
  font-weight: 950;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand, .topbar, .section-title, .project-head, .dialog-head, menu {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; min-width: 0; }
.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 950;
}
.brand p { margin-top: 2px; font-size: 0.86rem; }

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.password-field input { min-width: 0; }
.password-field button {
  min-width: 78px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
}
.remember-field, .inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.remember-field input, .inline-check input {
  width: auto;
  min-height: 0;
  accent-color: var(--teal);
}
.error { min-height: 20px; color: var(--coral); font-weight: 850; }
.login-secondary { width: 100%; }

.app { min-height: 100vh; }
@supports (height: 100dvh) {
  .login,
  .app {
    min-height: 100dvh;
  }
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  max-width: 260px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.user-pill-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.user-pill-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 950;
  object-fit: cover;
  overflow: hidden;
}
.app-avatar {
  position: relative;
  background: var(--avatar-bg, var(--soft));
  border: 1px solid color-mix(in srgb, var(--avatar-bg, var(--teal)) 55%, #fff);
  box-shadow: inset 0 -8px 14px rgba(0, 0, 0, 0.08);
}
.app-avatar::before,
.app-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--avatar-fg, #fff);
}
.app-avatar::before {
  top: 21%;
  width: 34%;
  height: 34%;
  border-radius: 999px;
}
.app-avatar::after {
  bottom: 16%;
  width: 60%;
  height: 30%;
  border-radius: 999px 999px 45% 45%;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.user-pill strong, .user-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-pill strong { font-size: 0.84rem; }
.user-pill span { color: var(--muted); font-size: 0.74rem; font-weight: 850; }
.user-pill .user-pill-avatar {
  color: var(--teal-dark);
  font-size: 0.82rem;
}

.app-tabs {
  position: fixed;
  top: 75px;
  left: 0;
  bottom: 0;
  z-index: 9;
  display: grid;
  grid-auto-rows: min-content;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  width: 224px;
  overflow-y: auto;
  padding: 14px 12px 18px;
  border-right: 1px solid rgba(255,255,255,0.14);
  background: var(--panel-dark);
  box-shadow: 12px 0 28px rgba(37, 48, 54, 0.12);
  backdrop-filter: blur(14px);
}
.app-tabs.open { display: grid; }
.menu-button {
  display: none;
}
.app-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
  text-align: left;
  padding: 8px 10px;
}
.app-tabs button::before,
.mobile-actions button::before,
.notification-tools button::before {
  content: "";
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--navy-icon);
  border-radius: 999px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b2f55' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h12'/%3E%3Cpath d='M13 7l5 5-5 5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  box-shadow: 0 1px 4px rgba(11, 47, 85, 0.12);
}
.app-tabs button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--on-primary);
}
.mobile-actions, .mobile-menu-only { display: none; }

.main {
  width: calc(100% - 224px);
  max-width: none;
  margin-left: 224px;
  margin-right: 0;
  padding: 18px;
}

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

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.summary-card {
  width: 100%;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}
.summary-card:disabled { opacity: 0.8; cursor: default; }
.summary-card strong {
  display: block;
  color: var(--teal-dark);
  font-size: 1.3rem;
}
.summary-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}
.summary-dialog { width: min(520px, calc(100vw - 24px)); }
.summary-content { padding: 18px; }
.summary-dialog .summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.project-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.project-tools > .primary {
  min-height: 54px;
  align-self: start;
}
.toolbar-dropdown {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.toolbar-dropdown summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 14px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.toolbar-dropdown summary::-webkit-details-marker {
  display: none;
}
.toolbar-dropdown summary::after {
  content: "+";
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--teal-dark);
  font-size: 1.2rem;
  font-weight: 950;
  line-height: 1;
}
.toolbar-dropdown[open] summary::after {
  content: "-";
}
.toolbar-dropdown summary:hover,
.toolbar-dropdown summary:focus-visible {
  background: #f5fbfa;
}
.toolbar-dropdown summary > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.toolbar-dropdown summary strong {
  color: var(--ink);
  font-size: 0.98rem;
}
.toolbar-dropdown summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}
.toolbar-dropdown-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) minmax(150px, 220px) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.toolbar-dropdown .toolbar {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.status-filter {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}
.status-filter select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  font-weight: 900;
}
.filter-clear-action {
  min-height: 40px;
  align-self: end;
  white-space: nowrap;
}
.filter-clear-action:disabled {
  opacity: 0.5;
  cursor: default;
}
.filter-strip, .history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.filter-strip > *,
.history-head > * {
  min-width: 0;
}
.filter-strip span {
  color: var(--teal-dark);
  font-weight: 900;
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-card {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}
.project-card.active { box-shadow: 0 0 0 3px rgba(20, 125, 127, 0.12); }
.project-card-top, .project-card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.project-card h3 { overflow-wrap: anywhere; }
.project-card p { font-size: 0.88rem; }
.project-card-date {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}
.project-card-logistics {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(47, 128, 237, 0.22);
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.08);
  color: #1d5fbf;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
}
.project-card-logistics span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.project-card-logistics-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  font-size: 0.78rem;
}
.project-client-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.project-client-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.client-logo {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.client-logo-initial {
  display: inline-grid;
  place-items: center;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 950;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}
.Alta { color: var(--coral); background: var(--coral-soft); }
.Pendiente-aprobacion, .Pendiente { color: var(--amber); background: var(--amber-soft); }
.En-Curso { color: var(--teal-dark); background: var(--teal-soft); }
.Producido { color: #355f8c; background: #e4edf8; }
.Por-entregar-recoger { color: var(--amber); background: var(--amber-soft); }
.Aprobado, .Terminado, .Facturado, .Presupuesto-aceptado { color: var(--green); background: var(--green-soft); }
.Rechazado { color: var(--muted); background: var(--soft); }
.Pte-presupuesto, .Pte-aceptar-presupuesto, .Pte-facturar { color: var(--amber); background: var(--amber-soft); }

.empty-state, .project-detail, .admin-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.view[data-view-panel="settings"] .admin-panel {
  padding: 0;
  border: 0;
  background: var(--bg);
}
.empty-state { text-align: center; }

.project-detail {
  display: grid;
  gap: 14px;
  border-color: rgba(255,255,255,0.08);
  background: #444946;
}
.accordion {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(12, 20, 24, 0.2);
}
.accordion:nth-of-type(odd) {
  border-color: rgba(20, 125, 127, 0.24);
  background: #f5fbfb;
}
.accordion:nth-of-type(even) {
  border-color: rgba(196, 91, 74, 0.22);
  background: #fff8f4;
}
.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-weight: 950;
}
.accordion:nth-of-type(odd) summary {
  background: #eef8f8;
}
.accordion:nth-of-type(even) summary {
  background: #fff1e8;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 950;
}
.accordion[open] summary {
  border-bottom: 1px solid var(--line);
}
.accordion:nth-of-type(odd)[open] summary {
  border-bottom-color: rgba(20, 125, 127, 0.24);
}
.accordion:nth-of-type(even)[open] summary {
  border-bottom-color: rgba(196, 91, 74, 0.22);
}
.accordion[open] summary::after { content: "-"; }
.accordion summary > span,
.accordion summary small {
  display: block;
  min-width: 0;
}
.section-title-label {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}
.section-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: #101416;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.accordion summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: right;
}
.accordion > .info-grid,
.accordion > .section-block {
  margin: 12px;
}
.project-head {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  background: #444946;
  color: #fff;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.project-head p,
.project-head small {
  color: rgba(255,255,255,0.78);
}
.project-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.project-head-actions button {
  min-height: 40px;
  padding-inline: 14px;
}
.project-identity-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1.4fr) auto auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.project-identity-form[hidden] {
  display: none;
}
.project-actions {
  display: grid;
  gap: 8px;
  min-width: 220px;
}
.project-actions-bottom {
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.excel-email-panel {
  display: grid;
  gap: 8px;
  max-height: min(70dvh, 560px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.excel-email-head,
.excel-email-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.excel-email-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.excel-email-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.excel-email-head small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}
.excel-email-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.excel-email-note {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.excel-email-note textarea {
  min-height: 78px;
  resize: vertical;
}
.agenda-notice-panel {
  margin-top: 2px;
}
.compact-button {
  min-height: 32px;
  padding: 0 10px;
}
.excel-email-recipient {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
}
.excel-email-recipient input {
  width: 20px;
  min-height: 20px;
}
.excel-email-recipient span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.excel-email-recipient strong,
.excel-email-recipient small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.excel-email-recipient small {
  color: var(--muted);
  font-size: 0.72rem;
}
.recipient-role {
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 900;
}
.recipient-role.admin { background: var(--ink); color: #fff; }
.recipient-role.supplier { background: var(--green-soft); color: var(--green); }
.recipient-role.client { background: var(--teal-soft); color: var(--teal-dark); }
.project-head h2 { margin-top: 2px; font-size: 1.45rem; }
.reference {
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 950;
}
.status-field { min-width: 0; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.info-grid div {
  padding: 12px;
  border-right: 1px solid var(--line);
  background: #fbfcfc;
}
.info-grid div:last-child { border-right: 0; }
.info-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}
.info-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.conversation-search {
  max-width: 320px;
  color: var(--muted);
}
.conversation-search input {
  min-height: 30px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
}

.section-block {
  display: grid;
  gap: 10px;
}
.section-title {
  justify-content: space-between;
  gap: 12px;
}
.section-title span {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 900;
}

.notes, .quotes, .users-list, .notifications-list {
  display: grid;
  gap: 10px;
}
.question-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(20, 125, 127, 0.22);
  border-radius: 8px;
  background: #f7fbfa;
}
.question-form-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
}
.question-form-head small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}
.question-route {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.notification-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: var(--panel-dark);
}
.notification-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}
.notification-section {
  display: grid;
  gap: 8px;
}
.notification-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
}
.notification-section-head span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}
.agenda-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: #444946;
  overflow: hidden;
}
.agenda-toolbar {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) repeat(5, 44px);
  gap: 8px;
  align-items: center;
}
.agenda-toolbar strong {
  text-align: center;
  text-transform: capitalize;
  color: #fff;
}
.agenda-icon-button {
  position: relative;
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}
.agenda-icon-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 30;
  min-width: max-content;
  max-width: 190px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(12, 20, 24, 0.18);
  font-size: 0.68rem;
  font-weight: 950;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.agenda-icon-button[data-tooltip]:hover::after,
.agenda-icon-button[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.agenda-control-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.agenda-export-bar,
.agenda-vacation-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #b8d9d7;
  border-radius: 8px;
  background: #f3fbfa;
}
.agenda-vacation-bar {
  border-color: #ffd693;
  background: #fff7e6;
}
.agenda-export-bar[hidden],
.agenda-vacation-bar[hidden] {
  display: none;
}
.agenda-export-bar strong,
.agenda-export-bar small,
.agenda-vacation-bar strong,
.agenda-vacation-bar small {
  display: block;
}
.agenda-export-bar small,
.agenda-vacation-bar small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}
.agenda-export-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.agenda-export-actions button {
  min-height: 34px;
  padding: 0 10px;
}
.agenda-search {
  display: grid;
  gap: 4px;
  color: #f6fbfa;
  font-size: 0.78rem;
  font-weight: 900;
}
.agenda-search input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}
.agenda-grid {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.agenda-weekday {
  padding: 4px;
  color: rgba(255,255,255,0.78);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 950;
}
.agenda-empty {
  min-width: 0;
  min-height: 58px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}
.agenda-day {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.agenda-day strong {
  font-size: 0.86rem;
}
.agenda-day span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.1;
}
.agenda-day.has-events {
  border-color: #f4b942;
  background: #fff3c7;
  box-shadow: inset 0 0 0 2px rgba(244, 185, 66, 0.92);
}
.agenda-day.vacation-closed {
  border-color: #f0a83b;
  background: #fff7e6;
  box-shadow: inset 0 0 0 2px rgba(240, 168, 59, 0.52);
}
.agenda-day.vacation-closed.has-events {
  background: linear-gradient(135deg, #fff7e6 0%, #fff7e6 52%, #fff3c7 52%, #fff3c7 100%);
}
.agenda-vacation-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #8a5300 !important;
  font-weight: 950 !important;
}
.agenda-vacation-label span {
  color: inherit !important;
}
.agenda-day.today {
  border-color: #ffcf5a;
  box-shadow: inset 0 0 0 2px #ffcf5a, 0 0 0 2px rgba(255, 207, 90, 0.28);
}
.agenda-day.selected {
  border-color: #73f4ef;
  background: var(--teal-dark);
  color: #fff;
  box-shadow: inset 0 0 0 3px #73f4ef, 0 0 0 3px rgba(115, 244, 239, 0.32);
  transform: translateY(-1px);
}
.agenda-day.selected strong {
  color: #fff;
}
.agenda-day.selected span {
  color: #eaffff;
}
.agenda-day.has-events.selected {
  background: var(--teal-dark);
  border-color: #73f4ef;
}
.agenda-day.export-selecting {
  cursor: pointer;
}
.agenda-day.export-selected {
  background: var(--teal);
  color: #fff;
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px var(--teal);
}
.agenda-day.export-selected span {
  color: #eaffff;
}
.agenda-day.export-unavailable {
  opacity: 0.48;
}
.agenda-day.vacation-selecting {
  cursor: pointer;
}
.agenda-day.vacation-selected {
  border-color: #ffb84d;
  background: #ffefc9;
  color: var(--ink);
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px #f0a83b;
}
.agenda-list {
  display: grid;
  gap: 8px;
}
.agenda-group {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.agenda-group summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: #fff;
  cursor: pointer;
  list-style: none;
  font-weight: 950;
}
.agenda-group summary::-webkit-details-marker { display: none; }
.agenda-group summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}
.agenda-group[open] summary::after { content: "-"; }
.agenda-group summary small {
  margin-left: auto;
  color: rgba(255,255,255,0.75);
  font-size: 0.72rem;
}
.agenda-group-body {
  display: grid;
  gap: 8px;
  padding: 0 8px 8px;
}
.agenda-event {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(20, 30, 34, 0.14);
  color: var(--ink);
  text-align: left;
}
.agenda-event-main {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 92px 28px minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.agenda-event-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--teal);
  font-weight: 950;
}
.agenda-event-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}
.agenda-notify-button {
  min-height: 34px;
  padding: 0 10px;
  max-width: 100%;
  white-space: normal;
}
.agenda-event.reminder {
  border-left: 4px solid var(--amber);
}
.agenda-event.work {
  border-left: 4px solid var(--teal);
}
.agenda-event.transport {
  border-left: 4px solid #2f80ed;
}
.agenda-event.vacation {
  border-left: 4px solid #f0a83b;
}
.agenda-event.history {
  opacity: 0.72;
  border-left: 4px solid #95a3a8;
}
.agenda-event-date {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}
.agenda-event p {
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.agenda-event small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}
.accepted-by {
  margin-top: 4px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 950;
}
.project-head .accepted-by {
  color: #d9f0ed;
}
.logistics-block .admin-only-note {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px dashed rgba(20, 125, 127, 0.28);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--muted);
}
.admin-field > span,
.admin-field {
  font-weight: 950;
}
.admin-readonly-field span {
  font-weight: 950;
}
.logistics-info,
.logistics-form {
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(12, 20, 24, 0.1);
}
.logistics-form {
  display: grid;
  gap: 10px;
}
.logistics-subsection {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.logistics-subsection summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 950;
}
.logistics-subsection summary::-webkit-details-marker {
  display: none;
}
.logistics-subsection summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--teal-dark);
}
.logistics-subsection[open] summary::after {
  content: "-";
}
.logistics-subsection summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: italic;
}
.logistics-subsection-body {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.logistics-form input:disabled {
  border-color: #d7dfdf;
  background: #eef3f3;
  color: #66747b;
  cursor: not-allowed;
  opacity: 1;
}
.logistics-form .admin-field input:disabled {
  font-style: italic;
}
.calendar-export-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px;
}
.calendar-export-options .inline-check {
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.calendar-export-panel[hidden] {
  display: none;
}
.calendar-export-selected-panel {
  display: grid;
  gap: 8px;
  padding: 0 18px;
}
.calendar-export-selected-panel[hidden] {
  display: none;
}
.calendar-export-selected-head {
  display: grid;
  gap: 2px;
}
.calendar-export-selected-head small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.calendar-export-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.calendar-export-list {
  max-height: min(42dvh, 360px);
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}
.calendar-export-item {
  min-height: 48px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.calendar-export-item span {
  min-width: 0;
}
.calendar-export-item strong,
.calendar-export-item small {
  display: block;
  overflow-wrap: anywhere;
}
.calendar-export-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.note, .quote-item, .user-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.notification-item.unread {
  border-color: rgba(20, 125, 127, 0.35);
  background: #f7fbfa;
}
.notification-item.read {
  opacity: 0.74;
}
.notification-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--line);
}
.notification-item.unread .notification-dot { background: var(--coral); }
.notification-item strong {
  display: block;
  overflow-wrap: anywhere;
}
.notification-item p {
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.notification-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}
.note-head,
.note-meta, .quote-row, .user-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.note-head {
  align-items: center;
  justify-content: flex-start;
}
.note-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  object-fit: cover;
}
.note-meta {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}
.note-meta span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.note-meta span:last-child {
  flex: 0 0 auto;
}
.note p {
  margin-top: 6px;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.question-note {
  border-color: rgba(20, 125, 127, 0.35);
  background: #f9fdfc;
}
.note-question {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #d9f0ed;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 850;
}
.note-work-date {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #e8f4ff;
  color: #15548a;
  font-size: 0.78rem;
  font-weight: 800;
}

.note-form, .quote-form, .invoice-form, .user-form, .data-panel {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.invoice-block {
  gap: 12px;
}
.invoice-info {
  display: grid;
  gap: 10px;
}
.invoice-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.invoice-meta div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.invoice-meta span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}
.invoice-meta strong {
  overflow-wrap: anywhere;
}
.invoice-link {
  color: var(--teal-dark);
  font-weight: 950;
  text-decoration: none;
}
.invoice-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.invoice-action-link {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 900;
}
.muted-text {
  color: var(--muted);
  font-weight: 900;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quote-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.quote-actions-single {
  grid-template-columns: minmax(0, 1fr);
}
.quote-actions-main {
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}
.quote-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}
.quote-actions button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}
.quote-actions button.primary:hover,
.quote-actions button.primary:focus-visible {
  background: var(--teal-dark);
  color: #fff;
}
.quote-item.rejected {
  background: #f7f8f8;
  opacity: 0.68;
}
.quote-item.rejected strong,
.quote-item.rejected p {
  color: var(--muted);
}
.quote-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}
.quote-item .quote-status-info {
  color: var(--teal-dark);
}
.user-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: min(720px, 100%);
}
.user-edit-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(170px, 1fr) minmax(110px, 0.7fr) auto auto;
  gap: 8px;
  align-items: end;
}
.user-security-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto auto;
  gap: 8px;
  align-items: end;
}
.user-card-main {
  display: grid;
  gap: 4px;
  min-width: 180px;
}
.user-compact-card {
  display: block;
  padding: 0;
  overflow: hidden;
}
.user-details summary::-webkit-details-marker {
  display: none;
}
.user-details summary {
  list-style: none;
  cursor: pointer;
}
.user-summary-button {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.user-summary-button:hover,
.user-summary-button:focus-visible {
  background: #f5fbfa;
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 950;
  overflow: hidden;
}
img.user-avatar,
img.user-pill-avatar {
  display: block;
  object-fit: cover;
}
.avatar-picker-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.avatar-picker-block > span {
  color: var(--muted);
  font-weight: 900;
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
  min-width: 0;
}
.avatar-picker-compact {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
}
.avatar-choice {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 58px;
  padding: 7px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.avatar-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.avatar-choice-preview {
  width: 32px;
  height: 32px;
  border-radius: 999px;
}
.avatar-choice span:last-child {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}
.avatar-choice input:checked + .avatar-choice-preview {
  outline: 3px solid color-mix(in srgb, var(--teal) 65%, #fff);
  outline-offset: 2px;
}
.avatar-choice:focus-within {
  border-color: var(--teal);
  box-shadow: var(--focus-ring);
}
.user-summary-button > .client-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.user-summary-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.user-summary-main strong,
.user-summary-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-summary-main strong {
  font-size: 0.98rem;
}
.user-summary-main small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.user-summary-chevron {
  min-width: 62px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  text-align: center;
  font-size: 0.74rem;
  font-weight: 950;
}
.user-summary-chevron .when-open {
  display: none;
}
.user-details[open] .user-summary-chevron .when-closed {
  display: none;
}
.user-details[open] .user-summary-chevron .when-open {
  display: inline;
}
.user-compact-card.expanded .user-summary-button,
.user-details[open] .user-summary-button {
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}
.user-compact-card .user-card-actions {
  width: 100%;
  padding: 10px;
  background: #fff;
}
.user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.user-card.inactive {
  background: #fbfbfb;
  opacity: 0.82;
}
.user-card .danger, .user-card .secondary, .user-card .ghost, .user-card .primary { min-height: 34px; padding: 0 10px; }
.client-admin-block {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}
.client-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}
.clients-list {
  display: grid;
  gap: 8px;
}
.client-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.client-card summary {
  list-style: none;
}
.client-card summary::-webkit-details-marker {
  display: none;
}
.client-card.inactive {
  opacity: 0.82;
}
.client-avatar {
  background: #e7f4ff;
  color: #155e75;
}
.data-panel {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  padding: 12px;
  border: 0;
  background: var(--bg);
}
.data-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.data-actions button { min-height: 34px; }
.settings-card {
  overflow: hidden;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(37, 48, 54, 0.08);
}
.settings-card summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  cursor: pointer;
  list-style: none;
}
.settings-card summary::-webkit-details-marker {
  display: none;
}
.settings-card summary:hover,
.settings-card summary:focus-visible {
  background: #f5fbfa;
}
.settings-card[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}
.settings-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 950;
}
.settings-summary-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.settings-summary-text strong,
.settings-summary-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-summary-text strong {
  font-size: 0.98rem;
}
.settings-summary-text small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.settings-summary-action {
  min-width: 62px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  text-align: center;
  font-size: 0.74rem;
  font-weight: 950;
}
.settings-card[open] .settings-summary-action {
  color: var(--ink);
}
.settings-card[open] .settings-summary-action::before {
  content: "Cerrar";
  font-size: 0;
}
.settings-card[open] .settings-summary-action {
  font-size: 0;
}
.settings-card[open] .settings-summary-action::before {
  font-size: 0.74rem;
}
.settings-card-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}
.activity-block,
.sessions-list,
.activity-log-list {
  display: grid;
  gap: 8px;
}
.session-item,
.activity-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.session-item-main,
.activity-title-row,
.activity-user-row,
.activity-tech-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}
.session-item-main {
  justify-content: space-between;
}
.session-item-main strong,
.activity-title-row strong {
  overflow-wrap: anywhere;
}
.session-item-main span,
.activity-title-row span,
.activity-user-row,
.activity-tech-row,
.activity-device-detail {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}
.session-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.session-meta-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.session-meta-grid span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}
.session-meta-grid strong,
.session-meta-grid small,
.activity-device-detail {
  overflow-wrap: anywhere;
}
.session-meta-grid strong {
  font-size: 0.78rem;
}
.session-meta-grid small {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.3;
}
.activity-title-row {
  justify-content: space-between;
}
.activity-user-row em {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-style: normal;
  font-weight: 950;
}
.activity-tech-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.backup-box {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.backup-list {
  display: grid;
  gap: 8px;
}
.email-settings-form {
  align-items: stretch;
}
.email-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.email-settings-grid .inline-check {
  align-self: end;
  min-height: 40px;
}
.theme-settings-form {
  align-items: stretch;
}
.color-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.color-field {
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.color-field input[type="color"] {
  width: 52px;
  height: 38px;
  min-height: 38px;
  padding: 3px;
  border-radius: 8px;
  background: var(--input-bg);
}
.theme-preview {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.theme-preview-menu {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 8px;
  background: var(--teal);
  color: var(--on-primary);
  font-weight: 950;
}
.theme-preview-card {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  background: var(--surface);
}
.theme-preview-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}
.backup-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}
.backup-item strong,
.backup-item span,
.backup-item small {
  display: block;
}
.backup-item span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.backup-item small {
  color: var(--muted);
}
.backup-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.backup-item-actions button,
.backup-item-actions .invoice-action-link {
  min-height: 34px;
}

.admin-panel {
  display: grid;
  gap: 14px;
}
.user-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}

dialog {
  width: min(760px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(37, 48, 54, 0.35); }
dialog form { padding: 18px; }
.dialog-head {
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.dialog-grid .full-row {
  grid-column: 1 / -1;
}
.dialog-grid.single { grid-template-columns: 1fr; }
.restore-source-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.source-option {
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.source-option strong,
.source-option span {
  display: block;
}
.source-option span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}
.source-option.active {
  border-color: var(--teal);
  background: #eef9f8;
  box-shadow: inset 0 0 0 1px rgba(20, 125, 127, 0.18);
}
.restore-external-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
}
.restore-external-panel[hidden] {
  display: none;
}
.restore-external-panel p {
  margin: 0;
  color: var(--muted);
}
.dialog-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--teal-dark);
  font-weight: 850;
}
menu {
  justify-content: flex-end;
  gap: 8px;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 50;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(20, 125, 127, 0.22);
  border-left: 5px solid var(--teal);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -16px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-weight: 900;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.actionable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: min(420px, calc(100vw - 36px));
  border-color: rgba(203, 85, 72, 0.26);
  border-left-color: var(--coral);
  pointer-events: auto;
}
.toast.actionable span {
  min-width: 0;
}
.toast.actionable button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: var(--on-primary);
  font-size: 0.76rem;
  font-weight: 950;
}

.empty-list {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.profile-panel {
  max-width: 760px;
}
.profile-card {
  display: grid;
  gap: 14px;
}
.profile-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.profile-info div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.profile-info span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}
.profile-info strong {
  overflow-wrap: anywhere;
}
.profile-photo-form {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.profile-photo-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.profile-photo-form.avatar-only .profile-photo-row {
  grid-template-columns: 52px;
}
.profile-photo-preview .user-avatar,
.profile-photo-preview .user-photo {
  width: 52px;
  height: 52px;
  border-radius: 999px;
}
.password-change-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.profile-email-form {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.profile-email-form h3 {
  font-size: 0.96rem;
}
.profile-email-form p {
  margin-top: 2px;
}
.email-preferences-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.email-preferences-grid .inline-check,
.profile-email-form > .inline-check {
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

@media (max-width: 860px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  body { background: var(--bg); font-size: 12.5px; }
  h1 { font-size: 0.92rem; }
  h2 { font-size: 0.92rem; }
  h3 { font-size: 0.82rem; }
  p { line-height: 1.3; }
  label { gap: 3px; font-size: 0.68rem; }
  input, select, textarea {
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 7px;
  }
  .primary, .secondary, .ghost, .danger, .summary-button, .menu-button, .push-button {
    min-height: 32px;
    padding: 0 9px;
    border-radius: 7px;
  }
  .login { padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  .login-card { gap: 10px; padding: 12px; box-shadow: none; }
  .password-field {
    grid-template-columns: minmax(0, 1fr) 70px;
    gap: 6px;
  }
  .password-field button {
    min-width: 70px;
    min-height: 32px;
    border-radius: 7px;
    font-size: 0.72rem;
  }

  .topbar {
    display: none;
  }
  .brand { gap: 6px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 7px; font-size: 0.7rem; }
  .brand h1 { font-size: 0.82rem; }
  .brand p { display: none; }
  .top-actions { display: none; }
  .user-pill { max-width: 148px; min-height: 30px; padding: 4px 7px; border-radius: 7px; }
  .user-pill strong { font-size: 0.72rem; }
  .user-pill span { font-size: 0.64rem; }
  .client-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .notification-tools {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 6px;
  }
  .notification-tools button {
    min-height: 38px;
  }
  .app-tabs button::before,
  .mobile-actions button::before,
  .notification-tools button::before {
    display: none;
  }

  .mobile-actions {
    position: fixed;
    left: env(safe-area-inset-left);
    right: env(safe-area-inset-right);
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    padding: 4px 5px calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--topbar-bg);
    box-shadow: 0 -10px 28px rgba(37, 48, 54, 0.12);
    backdrop-filter: blur(14px);
  }
  .mobile-actions button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 36px;
    padding: 3px 2px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--menu-text);
    font-size: 0.66rem;
    font-weight: 950;
    line-height: 1.05;
  }
  .mobile-actions button.active {
    background: var(--teal-soft);
    color: var(--teal-dark);
  }
  .mobile-actions .mobile-menu-button[aria-expanded="true"] {
    background: var(--ink);
    color: var(--on-primary);
  }
  .mobile-actions .nav-badge,
  .mobile-actions .button-badge {
    position: absolute;
    top: 3px;
    right: 8px;
    margin-left: 0;
  }

  .menu-button {
    display: inline-grid;
  }
  .app-tabs {
    display: none;
    position: fixed;
    top: auto;
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: calc(46px + env(safe-area-inset-bottom));
    z-index: 29;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    gap: 5px;
    max-height: calc(100dvh - 70px);
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: var(--panel-dark);
    box-shadow: 0 -16px 38px rgba(12, 20, 24, 0.28);
  }
  .app-tabs .mobile-menu-only { display: inline-flex; }
  .app-tabs button {
    width: auto;
    min-height: 36px;
    font-size: 0.7rem;
    justify-content: center;
    border-color: rgba(255,255,255,0.22);
    background: #fff;
    text-align: center;
  }
  .app-tabs [data-action="logout"] {
    grid-column: 1 / -1;
  }
  .button-badge, .nav-badge {
    min-width: 18px;
    height: 18px;
    font-size: 0.66rem;
  }

  .main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    overflow-x: hidden;
    padding: 3px max(3px, env(safe-area-inset-left)) calc(74px + env(safe-area-inset-bottom)) max(3px, env(safe-area-inset-right));
  }
  .view.active {
    width: 100%;
    min-width: 0;
    gap: 4px;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .summary-card {
    min-height: 54px;
    padding: 7px;
  }
  .summary-card strong { font-size: 0.88rem; }
	  .summary-card span { font-size: 0.64rem; }
	  .summary-content { padding: 12px; }
	
	  .project-tools {
	    grid-template-columns: 1fr;
	    gap: 6px;
	  }
	  .project-tools > .primary {
	    width: 100%;
	    min-height: 42px;
	  }
	  .toolbar-dropdown summary {
	    min-height: 42px;
	    padding: 7px 9px;
	  }
	  .toolbar-dropdown summary::after {
	    width: 26px;
	    height: 26px;
	    font-size: 1rem;
	  }
	  .toolbar-dropdown-icon {
	    width: 20px;
	    height: 20px;
	    stroke-width: 2.5;
	  }
	  .toolbar-dropdown summary strong {
	    font-size: 0.76rem;
	  }
	  .toolbar-dropdown summary small {
	    font-size: 0.6rem;
	  }
	  .toolbar {
	    grid-template-columns: 1fr;
	    gap: 5px;
    padding: 5px;
  }
  .toolbar .search {
    min-width: 0;
  }
  .toolbar input {
    min-height: 30px;
  }
  .toolbar select {
    min-height: 30px;
  }
  .toolbar button { width: 100%; }
  .project-list {
    width: 100%;
    min-width: 0;
    gap: 6px;
  }

  .project-card {
    min-width: 0;
    gap: 4px;
    padding: 6px;
    border-left-width: 2px;
    overflow: hidden;
  }
  .project-card-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 5px;
  }
  .project-card-top > div {
    min-width: 0;
  }
  .project-card-top > .badge {
    max-width: 82px;
    justify-self: end;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .project-card-bottom {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
  }
  .project-card-bottom > strong {
    margin-left: auto;
    white-space: nowrap;
    font-size: 0.74rem;
  }
	  .project-card-date {
	    font-size: 0.66rem;
	  }
	  .project-card-logistics {
	    width: 100%;
	    padding: 5px 7px;
	    border-radius: 8px;
	    font-size: 0.64rem;
	  }
	  .project-card-logistics-icon {
	    width: 18px;
	    height: 18px;
	    font-size: 0.66rem;
	  }
	  .project-card .reference {
	    font-size: 0.62rem;
	  }
  .project-card p {
    font-size: 0.64rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }
  .project-card h3 {
    font-size: 0.74rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .project-head, .note-meta, .quote-row, .user-card, .filter-strip, .history-head {
    display: grid;
    grid-template-columns: 1fr;
  }
  .user-compact-card {
    display: block;
  }
  .user-summary-button {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    min-height: 50px;
    gap: 7px;
    padding: 7px;
  }
  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.86rem;
  }
  .user-summary-main strong {
    font-size: 0.82rem;
  }
  .user-summary-main small {
    font-size: 0.68rem;
  }
  .user-summary-button .user-badges {
    grid-column: 2 / -1;
    grid-row: 2;
    gap: 4px;
  }
  .user-summary-chevron {
    grid-column: 3;
    grid-row: 1;
    min-width: 52px;
    padding: 6px 7px;
    font-size: 0.64rem;
  }
  .settings-card summary {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    min-height: 50px;
    gap: 7px;
    padding: 7px;
  }
  .settings-icon {
    width: 34px;
    height: 34px;
    font-size: 0.86rem;
  }
  .settings-summary-text strong {
    font-size: 0.82rem;
  }
  .settings-summary-text small {
    font-size: 0.68rem;
  }
  .settings-summary-action {
    min-width: 52px;
    padding: 6px 7px;
    font-size: 0.64rem;
  }
  .settings-card[open] .settings-summary-action::before {
    font-size: 0.64rem;
  }
  .settings-card-body {
    padding: 7px;
    gap: 7px;
  }
  .color-settings-grid,
  .theme-preview {
    grid-template-columns: 1fr;
  }
  .color-field {
    grid-template-columns: minmax(0, 1fr) 46px;
    padding: 7px;
  }
  .color-field input[type="color"] {
    width: 46px;
    height: 34px;
    min-height: 34px;
  }
  .project-card-top, .project-card-bottom {
    gap: 6px;
  }
  .badge {
    min-height: 18px;
    padding: 2px 5px;
    font-size: 0.6rem;
  }
  .notification-item { padding: 7px; gap: 6px; }
  .filter-strip { align-items: stretch; }
  .filter-strip button { width: 100%; }
  .project-head {
    top: 0;
    padding: 4px 0 7px;
  }
  .project-head h2 { font-size: 0.9rem; }
  .project-head-actions,
  .project-head-actions button {
    width: 100%;
  }
  .project-identity-form {
    grid-template-columns: 1fr;
    padding: 7px;
  }
  .project-actions { min-width: 0; }
  .project-actions-bottom { padding: 7px; }
  .excel-email-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .excel-email-actions button {
    width: 100%;
  }
  .excel-email-recipient {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .excel-email-recipient .recipient-role {
    grid-column: 2;
    justify-self: start;
  }
  .conversation-search { max-width: none; }
  .conversation-search input {
    min-height: 28px;
    font-size: 0.7rem;
  }
  .question-route {
    grid-template-columns: 1fr;
  }

  .empty-state, .project-detail, .admin-panel { padding: 6px; }
  .project-detail { gap: 7px; }
  .accordion summary {
    padding: 7px 8px;
    font-size: 0.76rem;
  }
  .accordion summary small {
    font-size: 0.61rem;
  }
  .accordion summary::after {
    width: 20px;
    height: 20px;
    font-size: 0.78rem;
  }
  .accordion > .info-grid,
  .accordion > .section-block {
    margin: 6px;
  }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid div {
    padding: 6px 7px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .info-grid span { font-size: 0.58rem; }
  .info-grid strong { margin-top: 2px; font-size: 0.72rem; }
  .info-grid div:last-child { border-bottom: 0; }

  .form-row, .quote-actions, .dialog-grid, .restore-source-options, .user-form, .data-panel, .invoice-meta, .profile-info, .password-change-form, .email-preferences-grid, .calendar-export-options {
    grid-template-columns: 1fr;
  }
  .view[data-view-panel="agenda"] {
    min-width: 0;
    overflow-x: hidden;
  }
  .agenda-panel {
    gap: 6px;
    padding: 6px;
    border-radius: 7px;
  }
	  .agenda-toolbar {
	    gap: 4px;
	    grid-template-columns: repeat(6, minmax(0, 1fr));
	  }
	  .agenda-export-bar,
	  .agenda-vacation-bar {
	    grid-template-columns: 1fr;
	    gap: 8px;
	    padding: 8px;
  }
  .agenda-export-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .agenda-export-actions button {
    width: 100%;
  }
  .agenda-toolbar strong {
    grid-column: 1 / -1;
    order: -1;
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.15;
  }
  .agenda-icon-button {
    min-width: 0;
    width: 100%;
    min-height: 34px;
    font-size: 0.95rem;
  }
  .agenda-grid {
    gap: 2px;
  }
  .agenda-grid > * {
    min-width: 0;
  }
  .agenda-empty,
  .agenda-day {
    min-height: 42px;
    border-radius: 6px;
  }
  .agenda-day {
    gap: 2px;
    padding: 4px 3px;
  }
  .agenda-day strong {
    font-size: 0.72rem;
    line-height: 1;
  }
  .agenda-day span {
    font-size: 0.5rem;
    line-height: 1.05;
  }
  .agenda-event {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 8px;
  }
  .agenda-event-main {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px;
  }
  .agenda-event-date {
    grid-column: 1 / -1;
  }
  .agenda-event-actions {
    justify-content: flex-start;
  }
  .agenda-notify-button {
    width: 100%;
  }
  .agenda-group summary {
    padding: 8px;
    gap: 6px;
  }
  .agenda-group summary small {
    font-size: 0.62rem;
  }
  .agenda-search input {
    min-height: 36px;
    font-size: 0.72rem;
  }
  .excel-email-panel {
    max-height: min(64dvh, 520px);
    padding: 8px;
  }
  .excel-email-head {
    align-items: stretch;
  }
  .excel-email-head .compact-button {
    min-width: 112px;
  }
  .excel-email-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .excel-email-actions button {
    width: 100%;
  }
  .excel-email-recipient {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .excel-email-recipient .recipient-role {
    grid-column: 2;
    justify-self: start;
  }
  .invoice-preview-actions {
    display: grid;
    grid-template-columns: 1fr;
    padding: 7px;
  }
  .invoice-preview-actions button,
  .invoice-action-link {
    width: 100%;
  }
  .user-card-actions, .user-edit-grid, .user-security-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .user-card-actions button, .user-edit-grid button, .user-security-grid button {
    width: 100%;
  }
  .data-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .session-meta-grid {
    grid-template-columns: 1fr;
  }
  .session-item-main,
  .activity-title-row,
  .activity-user-row,
  .activity-tech-row {
    align-items: flex-start;
  }
  .backup-item {
    grid-template-columns: 1fr;
  }
  .backup-item-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .backup-item-actions button,
  .backup-item-actions .invoice-action-link {
    width: 100%;
  }
  .email-settings-grid {
    grid-template-columns: 1fr;
  }
  .data-actions button { width: 100%; }
  .note-form .primary, .quote-form .secondary, .invoice-form .secondary, .user-form .primary, .password-change-form .primary {
    width: 100%;
  }
  .note, .quote-item, .user-card {
    padding: 7px;
  }
  .note p { margin-top: 4px; }
  .section-block { gap: 6px; }
  .section-title span {
    min-width: 24px;
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 92px);
    overflow: auto;
  }
  dialog form { padding: 12px; }
  .dialog-head, menu {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }
  menu button { width: 100%; }

  .toast {
    left: 10px;
    right: 10px;
    top: max(10px, env(safe-area-inset-top));
    max-width: none;
    transform: translateY(-16px);
  }
  .toast.show { transform: translateY(0); }
  .toast.actionable {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }
  .toast.actionable button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .summary { grid-template-columns: 1fr; }
  .user-pill { display: none; }
  .summary-dialog .summary { grid-template-columns: 1fr; }
  .main {
    padding-left: max(2px, env(safe-area-inset-left));
    padding-right: max(2px, env(safe-area-inset-right));
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .mobile-actions {
    gap: 2px;
    padding-left: 4px;
    padding-right: 4px;
  }
  .mobile-actions button {
    min-height: 34px;
    font-size: 0.62rem;
  }
  .toolbar {
    padding: 4px;
  }
  .agenda-panel {
    padding: 4px;
  }
  .agenda-toolbar {
    gap: 3px;
  }
  .agenda-icon-button {
    min-height: 32px;
    font-size: 0.9rem;
  }
  .agenda-grid {
    gap: 1px;
  }
  .agenda-weekday {
    padding: 2px 0;
    font-size: 0.58rem;
  }
  .agenda-empty,
  .agenda-day {
    min-height: 38px;
    border-radius: 5px;
  }
  .agenda-day {
    padding: 3px 2px;
  }
  .agenda-day strong {
    font-size: 0.68rem;
  }
  .agenda-day span {
    font-size: 0.46rem;
  }
  .project-card {
    padding: 5px;
    gap: 3px;
  }
  .project-card-top > .badge {
    max-width: 72px;
  }
  .project-card-bottom > strong {
    width: 100%;
    margin-left: 0;
    margin-top: 1px;
  }
  .badge {
    min-height: 17px;
    padding: 2px 4px;
    font-size: 0.56rem;
  }
}
