:root {
    --bg: #0e0e10;
    --bg2: #16161a;
    --bg3: #1e1e24;
    --bg4: #26262e;
    --border: #2e2e38;
    --border2: #3a3a48;
    --text: #e8e8f0;
    --text2: #9898b0;
    --accent: #7c6aff;
    --accent2: #5a4dd4;
    --green: #34c98a;
    --red: #ff4f4f;
    --amber: #f5a623;
    --blue: #4a9eff;
    --pink: #ff6eb3;
    --teal: #3dd9b5;
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
}

::-webkit-scrollbar {
    width: 5px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 3px;
}

.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 216px;
    min-width: 216px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 18px 14px 10px;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -.4px;
}

.sidebar-logo span {
    color: var(--accent);
}

.sidebar-section {
    padding: 10px 10px 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    border-radius: var(--radius);
    margin: 1px 5px;
    cursor: pointer;
    color: var(--text2);
    font-size: 13px;
    transition: all .15s;
}

.nav-item:hover {
    background: var(--bg3);
    color: var(--text);
}

.nav-item.active {
    background: var(--bg4);
    color: var(--text);
}

.nav-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-user {
    margin-top: auto;
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    border-radius: var(--radius);
    margin: auto 5px 5px;
}

.sidebar-user:hover {
    background: var(--bg3);
}

.ua {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.ua img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uname {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.urole {
    font-size: 10px;
    color: var(--text2);
}

/* Topbar */
.topbar {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg2);
    flex-shrink: 0;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    gap: 7px;
    align-items: center;
}

/* Search — colapsado a ícono de lupa; se expande al hacer clic */
.srch-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.srch-inp {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 0;
    color: var(--text);
    font-size: 13px;
    width: 0;
    min-width: 0;
    opacity: 0;
    border-width: 0;
    pointer-events: none;
    font-family: inherit;
    transition: width .18s ease, opacity .15s ease, padding .18s ease;
}

.srch-wrap.open .srch-inp {
    width: 200px;
    opacity: 1;
    padding: 6px 10px;
    border-width: 1px;
    pointer-events: auto;
}

.srch-inp:focus {
    outline: none;
    border-color: var(--accent);
}

.srch-res {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 300px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    z-index: 300;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
    display: none;
}

.srch-item {
    padding: 9px 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
}

.srch-item:hover {
    background: var(--bg4);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    transition: all .15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent2);
}

.btn-ghost {
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg3);
    color: var(--text);
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

.btn-green {
    background: rgba(52, 201, 138, .15);
    color: var(--green);
    border: 1px solid rgba(52, 201, 138, .3);
}

.btn-green:hover {
    background: var(--green);
    color: #000;
}

.btn-sm {
    padding: 4px 9px;
    font-size: 11px;
}

.btn-icon {
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all .15s;
}

.btn-icon:hover {
    background: var(--bg3);
    color: var(--text);
}

/* Content */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}

/* Kanban */
.kanban-wrap {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 14px;
    height: 100%;
    align-items: flex-start;
}

.kcol {
    min-width: 252px;
    width: 252px;
    flex-shrink: 0;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 128px);
}

.kcol-hdr {
    padding: 11px 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.kcol-title {
    font-size: 12px;
    font-weight: 600;
    flex: 1;
}

.kcol-cnt {
    background: var(--bg4);
    color: var(--text2);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 9px;
}

.kcol-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kcol-cards {
    flex: 1;
    overflow-y: auto;
    padding: 7px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.kcol-add {
    padding: 7px;
    flex-shrink: 0;
}

/* Task card */
.tcard {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 11px;
    cursor: pointer;
    transition: all .15s;
    position: relative;
}

.tcard:hover {
    border-color: var(--border2);
    background: var(--bg4);
}

.tcard.urgent {
    border-left: 3px solid var(--red);
}

.tcard.overdue::before {
    content: 'Fuera del plazo';
    display: block;
    background: rgba(255, 79, 79, .12);
    color: var(--red);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 5px;
    width: fit-content;
}

.tcard-id {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--text2);
    margin-bottom: 3px;
}

.tcard-name {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 5px;
}

.tcard-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.ttag {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 9px;
    font-weight: 500;
}

.ttag-urgent {
    background: rgba(255, 79, 79, .14);
    color: var(--red);
}

.ttag-team {
    background: rgba(124, 106, 255, .14);
    color: var(--accent);
}

.ttag-hours {
    background: rgba(52, 201, 138, .14);
    color: var(--green);
}

.tcard-av {
    margin-left: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.tcard-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Checklist board */
.checklist-wrap {
    max-width: 640px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 7px;
    cursor: pointer;
    transition: all .15s;
}

.check-item:hover {
    border-color: var(--border2);
}

.check-item.done {
    opacity: .55;
}

.check-item.done .check-label {
    text-decoration: line-through;
}

.check-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
    cursor: pointer;
}

.check-box.checked {
    background: var(--green);
    border-color: var(--green);
}

.check-label {
    flex: 1;
    font-size: 13px;
}

/* Modal */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    z-index: 400;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.overlay.open {
    display: flex;
}

.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
}

