/* Tercer Ojo visual system — editorial, warm and focused. Loaded last on purpose. */
:root {
  color: #29292c;
  background: #f7f8fa;
  --accent: #c7461e;
  --accent-hover: #a93818;
  --focus: #ffd841;
  --focus-strong: #ffca32;
  --soft: #fff7ce;
  --border: #e8e8eb;
  --default: #29292c;
  --gray: #69696f;
  --orange: #c7461e;
  --green: #287552;
  --blue: #29292c;
  --purple: #6b5b3e;
  --pink: #8a4b3e;
  --red: #b13d32;
  --surface: #fff;
  --surface-subtle: #f7f8fa;
  --text-muted: #707078;
  --shadow-float: 0 18px 52px rgb(41 41 44 / 12%), 0 3px 12px rgb(41 41 44 / 5%);
  /* Control sizes: sm only for chips, md for every button, lg on touch. Icon buttons never inherit the text-button min-height. */
  --btn-sm: 32px;
  --btn-md: 40px;
  --btn-lg: 44px;
  --icon-size: 20px;
  --icon-ink: #3b3b40;
  --shell-top: 70px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

html { color-scheme: light; }
body { min-width: 320px; background: #f7f8fa; color: var(--default); }
::selection { background: #ffe878; color: #29292c; }
a { color: #a93818; text-underline-offset: 3px; }
a:hover { color: #c7461e; }
p { color: var(--text-muted); }
h1,h2,h3,strong { color: #29292c; }
h1 { font-size: clamp(27px, 2.2vw, 34px); font-weight: 650; line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: 19px; font-weight: 650; line-height: 1.25; letter-spacing: -.018em; }
h3 { font-size: 15px; font-weight: 650; line-height: 1.35; }
small,.muted { color: #7b7b82; }

button,
.upload-button,
.document-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-md);
  border-color: #dedee2;
  border-radius: 12px;
  background: #fff;
  color: #3b3b40;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
button:hover,.upload-button:hover,.document-open-link:hover {
  border-color: #c7c7cc;
  background: #fafafb;
  color: #29292c;
  text-decoration: none;
}
button:active,.upload-button:active { transform: translateY(1px); }
button svg,a svg { display: block; flex: 0 0 auto; }
.primary {
  border-color: #c7461e;
  background: #c7461e;
  color: #fff;
  box-shadow: 0 5px 14px rgb(199 70 30 / 16%);
}
.primary:hover { border-color: #a93818; background: #a93818; color: #fff; }
.ghost { border-color: transparent; background: transparent; color: #55555c; box-shadow: none; }
.ghost:hover { border-color: #e2e2e5; background: #f3f4f6; }
.selected {
  border-color: #efbd1c;
  background: #fff7ce;
  color: #5f4500;
  box-shadow: inset 0 0 0 1px rgb(255 202 50 / 22%);
}
.text-button { color: #b13b18; }

input,textarea,select {
  min-height: 44px;
  border-color: #dcdce1;
  border-radius: 12px;
  background: #fff;
  color: #29292c;
  line-height: 1.45;
}
textarea { min-height: 96px; }
input:hover,textarea:hover,select:hover { border-color: #c6c6cc; }
input:focus,textarea:focus,select:focus,
button:focus-visible,a:focus-visible,summary:focus-visible {
  outline: 3px solid rgb(255 216 65 / 68%);
  outline-offset: 2px;
  border-color: #c7461e;
}
input[type=checkbox],input[type=radio] { min-height: 0; accent-color: #c7461e; }
input[readonly] { background: #f5f6f7; color: #626269; }
label { color: #49494f; line-height: 1.35; }
code,pre { background: #f1f2f4; }

/* Navigation and shell */
.sidebar {
  width: 244px;
  padding: 26px 16px 20px;
  border-right-color: #e8e8eb;
  background: #fff;
}
.workspace { margin-left: 244px; }
.brand { gap: 13px; padding: 0 8px 28px; color: #29292c; }
.brand:hover { text-decoration: none; }
.brand strong { font-size: 12px; font-weight: 750; letter-spacing: 2px; line-height: 1.25; }
.brand small { margin-top: 3px; color: #818188; letter-spacing: .02em; }
.brandmark {
  position: relative;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid #e4ad17;
  border-radius: 14px;
  background: #ffd841;
  color: transparent;
  font-size: 0;
  box-shadow: 0 0 0 7px rgb(255 216 65 / 13%);
}
.brandmark::before {
  content: "";
  position: absolute;
  inset: 11px 8px;
  border: 2px solid #29292c;
  border-radius: 65% 35% 65% 35% / 65% 35% 65% 35%;
  transform: rotate(45deg);
}
.brandmark::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px solid #29292c;
  border-radius: 50%;
  background: #fff;
}
.nav-label,.section-kicker {
  color: #b43d1c;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.sidebar nav { gap: 3px; }
.sidebar nav a {
  position: relative;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  color: #68686f;
  font-weight: 520;
}
.sidebar nav a:hover { background: #f6f6f8; color: #29292c; text-decoration: none; }
.sidebar nav a.active {
  background: #fff7ce;
  color: #29292c;
  font-weight: 680;
  box-shadow: 0 0 0 5px rgb(255 216 65 / 8%);
}
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: #c7461e;
}
.sidebar nav span { display: grid; place-items: center; width: 20px; color: #77777e; }
.sidebar nav a.active span { color: #c7461e; }
.sidebar nav svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sidebar-foot { border-top-color: #ececef; }
.sidebar-foot strong { display: block; margin-bottom: 2px; }
.topbar {
  height: 70px;
  padding: 0 38px;
  border-bottom-color: #e8e8eb;
  background: rgb(255 255 255 / 90%);
  backdrop-filter: blur(14px);
}
.topbar>span:first-child { color: #29292c; font-weight: 650; }
.page { max-width: 1680px; padding: 38px 40px 80px; }
.page-title { align-items: flex-end; margin-bottom: 30px; }
.page-title>div { min-width: 0; }
.page-title h1 { position: relative; margin-bottom: 10px; padding-bottom: 12px; }
.page-title h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: #c7461e;
}
.page-title p { max-width: 68ch; margin-bottom: 0; font-size: 14px; }
.eyebrow { margin-bottom: 12px!important; color: #a93818; font-size: 10px; font-weight: 780; letter-spacing: .2em; }

/* Content hierarchy */
.metrics { gap: 1px; overflow: hidden; border: 1px solid #e8e8eb; border-radius: 16px; background: #e8e8eb; }
.metric { min-height: 132px; padding: 25px 26px; border: 0; border-radius: 0; background: #fff; }
.metric:first-child { box-shadow: inset 0 3px #ffd841; }
.metric strong { color: #29292c; font-size: 36px; font-weight: 520; letter-spacing: -.04em; }
.metric span { color: #717178; }
.panel,.ec-section,.ec-kpis article {
  border-color: #e8e8eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
}
.panel-heading { padding: 21px 24px; border-bottom-color: #ededf0; }
.padded { padding: 26px; }
.client-grid { gap: 16px; }
.client-card { padding: 24px; transition: border-color .16s ease, transform .16s ease; }
.client-card:hover { border-color: #f0bd1b; transform: translateY(-1px); text-decoration: none; }
.avatar,.client-avatar {
  border: 1px solid #f0cf57;
  border-radius: 12px;
  background: #fff7ce;
  color: #8a4a0c;
}
.group-avatar,.all-targets { border: 1px solid #f0cf57; background: #fff7ce; color: #9a4118; }
.target-option.group-option { background: #fafafb; }
.target-option.group-option:hover,.target-option.group-option.selected,.target-option:hover,.target-option:focus-visible,.target-option.selected { background: #fff7ce; }
.badge,.ec-pill,.type-chip,.link-count,.count-pill {
  border: 1px solid #e3e3e6;
  border-radius: 999px;
  background: #f4f4f6;
  color: #5f5f66;
}
.badge.green,.status-aprobado,.status-hecho { border-color: #cfe7d8; background: #eef8f1; color: #287552; }
.badge.red,.status-bloqueado { border-color: #f0d3cf; background: #fff1ef; color: #a9372e; }
.badge.blue,.status-en-curso { border-color: #e3e3e6; background: #f4f4f6; color: #55555c; }
.status-esperando-cliente { border-color: #efc49e!important; background: #fff3e9!important; color: #88400d!important; }
.callout,.ec-warning { border-color: #f0d474; background: #fff9dc; color: #684e00; }
.callout.danger,.ec-error { border-color: #efcbc6; background: #fff1ef; color: #8f3028!important; }
.empty { padding: 64px 24px; }
.empty>span { color: #d9821f; }
.empty h3 { color: #3a3a3e; }

/* Tables, boards and filters */
th,.database-table thead th,.ec-table th { background: #f7f8fa; color: #6f6f77; letter-spacing: .06em; }
td { border-top-color: #eeeeF1; }
tbody tr:hover { background: #fffdf3; }
.table-scroll,.ec-table { scrollbar-color: #c9c9cf transparent; }
.filters { gap: 8px; }
.view-tabs { gap: 4px; padding: 4px; width: max-content; max-width: 100%; border: 1px solid #e6e6e9; border-radius: 14px; background: #f1f2f4; }
.view-tabs button { min-height: 36px; border-radius: 10px; }
.lane { background: #f1f2f4; border: 1px solid #e7e7ea; border-radius: 14px; }
.work-card { border-color: #e4e4e7; border-radius: 12px; }
.work-card:hover { border-color: #edbc23; background: #fffdf6; text-decoration: none; }
.database-control>summary { border-color: #dedee2; border-radius: 11px; color: #4e4e54; }
.database-control>summary:hover,.database-control[open]>summary { border-color: #e3ad11; background: #fff9df; color: #29292c; }
.database-menu,.document-menu,.choice-menu,.target-menu {
  border-color: #e1e1e5;
  border-radius: 14px;
  box-shadow: var(--shadow-float);
}
.database-menu button:hover,.database-menu button:focus-visible { background: #fff7ce; color: #29292c; }
.columns-menu input:checked { border-color: #c7461e; background: #c7461e; }
.group-row th { border-color: #e6e6e9!important; background: #f4f4f6!important; }
.group-row button:hover { background: #fff9df; }
.group-progress { background: #e1e1e5; }
.group-progress i { background: #f28029; }

/* Editors, documents and modals */
.work-heading .work-title-input { color: #29292c; }
.work-properties input:hover,.work-properties .choice-trigger:hover,.work-properties select:hover { background: #f4f4f6; }
.work-main>.panel { border-radius: 16px; }
.document-row { border-bottom-color: #ededf0; }
.document-row:hover { background: #fffdf3; text-decoration: none; }
.document-type-icon { background: #fff7ce; color: #9a4118; }
.type-propuesta,.type-reporte,.type-estrategia,.type-plan,.type-otro { border: 1px solid #e3e3e6; background: #f4f4f6; color: #55555c; }
.type-propuesta,.type-estrategia { border-color: #efc49e; background: #fff3e9; color: #9a4118; }
.document-modal-mark { border: 1px solid #efc236; background: #fff7ce; color: #9a4118; }
.document-step b { background: #c7461e; color: #fff; }
.document-step i { background: #f1f2f4; color: #77777e; }
.document-type-card { border-color: #e2e2e5; }
.document-type-card:hover { border-color: #e7b725; background: #fffdf3; }
.document-type-card.selected { border-color: #e1aa09; background: #fff9df; box-shadow: inset 0 0 0 1px #e1aa09; }
.proposal-fields { border-color: #e5e5e8; background: #f8f8fa; }
.proposal-option { border-top-color: #e7e7ea; }
.proposal-option-title { color: #6a3a20; }
.document-dropzone,.document-upload-zone { border-color: #d7d7dd; background: #fafafb; color: #797980; }
.document-dropzone strong { color: #3e3e44; }
.document-dropzone:hover,.document-dropzone.is-dragging,.document-upload-zone:hover,.document-upload-zone.is-dragging { border-color: #e4a90d; background: #fff9df; }
.document-save-bar [data-document-dirty]:not(:empty) { color: #a93818; }
.rich-editor { --editor-text: #29292c; --editor-muted: #818188; --editor-hover: #fff7ce; --editor-selection: #ffe878; }
.rich-editor .tiptap h1,.rich-editor .tiptap h2,.rich-editor .tiptap h3 { color: #29292c; }
.rich-editor .tiptap blockquote { border-left-color: #f28029; }
.inline-format-toolbar,.emoji-picker { border-color: #e1e1e5; box-shadow: var(--shadow-float); }
dialog,.ec-dialog {
  border-color: #e0e0e4;
  border-radius: 16px;
  color: #29292c;
  box-shadow: var(--shadow-float);
}
dialog::backdrop,.ec-dialog::backdrop { background: rgb(27 27 30 / 52%); backdrop-filter: blur(3px); }
.modal-heading,.ec-dialog>header { border-bottom-color: #e8e8eb; }
.ec-dialog>header button { min-width: 42px; padding: 9px; }
.modal-footer { border-top-color: #e8e8eb; }
#notice { border-radius: 12px; background: #29292c; color: #fff; box-shadow: var(--shadow-float); }

/* Ecommerce inherits the brand without recolouring third-party marks. */
.ecommerce { --ec-muted: #707078; --ec-line: #e8e8eb; color: #29292c; }
.ec-heading h1 { position: relative; padding-bottom: 11px; }
.ec-heading h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 38px; height: 3px; border-radius: 3px; background: #c7461e; }
.ec-shop-card { border-color: #e8e8eb; border-radius: 16px; box-shadow: none; }
.ec-shop-card:hover { border-color: #e6b41b; box-shadow: 0 0 0 5px rgb(255 216 65 / 9%); text-decoration: none; }
.ec-shop-avatar { border-color: #f0ce55; background: #fff7ce; color: #a33b19; }
.ec-status { color: #696970; }
.ec-tabs { border-bottom-color: #e8e8eb; }
.ec-tabs a { color: #727279; }
.ec-tabs a[aria-current] { border-color: #c7461e; color: #29292c; }
.ec-search { border-color: #dedee2; border-radius: 12px; }
.ec-sync { border: 1px solid #e4e4e7; background: #f5f6f7; }
.ec-empty { grid-column: 1 / -1; min-height: 220px; border-color: #d7d7dc; background: #fff; }
.ec-empty svg { color: #c7461e; }
.ec-specific-editor [role=tab][aria-selected=true] { border-bottom-color: #c7461e; color: #29292c; }
.ec-specific-editor aside,.ec-editor-grid>aside { border-color: #e4e4e7; background: #f5f6f7; }
.ec-specific-editor [data-width][aria-pressed=true] { background: #c7461e; color: #fff; }
.ec-device { border: 1px solid #e8e8eb; }
.ec-config-item { border-color: #e5e5e8; border-radius: 12px; }
.ec-dialog .ec-targets label:hover { background: #fffaf0; }
.ec-dialog .ec-targets label:has(input:checked) { border-color: #e2ac0b; background: #fff7ce; }
.ec-dialog .ec-targets input { accent-color: #c7461e; }
.ec-specific-editor .ec-icon-picker button[aria-pressed=true] { border-color: #e1aa09; background: #fff7ce; color: #8d3618; }
.wp-stars { color: #f3b000; }

/* Login */
.login { margin-top: 9vh; border-color: #e5e5e8; border-radius: 16px; box-shadow: 0 22px 60px rgb(41 41 44 / 8%); }
.login::before { content: "ACCESO AL ESPACIO"; display: block; margin-bottom: 18px; color: #a93818; font-size: 10px; font-weight: 750; letter-spacing: .18em; }
.login .brandmark { margin-left: 7px; }
.password-entry-control { display: flex; align-items: center; gap: 8px; }
.password-entry-control input { min-width: 0; flex: 1; }
.password-entry-control button { flex: none; display: grid; place-items: center; width: 46px; height: 42px; padding: 0; border: 1px solid #e8e8eb; border-radius: 10px; color: #29292c; background: #fff; }
.password-entry-control button:hover { border-color: #f28029; background: #fff9df; }
.password-form-error { margin: 2px 0 16px; padding: 11px 13px; border: 1px solid #f0ceca; border-radius: 10px; background: #fff5f3; color: #963126; font-size: 13px; }
.password-form-error[hidden], [data-html-warning]:empty { display: none; }
[data-html-warning]:not(:empty) { display: block; max-width: 54ch; padding: 9px 12px; border: 1px solid #f1dfa3; border-radius: 9px; background: #fff9e6; color: #76530b; font-size: 12px; line-height: 1.45; }

@media (max-width: 1100px) {
  .sidebar { width: 210px; }
  .workspace { margin-left: 210px; }
  .page { padding: 30px 26px 70px; }
  .topbar { padding: 0 26px; }
}

@media (max-width: 760px) {
  .sidebar { position: static; width: auto; padding: 14px 14px 10px; border-right: 0; border-bottom: 1px solid #e8e8eb; }
  .brand { padding: 0 4px 12px; }
  .brandmark { width: 38px; height: 38px; border-radius: 12px; box-shadow: none; }
  .brandmark::before { inset: 9px 7px; }
  .brandmark::after { inset: 14px; }
  .sidebar nav { gap: 4px; padding-bottom: 4px; scrollbar-width: thin; }
  .sidebar nav a { min-height: 42px; padding: 9px 12px; border: 1px solid #e8e8eb; background: #fff; }
  .sidebar nav a.active { border-color: #ecc235; box-shadow: none; }
  .sidebar nav a.active::before { display: none; }
  .sidebar-foot { margin-top: 8px; padding: 9px 4px 0; }
  .workspace { margin-left: 0; }
  .topbar { height: 50px; padding: 0 16px; }
  .page { padding: 26px 16px 64px; }
  .page-title { align-items: stretch; flex-direction: column; gap: 18px; }
  .page-title .primary { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 1px; }
  .metric { min-height: 110px; padding: 20px; }
  .metric strong { font-size: 30px; }
  .padded { padding: 20px; }
  .panel-heading { align-items: flex-start; padding: 18px 20px; }
  .panel-heading a { white-space: nowrap; }
  button,.upload-button,.document-open-link { min-height: var(--btn-lg); }
  .actions-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .actions-bar button { width: 100%; }
  .view-tabs { width: 100%; overflow-x: auto; }
  .view-tabs button { flex: 1 0 auto; }
  dialog,.ec-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 14px; }
  .modal-heading,.ec-dialog>header { padding: 16px 18px; }
  .modal-heading h2,.ec-dialog>header h2 { font-size: 18px; }
  dialog form,.ec-dialog [data-modal-body] { padding: 18px; }
  .ec-specific-editor footer { gap: 8px; }
  .ec-specific-editor footer button { flex: 1; }
}

@media (max-width: 440px) {
  .metric { min-height: 106px; padding: 18px; }
  .actions-bar { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto!important; transition: none!important; }
}

.mobile-menu-toggle { display: none; }

@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 0 8px;
    padding: 8px 16px;
    background: #fff;
    box-shadow: 0 2px 12px rgb(41 41 44 / 5%);
  }
  .sidebar .brand { min-width: 0; padding: 0; }
  .sidebar .brand strong { min-width: 0; }
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #e8e8eb;
    border-radius: 12px;
    background: #fff;
    color: #29292c;
    font-size: 13px;
    font-weight: 650;
  }
  .mobile-menu-icon { display: grid; gap: 3px; }
  .mobile-menu-icon span { display: block; width: 16px; height: 2px; border-radius: 2px; background: #c7461e; }
  .sidebar nav,.sidebar-foot { display: none; grid-column: 1 / -1; }
  .sidebar.mobile-nav-open nav {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
    max-height: min(54dvh,430px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
  }
  .sidebar.mobile-nav-open nav a { min-width: 0; white-space: normal; }
  .sidebar.mobile-nav-open nav span { display: grid; flex: none; }
  .sidebar.mobile-nav-open .sidebar-foot { display: flex; flex-wrap: wrap; gap: 7px; }
  .sidebar-foot strong { width: 100%; }
  .topbar { height: 38px; padding: 0 16px; }
  .page { padding: 22px 16px 64px; }
  .filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
  .filters > #search,.filters > #historySearch { grid-column: 1 / -1; }
  .filters > *, .filters .choice, .filters .choice-trigger { min-width: 0; width: 100%; }
  .filters .choice-label { overflow: hidden; text-overflow: ellipsis; }
  .client-card { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 3px 12px; padding: 15px 16px; }
  .client-card > .avatar { grid-row: 1 / 4; margin: 0; }
  .client-card > h2,.client-card > p,.client-card > small { grid-column: 2; min-width: 0; margin: 0; overflow-wrap: anywhere; }
  .client-card > h2 { font-size: 16px; }
  .client-card > p,.client-card > small { font-size: 12px; }
  .database-table-scroll { overflow: visible; }
  .database-table { display: block; min-width: 0!important; width: 100%; }
  .database-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .database-table tbody { display: block; }
  .database-table tbody tr:not(.group-row) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px; border-bottom: 1px solid #e8e8eb; }
  .database-table tbody tr:not(.group-row):last-child { border-bottom: 0; }
  .database-table td { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0!important; width: auto; height: auto!important; padding: 0!important; border: 0; overflow: visible; font-size: 13px; }
  .database-table td::before { content: attr(data-label); color: #77777e; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .database-table td.work-cell { grid-column: 1 / -1; }
  .database-table td.work-cell::before { display: none; }
  .database-table .work-title { max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 15px; line-height: 1.35; }
  .database-table .client-cell>span,.database-table .person-cell>span { max-width: calc(100% - 40px); }
  .database-table .group-row { display: block; }
  .database-table .group-row th { display: block; width: 100%; }
  dialog[open]:not(.ec-dialog) { display: flex; flex-direction: column; max-height: calc(100dvh - 16px); }
  dialog[open]:not(.ec-dialog) > form { overflow-y: auto; min-height: 0; }
  dialog[open]:not(.ec-dialog) .modal-heading { flex: none; }
}

@media (max-width: 380px) {
  .sidebar.mobile-nav-open nav { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
}
[data-other-format][hidden]{display:none!important}.production-chip{display:inline-flex;align-items:center;gap:6px;background:#f0eafa!important;color:#68419b!important}.production-chip svg{flex:none}.work-card.production-work,.calendar-day a.production-work{border-left:3px solid #8757b0}.calendar-day a.production-work{flex-wrap:wrap}.calendar-day .production-chip{font-size:10px}.work-card[draggable=true]{cursor:grab}.work-dragging{opacity:.45}.lane.work-drop-over,.calendar-day.work-drop-over{outline:2px solid #c7461e;outline-offset:-2px;background:#fff9df}[data-drag-handle]{display:inline-flex;align-items:center;justify-content:center;min-width:28px;min-height:28px;touch-action:none;cursor:grab;color:#727278;user-select:none}.work-card>[data-drag-handle]{float:right}

/* Workspace navigation and optional delivery channels. */
.sidebar[hidden]{display:none!important}
body.sidebar-collapsed .workspace{margin-left:0}
.sidebar-toggle{display:inline-flex;align-items:center;justify-content:center;padding:7px;flex:0 0 auto;margin-right:12px}
.topbar .sidebar-toggle+span{margin-right:auto}
.sidebar-collapsed .sidebar-toggle svg{transform:rotate(180deg)}
.network-picker{border:1px solid var(--border);border-radius:9px;padding:0;margin:12px 0}
.network-picker summary{cursor:pointer;padding:10px 12px;font-weight:600}
.network-picker summary small{font-weight:400;color:var(--gray);margin-left:8px;overflow-wrap:anywhere}
.network-picker .check-grid{padding:4px 12px 12px;margin:0}

/* Home placement uses the connected design's section inventory. */
.ec-home-picker{padding:18px;border:1px solid #e4e4e7;border-radius:14px;background:#fafafa}
.ec-home-picker h3{margin:0 0 16px}.ec-home-picker>label{margin-bottom:12px}.ec-home-picker>button{margin-top:12px}
.ec-home-sections{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:10px}
.ec-home-section{display:flex;align-items:center;justify-content:space-between;gap:12px;background:white;border:1px solid #e4e4e7;border-radius:10px;padding:14px}
.ec-home-section span{min-width:0}.ec-home-section small,.ec-home-section strong{display:block;overflow-wrap:anywhere}.ec-home-section small{font-size:12px;color:#737373;margin-bottom:4px}
.ec-home-section>div{display:flex;gap:6px;flex-shrink:0}.ec-home-section button{padding:7px 10px;font-size:13px}.ec-home-section button[aria-pressed=true]{color:#fff;background:#b93e1e;border-color:#b93e1e}
.ec-home-insertion{border:1px dashed #b93e1e;border-radius:8px;padding:10px 14px;margin:6px 0;background:#fff4e9;color:#973519;font-weight:600;font-size:13px}
.ec-home-warning{padding:12px;background:#fff4d6;border-radius:8px;color:#755000}
@media(max-width:600px){.ec-home-section{align-items:flex-start;flex-direction:column}.ec-home-section>div{align-self:flex-end}}

/* ── UX pass (2026-11): overlaps, touch, consistency. Kept in one block so it can be reverted as a unit. ── */

/* Shell. The bell is position:fixed (database.css): give it a home that never sits on another control. */
@media (min-width: 761px) {
  /* The bar was styled as a floating bar (blur, 90% white) but scrolled away, leaving the bell over page content. */
  .topbar { position: sticky; top: 0; z-index: 30; }
  /* A long admin menu pushed the sign-out button below short viewports: let the list scroll instead. */
  .sidebar nav { flex: 0 1 auto; min-height: 0; align-content: start; overflow-y: auto; margin: 0 -5px; padding: 5px; scrollbar-width: thin; }
}
@media (min-width: 1101px) {
  /* Comments and activity line up with the main column (280px properties + 24px gap). */
  .work-bottom { margin-left: 304px; }
}
@media (max-width: 760px) {
  /* The mobile header is the sticky .sidebar; the bell now sits inside it, before the menu button. */
  .notification-bell { width: 44px; height: 44px; min-height: 44px; }
  .notification-panel { top: 66px; right: 8px; left: 8px; width: auto; max-height: calc(100dvh - 78px); }
  /* Collapsing the side menu is a desktop affordance; on a phone it removed the whole header. */
  .sidebar[hidden] { display: grid !important; }
  .sidebar-toggle { display: none; }
}
.sidebar-toggle { width: 40px; min-height: 40px; padding: 0; }

/* Touch: rows and board cards blocked page scrolling (touch-action:none in database.css). */
tr[data-drag-work] { touch-action: manipulation; }
.work-card[data-drag-work] { touch-action: pan-y; }

/* Buttons that declare a fixed size must not be stretched by the global min-height. */
@media (hover: none) { .calendar-add { opacity: .75; } }
.document-menu .color-swatch,.document-colors button { min-height: 0; }
.text-button { justify-content: flex-start; min-height: 28px; border-radius: 4px; }
.client-tabs button,.group-card { justify-content: flex-start; }
button:disabled:active { transform: none; }

/* Work detail heading: see work-detail.css for the sticky bar; only brand colours live here. */
.work-heading .back { color: #55555c; }
.work-heading .back:hover { background: #f1f2f4; color: #29292c; text-decoration: none; }

/* Status colours: the same palette everywhere, not only inside editable list cells. */
.badge.status-en-produccion { border-color: #c9e0f2; background: #e7f2fb; color: #347aa9; }
.badge.status-idea-pendiente-de-validar,.badge.status-contenido-pendiente-de-aprobacion,.badge.status-en-revision { border-color: #ded1ed; background: #f1ebfa; color: #7654a0; }
.badge.status-idea-con-correcciones,.badge.status-contenido-con-correcciones { border-color: #eed9ad; background: #fff3dc; color: #936716; }
.badge.status-idea-validada,.badge.status-publicado,.badge.status-finalizado { border-color: #cfe7d8; background: #e7f5eb; color: #317d53; }
.lane-borrador { box-shadow: inset 0 3px 0 #a7aeb0; }
.lane-en-producción { box-shadow: inset 0 3px 0 #5791c7; }
.lane-idea-pendiente-de-validar,.lane-contenido-pendiente-de-aprobación { box-shadow: inset 0 3px 0 #9a75c8; }
.lane-idea-con-correcciones,.lane-contenido-con-correcciones { box-shadow: inset 0 3px 0 #d29b3a; }
.lane-idea-validada,.lane-publicado,.lane-finalizado { box-shadow: inset 0 3px 0 #58a779; }

/* Board, calendar and list details. */
.board { overscroll-behavior-x: contain; scrollbar-width: thin; }
.lane-cards > p.muted { margin: 0; padding: 18px 8px; border: 1px dashed #d9d9de; border-radius: 10px; text-align: center; }
.panel > .calendar-legend { margin: 0; padding: 10px 24px; }
.calendar-day.today { background: #fffbe6; }
.calendar-day.today > span:first-child { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: #c7461e; color: #fff; font-weight: 700; }
.panel-heading label:has([name=calendarDateField]) { flex-direction: row; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.panel-heading [name=calendarDateField] { width: auto; }
@media (max-width: 760px) {
  .panel-heading { flex-wrap: wrap; }
  .calendar-navigation { width: 100%; }
  .calendar-navigation input { flex: 1; min-width: 0; }
  .panel > .calendar-legend { padding: 10px 20px; }
}

/* Empty and loading states. */
.client-grid > .empty,.group-grid > .empty,.contact-grid > .empty { grid-column: 1 / -1; }
.group-grid > .empty,.contact-grid > .empty { padding: 28px 20px; border: 1px dashed #dcdce1; border-radius: 16px; background: #fff; }
.loading { padding: 22vh 24px; text-align: center; }

/* Notifications panel. */
.notification-panel header button { width: 40px; min-height: 40px; padding: 0; }
.notification-panel nav { flex-wrap: wrap; justify-content: flex-start; }
.notification-panel nav button { min-height: 36px; padding: 6px 12px; border-radius: 10px; }
.notification-panel nav [data-refresh] { margin-left: auto; }
.notification-panel > [data-read-all],.notification-panel > [data-more] { width: 100%; min-height: 38px; font-size: 13px; }
.notification-panel > [data-read-all] { margin-bottom: 10px; }
.notification-item { transition: background-color .16s ease; }
.notification-item:hover { background: #fafafb; }
.notification-item.unread:hover { background: #fff4dc; }
.notification-item [data-open] { min-height: 0; border-radius: 8px; }
.notification-item [data-open]:hover { background: transparent; }
.notification-item [data-read] { justify-content: flex-start; min-height: 30px; }

/* Toast: left:50% halves the available width, so short messages wrapped on phones. */
#notice { width: max-content; max-width: min(92vw, 560px); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); line-height: 1.4; text-align: center; transform: translate(-50%, 8px); transition: opacity .2s ease, transform .2s ease; }
#notice.visible { transform: translate(-50%, 0); }

/* Dialogs: the confirm button stays reachable in long forms; surfaces appear with a short rise. */
dialog:not(.ec-dialog) .modal-footer { position: sticky; bottom: 0; z-index: 20; padding: 16px 0; background: #fff; }
@keyframes to-rise { from { opacity: 0; transform: translateY(8px); } }
dialog[open]:not(.ec-dialog) { animation: to-rise .18s ease-out; }
.notification-panel,.choice-menu,.work-inline-editor,.database-menu:not(.columns-menu),.target-menu { animation: to-rise .14s ease-out; }
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  #notice,#notice.visible { transform: translateX(-50%); }
}

/* ── UX pass 2 (2026-11): control tokens, icon buttons, chips, sticky detail bar, mobile tab bar, typed toasts. ── */

/* Icon buttons: one square token everywhere a glyph used to float. */
.icon-button,
.modal-close,
.calendar-add,
.notification-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--btn-md);
  height: var(--btn-md);
  min-width: var(--btn-md);
  min-height: var(--btn-md);
  padding: 0;
  border: 1px solid #dedee2;
  border-radius: 11px;
  background: #fff;
  color: var(--icon-ink);
  line-height: 1;
  box-shadow: none;
}
.icon-button svg,.calendar-add svg,.notification-bell svg { width: var(--icon-size); height: var(--icon-size); stroke-width: 2; flex: none; }
.icon-button:hover,.calendar-add:hover,.notification-bell:hover { border-color: #c7c7cc; background: #f3f4f6; color: #29292c; }
.icon-button:focus-visible,.calendar-add:focus-visible { outline: 3px solid rgb(255 216 65 / 68%); outline-offset: 2px; }
.icon-button.sm { width: var(--btn-sm); height: var(--btn-sm); min-width: var(--btn-sm); min-height: var(--btn-sm); border-radius: 9px; }
.icon-button.sm svg { width: 16px; height: 16px; }
.icon-button.lg { width: var(--btn-lg); height: var(--btn-lg); min-width: var(--btn-lg); min-height: var(--btn-lg); }
.icon-button.ghost { border-color: transparent; background: transparent; }
.icon-button.ghost:hover { border-color: #e2e2e5; background: #f3f4f6; }
.icon-button[aria-pressed=true] { border-color: #e1aa09; background: #fff7ce; color: #5f4500; }
a.icon-button { text-decoration: none; }
summary.icon-button { list-style: none; cursor: pointer; }
summary.icon-button::-webkit-details-marker { display: none; }
.database-control[open] > summary.icon-button { border-color: #e3ad11; background: #fff9df; color: #29292c; }
@media (hover: none), (max-width: 760px) {
  .icon-button:not(.sm),.modal-close,.calendar-add,.notification-bell { width: var(--btn-lg); height: var(--btn-lg); min-width: var(--btn-lg); min-height: var(--btn-lg); }
}
.link-row .icon-button,.access-row .icon-button { flex: none; }
.calendar-add { top: 4px; right: 4px; z-index: 1; }
.calendar-navigation { gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 8px; margin: 0 0 18px -8px; border-radius: 10px; color: #55555c; font-weight: 600; }
.back svg { width: 18px; height: 18px; stroke-width: 2; }
.back:hover { background: #f1f2f4; color: #29292c; text-decoration: none; }
.work-heading .back { padding: 0; margin: 0; }
.modal-heading .modal-close { margin-left: 12px; }

/* Sidebar groups (desktop). */
.sidebar nav .nav-label { margin: 14px 0 6px; padding-left: 13px; }
.sidebar nav .nav-label:first-child { margin-top: 0; }
.sidebar nav a > span:empty { display: none; }
.sidebar nav a > span { color: #77777e; }
.sidebar nav a.active > span { color: #c7461e; }
.topbar { gap: 12px; }
.topbar > .muted { margin-left: auto; }
.topbar .sidebar-toggle + span { margin-right: 0; }
.topbar .notification-bell { margin-left: 0; }

/* Filter chips. */
.filters { align-items: center; gap: 10px; }
.search-field { position: relative; display: flex; align-items: center; flex: 1 1 260px; min-width: 200px; max-width: 420px; margin: 0; }
.search-field .search-icon { position: absolute; left: 12px; display: grid; place-items: center; color: #77777e; pointer-events: none; }
.search-field .search-icon svg { width: 18px; height: 18px; }
.search-field input { width: 100%; min-height: var(--btn-md); padding-left: 38px; border-radius: 999px; }
.search-field input::-webkit-search-cancel-button { cursor: pointer; }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; }
.filter-chip { margin: 0; }
.filter-chip > summary,
button.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--btn-sm);
  padding: 0 12px;
  border: 1px solid #dedee2;
  border-radius: 999px;
  background: #fff;
  color: #4e4e54;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  box-shadow: none;
}
.filter-chip > summary .chip-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip > summary:hover,button.filter-chip:hover,.filter-chip[open] > summary { border-color: #c7c7cc; background: #f6f6f8; color: #29292c; }
.filter-chip.is-active > summary,button.filter-chip.is-active { border-color: #e1aa09; background: #fff7ce; color: #5f4500; }
button.filter-chip svg { width: 16px; height: 16px; }
.filter-chip > summary .chevron svg { width: 16px; height: 16px; }
.filter-menu { left: 0; right: auto; min-width: 230px; max-height: min(60vh, 380px); overflow: auto; }
.filter-summary { display: inline-flex; align-items: center; gap: 6px; }
.filter-summary .count-pill { min-width: 22px; height: 22px; border-color: #e1aa09; background: #fff7ce; color: #5f4500; font-weight: 700; }
.clear-filters { min-height: var(--btn-sm); padding: 0 10px; border-radius: 999px; font-size: 13px; }
@media (max-width: 760px) {
  .filters { display: flex; flex-direction: column; align-items: stretch; }
  .search-field { max-width: none; }
  .filter-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: thin; }
  .filter-chip { flex: none; }
  /* Bottom-sheet menus (database.css) must clear the tab bar and sit above it. */
  .database-menu { z-index: 46; bottom: calc(16px + var(--tabbar-height, 0px)); }
  .filter-menu { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(16px + var(--tabbar-height, 0px)); width: auto; max-height: 55vh; }
  .filter-chip > summary,button.filter-chip { min-height: 36px; }
}

/* Quick task row. */
.quick-add { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; padding: 8px 8px 8px 14px; border: 1px dashed #d2d2d8; border-radius: 14px; background: #fff; }
.quick-add:focus-within { border-style: solid; border-color: #e1aa09; box-shadow: 0 0 0 4px rgb(255 216 65 / 18%); }
.quick-add-icon { display: grid; place-items: center; color: #c7461e; flex: none; }
.quick-add input { flex: 1 1 200px; min-width: 0; min-height: 40px; border: 0; background: transparent; padding: 6px 4px; }
.quick-add input:focus { outline: none; border: 0; }
.quick-add-hint { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7b7b82; font-size: 12px; }
.quick-add button { flex: none; min-height: 36px; padding: 6px 14px; }
@media (max-width: 760px) {
  .quick-add { flex-wrap: wrap; padding: 8px 10px; }
  .quick-add input { flex-basis: 100%; }
  .quick-add-hint { flex: 1; max-width: none; }
}

/* Task completion in the row. */
.task-check { width: 20px; height: 20px; min-height: 0; margin: 0 10px 0 0; vertical-align: -4px; accent-color: #287552; cursor: pointer; }
.task-check:disabled { cursor: progress; }
tr.is-done .work-title { color: #8a8a91; text-decoration: line-through; text-decoration-color: #c9c9cf; }

/* Board lanes keep their own scroll. */
.board { align-items: flex-start; }
.lane { display: flex; flex-direction: column; max-height: min(calc(100dvh - 300px), 820px); min-height: 220px; }
.lane > h3 { flex: none; }
.lane-cards { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px 4px; scrollbar-width: thin; overscroll-behavior: contain; }
.lane-cards > .work-card:last-child { margin-bottom: 4px; }
@media (max-width: 760px) {
  .lane { max-height: calc(100dvh - 240px - var(--tabbar-height, 0px)); }
}

/* Compact mobile cards: title, client, status, date; the rest stays in the detail. */
@media (max-width: 760px) {
  .database-table tbody tr:not(.group-row) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 16px; }
  .database-table td.work-cell { flex: 1 0 100%; }
  .database-table td[data-col] { display: none; }
  .database-table td[data-col=client],.database-table td[data-col=status],.database-table td[data-col=dueDate] { display: flex; flex-direction: row; align-items: center; gap: 6px; flex: 0 1 auto; max-width: 100%; }
  .database-table td[data-col]::before { display: none; }
  .database-table td[data-col=dueDate]::before { content: 'Entrega'; display: inline; font-size: 11px; font-weight: 600; color: #8a8a91; text-transform: none; letter-spacing: 0; }
  .database-table td[data-col=dueDate] { margin-left: auto; font-size: 12px; color: #55555c; }
  .database-table td[data-col=dueDate].overdue { color: #b13d32; }
  .database-table td[data-col=client] .avatar { width: 22px!important; height: 22px!important; min-width: 22px; margin: 0; font-size: 10px; }
  .database-table td[data-col=client] > span { font-size: 12px; max-width: 160px; }
  .database-table .work-cell-edit { padding: 0!important; }
  .database-table .work-title { font-size: 15px; }
}

/* Mobile tab bar; the sidebar sheet stays the "Más" destination. */
.mobile-tabbar { display: none; }
@media (max-width: 760px) {
  :root { --shell-top: 60px; --tabbar-height: calc(60px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: var(--tabbar-height); }
  .mobile-tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 44;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: var(--tabbar-height);
    padding: 4px 6px env(safe-area-inset-bottom, 0px);
    border-top: 1px solid #e8e8eb;
    background: rgb(255 255 255 / 96%);
    backdrop-filter: blur(14px);
  }
  .mobile-tabbar a,.mobile-tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    margin: 0;
    padding: 4px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6b6b72;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
  }
  .mobile-tabbar svg { width: 22px; height: 22px; stroke-width: 2; }
  .mobile-tabbar a.active,.mobile-tabbar button[aria-expanded=true] { color: #c7461e; }
  .mobile-tabbar a:hover,.mobile-tabbar button:hover { background: #f6f6f8; color: #29292c; }
  .mobile-tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar .notification-bell { margin: 0; }
  .sidebar.mobile-nav-open nav .nav-label { display: block; grid-column: 1 / -1; margin: 10px 0 2px; }
  .sidebar nav a > span { display: grid; }
  #notice { bottom: calc(var(--tabbar-height) + 12px); }
  dialog[open]:not(.ec-dialog) { max-height: calc(100dvh - 16px - var(--tabbar-height)); margin-bottom: var(--tabbar-height); }
}

/* Typed toasts. */
#notice { display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; text-align: left; }
#notice .notice-icon { display: grid; place-items: center; flex: none; }
#notice .notice-icon svg { width: 20px; height: 20px; }
#notice .notice-text { min-width: 0; }
#notice.notice-success { background: #1f6b45; border: 1px solid #2d8a5c; }
#notice.notice-error { background: #9f2f24; border: 1px solid #c5473a; }
#notice.notice-info { background: #29292c; border: 1px solid #45454a; }

/* Rich editor and dialog icon controls. */
.description-panel .panel-heading .icon-button { flex: none; }
.editor-emoji-trigger { width: 36px; height: 36px; min-height: 36px; border-radius: 9px; color: #5f5f66; }
.editor-emoji-trigger:hover { background: #f3f4f6; color: #29292c; }
.editor-emoji-trigger svg { width: 20px; height: 20px; }

/* In the stacked mobile filter column the search basis must not become a height */
@media(max-width:760px){.filters .search-field{flex:0 0 auto;width:100%}}
