.gr-resource-button { cursor: pointer; background: transparent; border: 0; padding: 0; font: inherit; }
.gr-time-dock { position: fixed; right: 16px; bottom: 14px; z-index: 160; display: flex; align-items: center; gap: 7px; background: #fffdf8; color: #27292c; border: 1px solid #e2d2b8; border-radius: 12px; box-shadow: 0 3px 14px #27292c18; padding: 6px; font: 13px/1.4 system-ui,sans-serif; }
.gr-time-dock button { border: 0; border-radius: 7px; background: transparent; color: inherit; padding: 7px 9px; cursor: pointer; font: inherit; }
.gr-time-dock button:hover { background: #fff0dc; }
.gr-time-dock[data-running=true] { border-color: #e9a338; }
.gr-resource { width: min(1100px,calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 28px); box-sizing: border-box; padding: 0; border: 1px solid #dfd0b8; border-radius: 16px; background: #fbf8f2; color: #27292c; box-shadow: 0 20px 80px #0004; font: 14px/1.5 system-ui,sans-serif; }
.gr-resource::backdrop { background: #20232680; }
.gr-resource[open] { display: flex; flex-direction: column; }
.gr-resource-header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; border-bottom: 1px solid #e9dfd0; background: #fffdf8; z-index: 1; }
.gr-resource-header h2 { margin: 0; font-size: 20px; }
.gr-resource-content { padding: 20px 22px; overflow: auto; min-height: 0; }
.gr-resource button,.gr-resource .gr-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 13px; border: 1px solid #ddccb2; border-radius: 8px; background: #fffefa; color: #34312d; font: inherit; text-decoration: none; cursor: pointer; }
.gr-resource button:hover,.gr-resource .gr-link:hover { background: #fff0dc; }
.gr-resource button:disabled { opacity: .5; cursor: default; }
.gr-resource .gr-primary { background: #ffad42; border-color: #ffad42; font-weight: 600; }
.gr-resource .gr-close { padding: 3px 10px; font-size: 23px; border: 0; }
.gr-resource input,.gr-resource select,.gr-resource textarea { box-sizing: border-box; width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #dccdb9; background: #fffefa; border-radius: 8px; font: inherit; color: inherit; }
.gr-resource textarea { resize: vertical; }
.gr-resource label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.gr-resource input:focus,.gr-resource select:focus,.gr-resource textarea:focus { outline: 2px solid #f4ba68; outline-offset: 2px; }
.gr-resource-grid { display: grid; grid-template-columns: minmax(230px,1fr) minmax(0,1.7fr); gap: 22px; }
.gr-resource-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.gr-resource-form .gr-wide { grid-column: 1/-1; }
.gr-resource-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.gr-resource-list { list-style: none; padding: 0; margin: 12px 0; max-height: 48vh; overflow: auto; }
.gr-resource-list li { border-bottom: 1px solid #eee4d6; }
.gr-resource-list button { width: 100%; display: block; text-align: left; border: 0; background: transparent; padding: 10px 7px; }
.gr-resource small { display: block; color: #72695e; }
.gr-resource h3 { margin: 0 0 12px; font-size: 18px; overflow-wrap: anywhere; }
.gr-resource h4 { margin: 20px 0 8px; }
.gr-resource dl { display: grid; grid-template-columns: minmax(90px,auto) minmax(0,1fr); gap: 8px 16px; }
.gr-resource dt { color: #746757; }
.gr-resource dd { margin: 0; overflow-wrap: anywhere; }
.gr-resource dd span { display: block; }
.gr-resource [role=alert] { color: #a32d32; margin: 8px 0; }
.gr-resource .gr-hint { color: #72695e; font-size: 13px; }
.gr-resource .gr-clock { font-size: 32px; font-variant-numeric: tabular-nums; margin: 8px 0; }
.gr-resource .gr-tabs { display: flex; flex-wrap: wrap; gap: 7px; border-bottom: 1px solid #e6daca; margin-bottom: 18px; padding-bottom: 12px; }
.gr-resource .gr-tabs button[aria-pressed=true] { background: #fff0dc; border-color: #eda749; }
.gr-resource .gr-table-wrap { overflow: auto; }
.gr-resource table { border-collapse: collapse; width: 100%; font-size: 13px; }
.gr-resource th,.gr-resource td { text-align: left; vertical-align: top; padding: 9px; border-bottom: 1px solid #e9dfd0; overflow-wrap: anywhere; max-width: 300px; }
.gr-resource th { color: #766a59; font-weight: 600; }
.gr-resource .gr-metrics { display: flex; gap: 18px; flex-wrap: wrap; margin: 18px 0; }
.gr-resource .gr-metric { flex: 1; min-width: 150px; border: 1px solid #e6d6bf; border-radius: 12px; padding: 12px 16px; background: #fffefa; }
.gr-resource .gr-metric strong { display: block; font-size: 24px; }
.gr-resource .gr-bar { height: 5px; background: #ffad42; border-radius: 3px; margin-top: 4px; }
@media(max-width:680px) {
 .gr-resource { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 12px; }
 .gr-resource-header,.gr-resource-content { padding: 14px; }
 .gr-resource-grid,.gr-resource-form { grid-template-columns: minmax(0,1fr); }
 .gr-resource-list { max-height: 180px; }
 .gr-time-dock { right: 8px; bottom: 8px; font-size: 11px; max-width: calc(100vw - 85px); }
 .gr-time-dock button { padding: 5px; }
}
@media print { .gr-resource,.gr-time-dock,.gr-resource-button { display: none !important; } }
.gr-time-dock button:first-child { min-width: 0; max-width: 350px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media(max-width:680px) { .gr-time-dock button:first-child { max-width: 145px; } }
.gr-client-access { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; width: 38px; height: 38px; padding: 8px; border: 1px solid #d9c5a6; border-radius: 10px; background: #fffaf2; color: #514331; cursor: pointer; }
.gr-client-access svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.home-actions .gr-client-access { width: 40px; height: 40px; background: transparent; }
.workspace-nav .gr-client-access { width: 100%; height: 34px; justify-content: flex-start; border: 0; background: transparent; font: inherit; }
.gr-client-profile { padding: 22px; border: 1px solid #e9ddcd; border-radius: 15px; background: #fffdfa; box-shadow: 0 8px 24px #6e542b08; }
.gr-profile-head { display: flex; align-items: center; gap: 13px; border-bottom: 1px solid #eee4d6; padding-bottom: 18px; }
.gr-profile-head > div { flex: 1; min-width: 0; }
.gr-profile-head h3 { margin-bottom: 3px; line-height: 1.3; }
.gr-profile-meta { color: #a46f21; font-size: 12px; margin: 0; }
.gr-client-avatar { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 13px; background: #fff0d9; color: #a66c18; font-size: 17px; font-weight: 600; }
.gr-resource .gr-profile-fields { margin: 20px 0; gap: 15px; font-size: 13px; }
.gr-contact-value { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.gr-client-profile a:not(.gr-link) { color: #6e5834; text-decoration-color: #cdb78e; text-underline-offset: 3px; }
.gr-resource .gr-copy { border: 0; background: transparent; padding: 1px 3px; font-size: 11px; color: #88765e; }
.gr-profile-head button { padding: 5px 9px; font-size: 12px; }
.gr-client-profile > .gr-resource-row button { padding: 6px 10px; font-size: 12px; }
.gr-a3-import { padding: 15px; background: #fff8ed; border: 1px dashed #d4b98d; border-radius: 12px; }
.gr-a3-import h4 { margin: 0 0 8px; }
.gr-a3-preview { display: block; max-width: 100%; max-height: 380px; object-fit: contain; margin: 12px auto 0; }
.gr-a3-preview[hidden] { display: none; }
.gr-quick-clock { width: min(520px,calc(100vw - 24px)); }
.gr-quick-clock .gr-resource-list { max-height: 230px; }
.gr-modal-clock { font: inherit; padding: 6px 9px; border: 1px solid #dfcbae; border-radius: 8px; background: #fff6e7; color: #665136; cursor: pointer; white-space: nowrap; }
.gr-resource-header .gr-modal-clock { order: 1; font-size: 12px; }
.gr-resource-header .gr-close { order: 2; }
.gr-resource-header h2 { flex: 1; }
@media(max-width:680px) {
 .gr-client-profile { padding: 14px; }
 .gr-profile-head { flex-wrap: wrap; }
 .gr-resource .gr-profile-fields { grid-template-columns: 1fr; gap: 3px; }
 .gr-profile-fields dd { margin-bottom: 12px; }
 .gr-resource-header .gr-modal-clock { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
}
.gr-resource.gr-analysis-panel { display: block; width: 100%; max-height: none; border: 0; border-radius: 0; background: transparent; padding: 0; box-shadow: none; overflow: visible; }
.gr-comparison { margin: 20px 0; padding: 16px; border: 1px solid #e7d9c4; border-radius: 12px; background: #fffdfa; }
.gr-comparison-item { margin-bottom: 12px; }
.gr-resource .gr-comparison-item > button { border: 0; padding: 0; background: transparent; text-align: left; justify-content: flex-start; }
.gr-comparison-bar { height: 6px; min-width: 0; border-radius: 3px; margin-top: 4px; }
.gr-comparison-bar.current { background: #ffad42; }
.gr-comparison-bar.previous { background: #b9b5af; }
.gr-my-time-profile { margin: 12px 0; padding: 9px 12px; border: 1px solid #d8c5a6; border-radius: 8px; background: #fff8eb; font: inherit; cursor: pointer; }
@media(max-width:680px) { .gr-time-dock { max-width: calc(100vw - 18px); } .gr-time-dock button:first-child { max-width: 100px; } }

/* v135 · Reloj y registros siempre a mano */
.gr-time-dock {padding:7px;gap:5px;border-radius:18px;box-shadow:0 5px 22px #27292c25;border-color:#d7b575;}
.gr-time-dock button {display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:40px;min-height:40px;border-radius:12px;}
.gr-time-dock button:first-child {background:#ffb13e;color:#30291f;}
.gr-time-dock svg {width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;}
.gr-time-dock[data-running=true] button:first-child {background:#fff0d6;box-shadow:inset 0 0 0 1px #e9a338;}
.gr-time-dock button span {font-variant-numeric:tabular-nums;}
.gr-time-dock button[hidden] {display:none;}

.gr-clock-icon {display:inline-flex;align-items:center;justify-content:center;min-width:42px;min-height:42px;}
.gr-clock-icon svg {width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.gr-clock-launch {width:56px;height:56px;border-radius:16px!important;}
.gr-clock-launch svg {width:29px;height:29px;}

.gr-client-active {background:#fff0d6!important;outline:2px solid #cf8e25!important;outline-offset:-2px;}
.gr-modal-clock svg {width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}

/* v140 · One discreet floating control, including inside modal windows. */
.gr-time-dock {inset:auto 14px 12px auto;margin:0;width:max-content;max-width:calc(100vw - 24px);padding:4px;gap:2px;border:1px solid #ded4c5;border-radius:14px;box-shadow:0 3px 16px #30291f18;background:#fffdf9;color:#38332c;overflow:visible;}
.gr-time-dock::backdrop {background:transparent;pointer-events:none;}
.gr-time-dock button {min-width:34px;min-height:34px;padding:6px;border-radius:10px;}
.gr-time-dock button:first-child {max-width:210px;background:transparent;color:inherit;box-shadow:none;overflow:hidden;gap:7px;}
.gr-time-dock[data-running=true] button:first-child {background:transparent;box-shadow:none;}
.gr-time-dock[data-running=false] button:first-child {background:#fff0d6;}
.gr-time-dock[data-running=true] {border-color:#d6c7af;}
.gr-time-dock svg {width:19px;height:19px;}
.gr-time-dock .gr-dock-info {display:flex;flex-direction:column;align-items:flex-start;min-width:0;max-width:154px;line-height:1.2;gap:2px;}
.gr-time-dock .gr-dock-info[hidden] {display:none;}
.gr-time-dock .gr-dock-time {font-size:12px;font-weight:650;font-variant-numeric:tabular-nums;display:flex;align-items:center;gap:5px;}
.gr-dock-time::before {content:'';width:5px;height:5px;border-radius:50%;background:#2d8d61;}
.gr-time-dock[data-state=paused] .gr-dock-time::before {background:#d58c20;}
.gr-dock-context {font-size:10px;color:#776e60;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
@media(max-width:680px){.gr-time-dock {inset:auto 8px max(8px,env(safe-area-inset-bottom)) auto;}.gr-time-dock button:first-child {max-width:160px;}.gr-time-dock .gr-dock-info {max-width:111px;}.gr-dock-context {font-size:9px;}}
@media print{.gr-time-dock {display:none!important;}}

/* v141 · Shared private attachment viewer */
.gr-file-viewer {width:min(1200px,calc(100vw - 24px));height:calc(100dvh - 28px);max-height:calc(100dvh - 28px);}
.gr-file-viewer .gr-resource-header h2 {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
.gr-file-viewer .gr-resource-content {padding:12px;display:flex;flex-direction:column;gap:10px;height:calc(100% - 86px);box-sizing:border-box;}
.gr-file-viewer .gr-resource-row {flex-shrink:0;align-items:center;gap:8px;}
.gr-file-viewer .gr-resource-row .gr-hint {margin:0 auto 0 0;font-variant-numeric:tabular-nums;}
.gr-viewer-stage {flex:1;min-height:0;overflow:auto;background:#efebe4;border:1px solid #e1d7c7;border-radius:12px;position:relative;text-align:center;}
.gr-viewer-stage>img {display:block;width:100%;max-width:none;height:auto;margin:auto;object-fit:contain;}
.gr-viewer-stage>iframe {width:100%;height:calc(100% - 30px);min-height:250px;border:0;display:block;background:white;}
.gr-viewer-stage>.gr-viewer-pdf-hint {font-size:11px;margin:5px;color:#71685a;}
.gr-viewer-unsupported {padding:40px 20px;}
@media(max-width:600px){.gr-file-viewer{width:calc(100vw - 8px);height:calc(100dvh - 8px);max-height:calc(100dvh - 8px)}.gr-file-viewer .gr-resource-content{padding:7px;height:calc(100% - 67px)}.gr-file-viewer .gr-resource-row{gap:4px}.gr-file-viewer .gr-resource-row button,.gr-file-viewer .gr-resource-row a{font-size:12px;padding:7px}}

/* v142 · Pending counters remain visible in every module */
.module-rail .module-link {position:relative;overflow:visible;}
.module-rail .module-count {position:absolute;top:-3px;right:-5px;min-width:17px;height:17px;padding:0 4px;box-sizing:border-box;border-radius:12px;background:#c44332;color:#fff;font:700 10px/17px system-ui,sans-serif;text-align:center;pointer-events:none;box-shadow:0 0 0 2px #27292c;z-index:2;}
.module-rail .module-count[hidden],.gr-home-wa-count[hidden]{display:none!important;}
#hub-whatsapp {position:relative;}
.gr-home-wa-count {position:absolute;top:15px;right:15px;min-width:23px;height:23px;padding:0 6px;box-sizing:border-box;border-radius:14px;background:#c44332;color:white;font:700 12px/23px system-ui,sans-serif;text-align:center;}

/* v164 · Cierre consistente en fichas y registros */
.gr-resource-header{padding-right:66px}.gr-resource-header .gr-close{position:absolute;right:16px;top:50%;transform:translateY(-50%);width:36px;height:36px;padding:0;border-radius:50%;font-size:24px;flex:none}
/* v167 · Horas extra al parar el reloj */
.gr-overtime-ask { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 8px; padding: 10px 12px; border: 1px solid #cfe2d3; border-radius: 12px; background: #f1f8f2; color: #2c4a35; font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.gr-overtime-ask input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.gr-overtime-ask[hidden] { display: none; }
.gr-resource .gr-overtime-ask { display: flex !important; flex-direction: row; }
.gr-resource .gr-overtime-ask input { width: 18px !important; min-height: 0 !important; }
.gr-resource .gr-overtime-ask span { flex: 1; }
/* v167 · En WhatsApp, la barra flotante (reloj, estado, horas extra) no tapa el botón «Enviar por WhatsApp». */
@media(min-width:681px){ body:has(.gr-time-dock) #composer:not([hidden]) { padding-bottom: 56px; } }
/* v175 · Dentro de un diálogo, el dock no tapa los botones del pie (Guardar, Derivar…). */
/* v207 · El control de reloj, fichaje y estado queda SIEMPRE en su sitio (abajo a la derecha), también con una tarjeta o ventana abierta. */
dialog[open] > .gr-time-dock { right: 14px; left: auto; }
/* v225 · En escritorio el pie de cada ventana deja sitio debajo para el dock: ya no tapa «Guardar», «Marcar como gestionado», «Derivar»… */
@media(min-width:681px) { dialog[open]:has(> .gr-time-dock) footer { padding-bottom: 66px; } }
@media(max-width:680px) { dialog[open] > .gr-time-dock { right: 8px; left: auto; } dialog[open]:has(> .gr-time-dock) footer { padding-bottom: 66px; } }

/* v193 · Tipo de trabajo */
.gr-kind-box h4 { margin: 4px 0 8px; }
.gr-kind-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.gr-kind-picker .gr-kind { padding: 7px 12px; border-radius: 999px; border: 1px solid #e0cfb2; background: #fffefa; font-weight: 600; cursor: pointer; min-height: 36px; }
.gr-kind-picker .gr-kind[aria-pressed="true"] { background: #f4a450; border-color: #f4a450; color: #1f1a17; }
.gr-kind-editor { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.gr-kind-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gr-kind-row input:not([type=checkbox]) { flex: 1 1 200px; min-width: 0; }
.gr-kind-active { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.gr-kind-fixed { margin: 4px 0 10px; font-weight: 600; color: #5c3a12; }

/* v207 · Visor de adjuntos: la imagen se abre entera; con zoom se desplaza dentro del visor */
.gr-viewer-stage:has(>img) {display:grid;grid-template:minmax(0,1fr) / minmax(0,1fr);place-items:center;}
.gr-viewer-stage>img {width:auto;height:auto;max-width:100%;max-height:100%;margin:0;cursor:zoom-in;user-select:none;-webkit-user-drag:none;}
.gr-viewer-stage.zoomed, .gr-viewer-stage.zoomed:has(>img) {display:block;}
.gr-viewer-stage.zoomed>img {max-width:none;max-height:none;margin:auto;cursor:grab;}