.modal-lg {
    max-width: 700px;
}

.modal-taskform {
    max-width: 680px;
}

.mhdr {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mtitle {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.mbody {
    padding: 18px;
}

.mftr {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 7px;
    justify-content: flex-end;
}

/* Forms */
.fr {
    margin-bottom: 13px;
}

.fr2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
    margin-bottom: 13px;
}

.fr3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 11px;
    margin-bottom: 13px;
}

label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

input[type=text],
input[type=password],
input[type=date],
input[type=number],
select,
textarea {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 11px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    transition: border .15s;
}

input[type=text]:focus,
input[type=password]:focus,
input[type=date]:focus,
input[type=number]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

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

select option {
    background: var(--bg3);
}

.cb-row {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    margin-top: 4px;
}

input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1px;
    padding: 0 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    flex-shrink: 0;
}

.tab {
    padding: 11px 14px;
    font-size: 12px;
    color: var(--text2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* Cards/Grids */
.grid3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 11px;
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 11px;
}

.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px;
}

.task-detail-right {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.task-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 4px;
}

.activity-panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 280px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    max-height: 360px;
}

.activity-entry {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.activity-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.activity-entry-user {
    display: flex;
    gap: 10px;
    align-items: center;
}

.activity-entry-text {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text);
}

.activity-input {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-input textarea {
    min-height: 110px;
}

.activity-input-actions {
    display: flex;
    justify-content: flex-end;
}

.activity-checklist {
    display: flex;
    flex-direction: column;
}

.task-detail-right textarea {
    min-height: 120px;
}

.card .sm.muted {
    color: var(--text2);
}

.card .sm.fw5 {
    color: var(--text);
}

.card .flex.ic.gap10 {
    align-items: flex-start;
}

.card .ttag {
    font-size: 10px;
}

.card .ttag-team {
    padding: 2px 6px;
}

.card-h {
    cursor: pointer;
    transition: all .15s;
}

.card-h:hover {
    border-color: var(--border2);
    background: var(--bg3);
}

/* Member cards */
.mcard {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}

.mcard:hover {
    border-color: var(--accent);
}

.mav {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.mav img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Role badges */
.rb {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 9px;
    font-weight: 600;
}

.rb-ceo {
    background: rgba(245, 166, 35, .15);
    color: var(--amber);
}

.rb-coordinador {
    background: rgba(255, 110, 179, .15);
    color: var(--pink);
}

.rb-lider {
    background: rgba(74, 158, 255, .15);
    color: var(--blue);
}

.rb-operador {
    background: rgba(61, 217, 181, .15);
    color: var(--teal);
}

/* Archive list */
.arc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
}

.arc-item:hover {
    border-color: var(--border2);
}

/* Area cards */
.acard {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.acard-hdr {
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.acard-foot {
    padding: 11px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* Stage list in form */
.stage-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 5px;
}

.sname-inp {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
}

.sname-inp:focus {
    outline: none;
}

/* Hours log */
.hlog-item {
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 18px;
    right: 18px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 11px 15px;
    font-size: 13px;
    z-index: 999;
    animation: fadeUp .2s ease;
    max-width: 280px;
    pointer-events: none;
}

.toast.s {
    border-left: 3px solid var(--green);
}

.toast.e {
    border-left: 3px solid var(--red);
}

@keyframes fadeUp {
    from {
        transform: translateY(14px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 360px;
}

.login-logo {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.login-logo span {
    color: var(--accent);
}

.login-sub {
    color: var(--text2);
    font-size: 13px;
    margin-bottom: 24px;
}

.login-err {
    background: rgba(255, 79, 79, .12);
    color: var(--red);
    border: 1px solid rgba(255, 79, 79, .25);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}

/* Spinner */
.spin {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: auto;
}

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

/* Profile */
.prof-av {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
}

.prof-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Empty */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 50px 20px;
    color: var(--text2);
    text-align: center;
}

.empty-ico {
    font-size: 36px;
    opacity: .35;
}

/* Drag */
.tcard.dragging {
    opacity: .4;
}

.kcol.dragover {
    background: var(--bg3);
}

/* Divider */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

/* Misc */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 500;
}

.pill-acc {
    background: rgba(124, 106, 255, .14);
    color: var(--accent);
}

.mono {
    font-family: 'DM Mono', monospace;
}

.muted {
    color: var(--text2);
}

.sm {
    font-size: 11px;
}

.fw5 {
    font-weight: 500;
}

.flex {
    display: flex;
}

.ic {
    align-items: center;
}

.gap8 {
    gap: 8px;
}

.gap12 {
    gap: 12px;
}

.ml-a {
    margin-left: auto;
}

.mt14 {
    margin-top: 14px;
}

.mb14 {
    margin-bottom: 14px;
}

/* Board type toggle */
.btype-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 13px;
}

.btype-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all .15s;
    background: var(--bg3);
}

.btype-btn.active {
    border-color: var(--accent);
    background: rgba(124, 106, 255, .1);
}

.btype-btn .ico {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.btype-btn .lbl {
    font-size: 12px;
    font-weight: 500;
}

.btype-btn .sub {
    font-size: 10px;
    color: var(--text2);
    margin-top: 2px;
}

/* Hours timer */
.htimer {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.htimer-display {
    font-family: 'DM Mono', monospace;
    font-size: 22px;
    font-weight: 500;
    color: var(--green);
}

.htimer.running .htimer-display {
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .6
    }
}

/* Responsive sidebar toggle */
.menu-btn {
    display: none;
}
/* ══════════════════════════════════════════════════════════════
   TASK DETAIL — Split panel layout
   ══════════════════════════════════════════════════════════════ */

/* Extra-wide modal for task detail */
.modal-xl {
    max-width: 1080px;
    max-height: 92vh;
}

/* Split layout */
.td-split {
    display: flex;
    gap: 0;
    padding: 0;
    min-height: 520px;
    overflow: hidden;
}

/* Left panel */
.td-left {
    width: 320px;
    min-width: 280px;
    flex-shrink: 0;
    padding: 18px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    max-height: calc(92vh - 120px);
}

/* Right panel */
.td-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-height: calc(92vh - 120px);
}

/* Meta rows */
.td-meta-block {
    margin-bottom: 14px;
}

.td-meta-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.td-meta-row:last-child { border-bottom: none; }

.td-meta-label {
    width: 80px;
    min-width: 80px;
    color: var(--text2);
    font-size: 11px;
    padding-top: 1px;
    flex-shrink: 0;
}

.td-meta-val {
    flex: 1;
    color: var(--text);
    word-break: break-word;
}

.td-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text2);
    margin-bottom: 8px;
    margin-top: 14px;
}

