:root{
    --obr-header-foot-height: 50px;
}

.obr-master {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'akiroboto', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: #f6f7f9;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* header / footer */
.obr-header, .obr-footer {
    height: var(--obr-header-foot-height);
    line-height: var(--obr-header-foot-height);
    text-align: center;
    color: white;
    flex-shrink: 0;
    font-weight: 600;
}

/* contenido: scroll horizontal */
.obr-contenido {
    flex-grow: 1;
    display: flex;
    gap: 12px;
    padding: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: flex-start;
    box-sizing: border-box;
    border-bottom: thin solid red;
}

/* Item / columna */
.obr-item {
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    min-width: 280px;
    width: 300px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - (var(--obr-header-foot-height) * 2) - 60px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
    overflow: hidden;
}

/* header item */
.obr-item-header {
    color: black;
    background: #fafafa;
    padding: 10px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    font-weight:700;
    flex-shrink:0;
}

.obr-item-header span {
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

/* menu button */
.obr-btn-menu {
    background: transparent;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height:1;
}

/* body / tarjetas list */
.obr-item-body {
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    background: #fafafa;

    /* 🟢 Evita que las tarjetas se deformen al hacer scroll */
    align-items: stretch;
    flex-grow: 1;
    flex-shrink: 1;
    min-height: 0; /* importante para permitir scroll interno */
}

/* tarjeta */
.obr-tarjeta {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    min-height: 60px;
    cursor: grab;

    /* 🟢 Evita que el flexbox las deforme */
    flex: 0 0 auto;
}

.obr-tarjeta:active { cursor: grabbing; }

.obr-tarjeta-header {
    display:flex;
    align-items:center;
    gap:8px;
    padding-left:20px;
    font-weight:700;
    font-size:14px;
}

.obr-tarjeta-checkbox {
    position:absolute;
    left:8px;
    top:8px;
    /*opacity:0;
    transition:opacity .2s;*/
}

.obr-tarjeta:hover .obr-tarjeta-checkbox,
.obr-tarjeta-checkbox:checked { opacity:1; }

.obr-tarjeta-cuerpo p{
    margin:0;
    font-size:12px;
    line-height:1.2;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
}

/* footer item */
.obr-item-footer {
    padding: 10px;
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:center;
    background: #fafafa;
    flex-shrink:0;
}

/* botones footer */
.obr-btn-agregar, .obr-btn-templetes {
    border: none;
    padding:8px 10px;
    border-radius:6px;
    cursor:pointer;
    font-weight:700;
    font-size:13px;
}

.obr-btn-agregar {
    background:#28a745;
    color:white;
}

.obr-btn-templetes {
    background:transparent;
    color:#1976d2;
}

/* progreso */
.obr-barra-progreso {
    background:#eee;
    border-radius:6px;
    height:8px;
    overflow:hidden;
    width:100%;
}

.obr-barra-interna {
    height:100%;
    background:linear-gradient(90deg,#4caf50,#66bb6a);
    width:0%;
    transition: width .3s ease;
}

/* template item (modal list style used previously) */
.obr-template-item {
    background:#f5f5f5;
    border-radius:6px;
    padding:8px;
    margin-bottom:8px;
    font-weight:700;
    cursor:pointer;
}

/* menu popup */
.obr-menu-popup {
    position: absolute;
    min-width: 160px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.06);
    z-index: 2000;
    overflow: hidden;
}

.obr-menu-popup ul {
    list-style:none;
    margin:0;
    padding:8px 0;
}

.obr-menu-popup li {
    padding:8px 12px;
    cursor:pointer;
    font-weight:600;
    white-space:nowrap;
}

.obr-menu-popup li:hover { background: #f2f7ff; }

/* modal overlay (cuando uso modal) */
.obr-modal-overlay {
    position: fixed;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background: rgba(0,0,0,0.45);
    z-index:3000;
}

.obr-modal {
    background:white;
    border-radius:8px;
    width: 92%;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow:hidden;
}

.obr-modal-header {
    background: linear-gradient(90deg,#1976d2,#42a5f5);
    color:white;
    padding:12px;
    font-weight:700;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.obr-modal-body {
    padding:16px;
}

/* responsive adjustments */
@media (max-width:640px){
    .obr-item { min-width: 240px; width: 260px; }
    .obr-contenido { gap: 8px; padding:8px; }
    .obr-modal { width: 95%; max-width: 420px; }
}
