/* ── Módulo Disponibles — estilos compartidos ── */

/* Overlay base */
.disp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow-y: auto;
}

/* Panel principal */
.disp-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    width: 100%;
    max-width: 920px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header del panel */
.disp-header {
    background: linear-gradient(135deg, #1B3B6F 0%, #0d2247 100%);
    color: #fff;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.disp-header h2 {
    font-size: 1.1em;
    font-weight: 700;
    margin: 0;
    flex: 1;
}
.disp-header .disp-badge {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    font-size: .72em;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.disp-header .disp-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 1.1em;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.disp-header .disp-close:hover { background: rgba(255,255,255,.3); }

/* Zona scrollable */
.disp-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Tabla de ítems */
.disp-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}
.disp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84em;
}
.disp-table th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 700;
    text-align: left;
    padding: 9px 10px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}
.disp-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.disp-table tr:last-child td { border-bottom: none; }
.disp-table tr:hover td { background: #f9fafb; }

/* Columna de selección del usuario — color distintivo */
.disp-table th.col-sel,
.disp-table td.col-sel {
    background: #fffbeb;
    border-left: 2px solid #f59e0b;
    text-align: center;
}
.disp-table th.col-sel { background: #fef3c7; }

/* Inputs inline de la tabla (para el editor del titular) */
.disp-table input[type="text"],
.disp-table input[type="number"],
.disp-table input[type="date"],
.disp-table input[type="time"] {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1em;
    background: #fff;
    box-sizing: border-box;
}
.disp-table input:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 2px rgba(102,126,234,.2); }
.disp-table input.error { border-color: #ef4444; }

.disp-table select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1em;
    background: #fff;
    box-sizing: border-box;
}

/* Checkbox selección usuario */
.disp-checkbox-sel {
    width: 20px; height: 20px;
    accent-color: #f59e0b;
    cursor: pointer;
}

/* Leyenda sí/no */
.disp-legend {
    font-size: .78em;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.disp-legend span { display: flex; align-items: center; gap: 5px; }
.disp-dot-si  { width: 10px; height: 10px; border-radius: 50%; background: #10b981; display: inline-block; }
.disp-dot-no  { width: 10px; height: 10px; border-radius: 50%; background: #d1d5db; display: inline-block; }
.disp-dot-sel { width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; display: inline-block; }

/* Footer del panel */
.disp-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 14px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Botones del footer */
.disp-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9em;
    font-weight: 700;
    transition: filter .2s, transform .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.disp-btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.disp-btn:active { transform: translateY(0); }
.disp-btn-primary   { background: #1B3B6F; color: #fff; }
.disp-btn-success   { background: #10b981; color: #fff; }
.disp-btn-danger    { background: #ef4444; color: #fff; }
.disp-btn-secondary { background: #e5e7eb; color: #374151; }
.disp-btn-amber     { background: #f59e0b; color: #fff; }

/* Campo email del solicitante */
.disp-email-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.disp-email-row label {
    font-size: .85em;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
}
.disp-email-row input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .9em;
}
.disp-email-row input:focus { outline: none; border-color: #1B3B6F; box-shadow: 0 0 0 2px rgba(27,59,111,.15); }

/* Mensajes de estado */
.disp-msg {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: .85em;
    font-weight: 600;
    margin-bottom: 14px;
    display: none;
}
.disp-msg.ok  { background: #d1fae5; color: #065f46; display: block; }
.disp-msg.err { background: #fee2e2; color: #991b1b; display: block; }

/* Add row button (editor titular) */
.disp-add-row {
    width: 100%;
    padding: 9px;
    border: 1.5px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    font-size: .85em;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.disp-add-row:hover { border-color: #1B3B6F; color: #1B3B6F; background: #f0f4ff; }

/* Contador de órdenes (my_businesses) */
.disp-orders-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .72em;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 640px) {
    .disp-panel { border-radius: 12px; }
    .disp-body  { padding: 14px 16px; }
    .disp-footer { padding: 12px 16px; }
    .disp-header { padding: 14px 16px; }
}