/* Hours stats */
.td-hours-total {
    font-size: 20px;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 10px;
}

.td-time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.td-time-cell {
    border: 1px solid;
    border-radius: var(--radius);
    padding: 8px;
    text-align: center;
}

.td-time-val {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 600;
}

.td-time-lbl {
    font-size: 9px;
    color: var(--text2);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.td-efficiency {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 6px;
}

.td-eff-label {
    font-size: 10px;
    color: var(--text2);
    width: 100px;
    flex-shrink: 0;
}

.td-eff-bar {
    flex: 1;
    height: 5px;
    background: var(--bg4);
    border-radius: 3px;
    overflow: hidden;
}

.td-eff-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .3s;
}

.td-eff-pct {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    min-width: 38px;
    text-align: right;
}

/* ── Bitácora (right panel) ────────────────────────────────── */
.bz-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bz-entry {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    transition: border-color .15s;
}

.bz-entry:hover { border-color: var(--border2); }

.bz-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.bz-stage-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 9px;
    font-weight: 600;
}

.bz-entry-date {
    font-size: 10px;
    color: var(--text2);
    margin-left: auto;
    font-family: 'DM Mono', monospace;
}

.bz-entry-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.bz-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
}

.bz-check-row.done .bz-check-text {
    text-decoration: line-through;
    color: var(--text2);
    opacity: .7;
}

.bz-check-box { flex-shrink: 0; }

.bz-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

/* Input area */
.bz-input-area {
    border-top: 1px solid var(--border);
    background: var(--bg2);
    flex-shrink: 0;
}

.bz-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px 4px;
    border-bottom: 1px solid var(--border);
}

.bz-tool {
    background: transparent;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    transition: all .15s;
}

.bz-tool:hover { background: var(--bg3); color: var(--text); }

.bz-tool-checklist { color: var(--green); }

.bz-mode-label {
    margin-left: auto;
    font-size: 10px;
    color: var(--text2);
    background: var(--bg3);
    padding: 2px 8px;
    border-radius: 9px;
}

.bz-editor {
    min-height: 60px;
    max-height: 140px;
    overflow-y: auto;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    line-height: 1.6;
}

.bz-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text2);
    pointer-events: none;
}

.bz-editor ul, .bz-editor ol {
    padding-left: 18px;
    margin: 2px 0;
}

.bz-input-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 8px;
}

#bzHint {
    flex: 1;
    font-size: 10px;
    color: var(--text2);
}

/* ── Activity entry (legacy compat) ──────────────────────────── */
.activity-entry { margin-bottom: 10px; }
.activity-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px;
}
.activity-entry-user {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.activity-entry-text {
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Estilos para el contenedor de herramientas */
.tool-wrapper {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 20px auto;
    max-width: 600px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-wrapper h3 {
    color: var(--accent);
    margin-bottom: 10px;
}

.tool-wrapper p {
    color: var(--text2);
    font-size: 12px;
}

.tool-wrapper input,
.tool-wrapper button {
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 10px;
    border-radius: var(--radius);
}

.tool-wrapper button {
    cursor: pointer;
    background: var(--accent);
    border: none;
}

.tool-wrapper button:hover {
    background: var(--accent2);
}

/* Corrección para el visor de herramientas */
.tool-container-modal {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 0 auto; /* Quitamos margin-top para que se ajuste al modal */
    width: 100%;
    color: var(--text);
    display: block; /* Asegura que no sea una línea */
    box-sizing: border-box;
}

/* Asegurar que las herramientas no se oculten por overflow */
.tool-wrapper {
    display: block;
    width: 100%;
}
/* ══════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════ */

.db-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

/* v4.4 — Salud general del equipo */
.db-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
/* Salud general: stats en 1/4 izq, barras % en 3/4 der */
.db-health-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}
.db-health-left { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: start; }
.db-health-right { min-width: 0; }
@media (max-width: 900px) {
    .db-health-layout { grid-template-columns: 1fr; }
}
.db-hstat {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.db-hval { font-size: 22px; font-weight: 700; line-height: 1.1; }
.db-hlbl { font-size: 11px; color: var(--text2); margin-top: 4px; }
.db-hsub { font-size: 10px; color: var(--text2); margin-top: 3px; opacity: .8; }
.db-i {
    width: 18px; height: 18px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg3);
    color: var(--text2); font-size: 11px; font-weight: 700;
    cursor: pointer; line-height: 1; flex-shrink: 0;
}
.db-i:hover { color: var(--text); border-color: var(--accent); }
.db-i-pop {
    position: absolute; top: 24px; left: 0; z-index: 200;
    width: 320px; max-width: 80vw;
    background: #0c1220; border: 1px solid var(--border2, #2a3550);
    border-radius: 9px; padding: 12px 14px;
    font-size: 11px; line-height: 1.6; color: var(--text);
    text-transform: none; letter-spacing: 0; font-weight: 400;
    box-shadow: 0 16px 40px rgba(0,0,0,.7);
}

.db-kpi-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 12px;
    text-align: center;
    transition: border-color .15s;
}

.db-kpi-card:hover { border-color: var(--border2); }

.db-kpi-ico {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin: 0 auto 8px;
}

.db-kpi-val {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.db-kpi-lbl {
    font-size: 10px;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.db-section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 14px;
}

.db-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text2);
    margin-bottom: 12px;
}

.db-time-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.db-time-cell {
    border: 1px solid;
    border-radius: var(--radius);
    padding: 10px;
    text-align: center;
}

.db-time-val {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.db-time-lbl {
    font-size: 9px;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.db-eff-bar-wrap {
    height: 4px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.db-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 900px) {
    .db-cols { grid-template-columns: 1fr; }
}

.db-col {}

.db-area-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.db-area-row:last-child { border-bottom: none; }

.db-area-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.db-area-ico {
    width: 30px;
    height: 30px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.db-team-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
    border-radius: var(--radius);
}

.db-team-row > div:nth-child(3) {
        display: flex;
        gap: 5%;
        justify-content: space-between;
        width: 45%;
}

.db-team-row:last-child { border-bottom: none; }
.db-team-row:hover { background: var(--bg3); padding-left: 4px; }

.db-milestone-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}

.db-milestone-row:last-child { border-bottom: none; }
.db-milestone-row:hover { background: var(--bg3); border-radius: var(--radius); padding-left: 4px; }

.db-blocker-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}

.db-blocker-row:last-child { border-bottom: none; }
.db-blocker-row:hover { background: var(--bg3); border-radius: var(--radius); padding-left: 4px; }

.db-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 9px;
    font-weight: 600;
    flex-shrink: 0;
}

.db-badge-green { background: rgba(52,201,138,.15); color: var(--green); }
.db-badge-red   { background: rgba(255,79,79,.15);  color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   TOOL IFRAME MODAL — full-page tool
   ══════════════════════════════════════════════════════════════ */
.modal-tool {
    max-width: 900px;
    width: 96vw;
    max-height: 94vh;
    height: 94vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-tool .mhdr {
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   TOPBAR CLOCK — Lima GMT-5
   ══════════════════════════════════════════════════════════════ */
.topbar {
    position: relative;
}

.topbar-clock {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 10px;
    margin-left: 14px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    user-select: none;
    flex-shrink: 0;
}

.topbar-clock-time {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: .5px;
    line-height: 1;
}

.topbar-clock-date {
    font-size: 10px;
    color: var(--text2);
    letter-spacing: .3px;
    line-height: 1;
}

/* En pantallas pequeñas, ocultar la fecha y dejar solo la hora */
@media (max-width: 1100px) {
    .topbar-clock-date { display: none; }
    .topbar-clock { margin-left: 8px; padding: 4px 8px; }
}
@media (max-width: 900px) {
    .topbar-clock { display: none; }
}

/* ── Notificación de almuerzo ────────────────────────────────── */
.lunch-toast {
    position: fixed;
    bottom: 18px;
    right: 18px;
    background: var(--bg3);
    border: 1px solid var(--green);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    padding: 13px 18px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeUp .3s ease, lunchPulse 1s ease 1s;
    max-width: 300px;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(52,201,138,.2);
}

@keyframes lunchPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ══════════════════════════════════════════════════════════════
   BITÁCORA — Nuevo dual-pane input
   ══════════════════════════════════════════════════════════════ */

/* Tab buttons del toolbar */
.bz-tool-active {
    background: var(--accent) !important;
    color: #fff !important;
}

/* Sub-toolbar de formato dentro del editor de notas */
.bz-note-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--bg3);
}

.bz-fmt-btn {
    background: transparent;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    transition: all .12s;
    line-height: 1.4;
}

.bz-fmt-btn:hover {
    background: var(--bg4);
    color: var(--text);
}

/* Panel de checklist */
#bzCheckPane input[type="text"] {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    transition: border-color .15s;
}

#bzCheckPane input[type="text"]:focus {
    border-color: var(--accent);
}

/* Fila de ítem en el pane de checklist */
.bz-cl-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.bz-cl-item-row:last-child {
    border-bottom: none;
}

.bz-cl-bullet {
    color: var(--text2);
    font-size: 13px;
    flex-shrink: 0;
}

.bz-cl-item-text {
    flex: 1;
    color: var(--text);
}

.bz-cl-remove {
    background: transparent;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    transition: all .12s;
    flex-shrink: 0;
}

.bz-cl-remove:hover {
    background: rgba(255,79,79,.15);
    color: var(--red);
}

/* ══════════════════════════════════════════════════════════════
   CALENDAR CSS
   ══════════════════════════════════════════════════════════════ */
.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cal-hdr {
    background: var(--bg3);
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 8px 4px;
}

.cal-cell {
    background: var(--bg2);
    min-height: 90px;
    padding: 6px;
    position: relative;
    transition: background .12s;
}

.cal-cell:hover { background: var(--bg3); }

.cal-cell-empty { background: var(--bg); }

.cal-today {
    background: rgba(124,106,255,.06);
    box-shadow: inset 0 0 0 1px rgba(124,106,255,.3);
}

.cal-day-num {
    font-size: 11px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: 4px;
}

.cal-today-num {
    background: var(--accent);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cal-task-pill {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .12s;
}

.cal-task-pill:hover { opacity: .8; }

.cal-more {
    font-size: 9px;
    color: var(--text2);
    padding: 1px 4px;
}

/* Week view */
.cal-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-week-col {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.cal-week-today {
    border-color: var(--accent);
    background: rgba(124,106,255,.04);
}

.cal-week-hdr {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    background: var(--bg3);
}

.cal-week-num {
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}

.cal-week-tasks {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 80px;
}

.cal-task-card {
    padding: 6px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity .12s;
}

.cal-task-card:hover { opacity: .85; }

/* Day view */
.cal-day-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    transition: border-color .15s;
}

.cal-day-card:hover { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   DEADLINE TAGS — Pronto a vencer / Fuera del plazo
   ══════════════════════════════════════════════════════════════ */

/* Tarjeta "pronto a vencer" — borde y fondo amarillo sutil */
.tcard.due-soon {
    border-color: rgba(245,166,35,.5);
    background: rgba(245,166,35,.04);
}

/* Tag amarillo "Pronto a vencer" */
.ttag-soon {
    background: rgba(245,166,35,.15);
    color: var(--amber);
    border: 1px solid rgba(245,166,35,.35);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 9px;
    font-weight: 600;
    white-space: nowrap;
}

/* Tag rojo "Fuera del plazo" (reemplaza el inline anterior) */
.ttag-overdue {
    background: rgba(255,79,79,.12);
    color: var(--red);
    border: 1px solid rgba(255,79,79,.3);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 9px;
    font-weight: 600;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   BITÁCORA — Dual-pane checklist styles
   ══════════════════════════════════════════════════════════════ */

.bz-tool-tab {
    border-radius: var(--radius) !important;
    padding: 4px 12px !important;
    font-size: 12px !important;
    transition: all .15s !important;
}

.bz-tool-active {
    background: var(--accent) !important;
    color: #fff !important;
}

.bz-note-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--bg3);
}

.bz-fmt-btn {
    background: transparent;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    line-height: 1.4;
    transition: all .12s;
}

.bz-fmt-btn:hover {
    background: var(--bg4);
    color: var(--text);
}

.bz-cl-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 2px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.bz-cl-item-row:last-child { border-bottom: none; }

.bz-cl-bullet {
    color: var(--text2);
    font-size: 13px;
    flex-shrink: 0;
}

.bz-cl-item-text {
    flex: 1;
    color: var(--text);
}

.bz-cl-remove {
    background: transparent;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1;
    transition: all .12s;
    flex-shrink: 0;
}

.bz-cl-remove:hover {
    background: rgba(255,79,79,.15);
    color: var(--red);
}

#bzCheckPane input[type="text"] {
    background: var(--bg3) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 6px 10px !important;
    color: var(--text) !important;
    font-family: inherit !important;
    font-size: 12px !important;
    outline: none !important;
    width: 100%;
    box-sizing: border-box;
}

#bzCheckPane input[type="text"]:focus {
    border-color: var(--accent) !important;
}

/* ════════════════════════════════════════════════════════════════
   v4.2 — Módulo Administración (Tarea Rápida + Recurrentes)
   ════════════════════════════════════════════════════════════════ */
.bc-quick-admin {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    margin-left: 4px;
}
.bc-quick-admin:hover {
    background: var(--accent2);
    transform: translateY(-1px);
}

/* Modales v4.2 — primitivas reutilizables */
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border, #2a2a3e);
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text2, #9898b0);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.modal-close:hover {
    background: rgba(255,255,255,.08);
    color: var(--text, #fff);
}
.modal-body { padding: 16px 22px; }
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}
.form-row {
    margin-bottom: 14px;
}
.form-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text2, #9898b0);
    font-weight: 500;
}
.form-row input,
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg2, #1a1a2e);
    border: 1px solid var(--border, #2a2a3e);
    border-radius: 6px;
    color: var(--text, #fff);
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    border-color: var(--accent);
    outline: none;
}
.btn-secondary {
    background: transparent;
    color: var(--text2, #9898b0);
    border: 1px solid var(--border, #2a2a3e);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.btn-secondary:hover {
    background: rgba(255,255,255,.05);
    color: var(--text, #fff);
}
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* v4.3.3 — Línea de tiempo de cambios de etapa en task-detail */
.bz-timeline {
    padding: 8px 4px;
}
.bz-tab {
    transition: all .15s;
}
.bz-tab:hover {
    color: var(--text) !important;
}
.tl-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    padding-bottom: 16px;
}
.tl-axis {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.tl-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}
.tl-line {
    width: 2px;
    flex: 1;
    background: var(--border, #2a2a3e);
    margin-top: 6px;
}
.tl-content {
    min-width: 0;
    padding-bottom: 4px;
}
.tl-row1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.tl-row2 {
    color: var(--text2, #9898b0);
    line-height: 1.4;
}

/* v4.3.4 — Una sola fila por iteración en la línea de tiempo */
.tl-row-single {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: hidden;
    padding-bottom: 4px;
}
.tl-when {
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #fff);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.tl-who {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* v4.3.5 — Línea de tiempo unificada con scroll vertical */
.bz-timeline {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 6px 8px 4px;
    min-height: 0;
    max-height: 100%;
}
.bz-timeline::-webkit-scrollbar { width: 6px; }
.bz-timeline::-webkit-scrollbar-thumb { background: var(--border, #2a2a3e); border-radius: 3px; }
.bz-timeline::-webkit-scrollbar-thumb:hover { background: var(--text2, #555); }

.tl-content-multi {
    min-width: 0;
    padding-bottom: 4px;
}
.tl-note-text {
    margin-top: 6px;
    padding: 8px 10px;
    background: var(--bg3, rgba(255,255,255,.04));
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text, #fff);
}

/* v4.3.8 — Duración de etapa en la línea de tiempo */
.tl-duration {
    margin-left: auto;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text2, #9898b0);
    background: var(--bg3, rgba(255,255,255,.04));
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Herramientas / Accesos (distribución en cards) ─────────────── */
.tf-sec-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.tf-sec-title{font-size:15px;font-weight:600}
.tf-sec-sub{font-size:12px;color:var(--text2);margin-top:2px}
.tf-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
.tf-card{position:relative;background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:8px;transition:border-color .15s}
.tf-card:hover{border-color:var(--border2)}
.tf-card-flag{position:absolute;top:0;left:0;right:0;padding:3px 10px;font-size:10px;font-weight:600;border-radius:var(--radius-lg) var(--radius-lg) 0 0;text-align:center}
.tf-card-ico{width:44px;height:44px;border-radius:var(--radius);background:var(--bg4);display:flex;align-items:center;justify-content:center;font-size:22px}
.tf-card-title{font-size:14px;font-weight:600;word-break:break-word}
.tf-card-desc{font-size:12px;color:var(--text2);word-break:break-word}
.tf-card-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto;padding-top:6px}
.tf-empty{background:var(--bg2);border:1px dashed var(--border2);border-radius:var(--radius-lg);padding:26px;text-align:center;font-size:13px;color:var(--text2)}
.tf-access-head{display:flex;align-items:center;gap:10px}
.tf-access-field{display:flex;align-items:center;gap:8px;font-size:12px;background:var(--bg3);border-radius:8px;padding:6px 8px}
.tf-af-lbl{color:var(--text2);min-width:52px;flex-shrink:0}
.tf-af-val{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:'DM Mono',monospace}
.tf-af-btn{background:none;border:none;color:var(--text2);cursor:pointer;font-size:13px;padding:2px 4px;border-radius:5px;line-height:1}
.tf-af-btn:hover{color:var(--accent);background:var(--bg4)}
.tf-pending{background:rgba(242,169,51,.08);border:1px solid rgba(242,169,51,.3);border-radius:var(--radius-lg);padding:14px;margin-bottom:16px}
.tf-pending-title{font-size:13px;font-weight:600;margin-bottom:10px}
.tf-pending-item{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;margin-bottom:8px}
.tf-pending-h{font-size:12px;margin-bottom:6px}
.tf-diff{font-size:11px;color:var(--text2);margin:2px 0}
.tf-diff span{display:inline-block;min-width:64px;color:var(--text);font-weight:500}
.tf-diff del{color:var(--red);text-decoration:line-through;opacity:.8}
.tf-diff ins{color:var(--green);text-decoration:none}
.tf-pending-act{display:flex;gap:6px;margin-top:8px}
.tf-vis-list{display:flex;flex-direction:column;gap:2px;max-height:50vh;overflow:auto}
.tf-vis-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:8px;font-size:13px}
.tf-vis-row:hover{background:var(--bg3)}

/* ── Login split InVitro Projects ───────────────────────────────── */
.iv-login{width:100%;height:100vh;display:flex;font-family:'DM Sans',system-ui,-apple-system,sans-serif;background:#fff;overflow:hidden}
.iv-login-left{flex:1;background:#fff;display:flex;align-items:center;justify-content:center;padding:40px}
.iv-login-form{max-width:350px;width:100%}
.iv-login-h1{font-size:30px;font-weight:700;color:#262626;letter-spacing:-.5px}
.iv-login-sub{font-size:15px;color:#777777;margin:10px 0 30px;line-height:1.6}
.iv-msbtn{width:100%;padding:15px 16px;border-radius:12px;border:none;background:#3333CC;color:#fff;font-size:15px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:10px;cursor:pointer;font-family:inherit;transition:background .15s}
.iv-msbtn:hover{background:#2a2aa8}
.iv-login-note{display:flex;gap:9px;margin-top:24px;font-size:13px;color:#919191;line-height:1.6;background:#F2F2F2;border-radius:10px;padding:13px 15px}
.iv-login .login-err{color:var(--red);font-size:13px;margin-bottom:14px}
.iv-login-right{flex:1.62;position:relative;overflow:hidden;background:linear-gradient(158deg,#3a3ad9 0%,#4b3fd8 46%,#2a2a86 100%);display:flex;align-items:center;justify-content:center}
.iv-login-glow{position:absolute;top:-160px;right:-120px;width:460px;height:460px;border-radius:50%;background:radial-gradient(circle,#30CEB3 0%,transparent 70%);opacity:.26;pointer-events:none}
.iv-login-wm{position:absolute;width:80%;max-width:820px;left:-12%;bottom:-18%;opacity:.10;pointer-events:none}
.iv-login-brand{position:relative;z-index:2;text-align:center;padding:40px}
.iv-login-badge{width:120px;height:120px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;margin:0 auto 24px;box-shadow:0 12px 34px rgba(0,0,0,.18)}
.iv-login-word{font-size:38px;color:#fff;letter-spacing:-.6px}
.iv-login-word b{font-weight:700}
.iv-login-word span{font-weight:300;opacity:.92}
.iv-login-tagline{margin:18px auto 0;max-width:340px;font-size:15px;line-height:1.6;color:rgba(255,255,255,.82)}
.iv-login-credit{position:absolute;left:0;right:0;bottom:28px;text-align:center;font-size:12.5px;color:rgba(255,255,255,.6);z-index:2}
.iv-login-credit b{font-weight:600;color:rgba(255,255,255,.8)}
/* Overlay "Conectando…" con el isotipo de InVitro girando */
.iv-connecting{position:fixed;inset:0;z-index:9999;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px}
.iv-connecting[hidden]{display:none}
.iv-spin{width:54px;height:54px;line-height:0;animation:iv-rot 1s linear infinite;transform-origin:50% 50%}
.iv-connecting-txt{font-size:14px;color:#777777}
@keyframes iv-rot{to{transform:rotate(360deg)}}
@media(max-width:820px){.iv-login-right{display:none}.iv-login-left{flex:1}}
