/* ============================================================
   Workspace Selection Screen
   ============================================================ */
.workspace-select-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}
.workspace-select-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
    max-width: 560px;
    width: 100%;
    padding: 40px;
}
.workspace-select-header {
    text-align: center;
    margin-bottom: 32px;
}
.workspace-select-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    margin-bottom: 16px;
}
.workspace-select-header h1 {
    font-size: 22px;
    margin: 0 0 8px;
    color: #1a1a2e;
}
.workspace-select-header p {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}
.workspace-select-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.workspace-select-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
}
.workspace-select-card:hover {
    border-color: #3b82f6;
    background: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,.12);
}
.workspace-select-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.workspace-select-card-info {
    flex: 1;
    min-width: 0;
}
.workspace-select-card-name {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.workspace-select-card-type {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}
.workspace-select-card-desc {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
    line-height: 1.3;
}
.workspace-select-card.active {
    border-color: #3b82f6;
    background: #f0f7ff;
    box-shadow: 0 0 0 1px #3b82f6;
}
.ws-profile-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.ws-profile-badge-active {
    background: #dcfce7;
    color: #166534;
}
.ws-profile-badge-private {
    background: #f3e8ff;
    color: #7c3aed;
}
.ws-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: #e0e7ff;
    color: #4338ca;
}
.workspace-select-card-arrow {
    color: #9ca3af;
    font-size: 18px;
    flex-shrink: 0;
}

/* ============================================================
   Workspace Switcher (sidebar)
   ============================================================ */
.workspace-switcher {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    position: relative;
}
.workspace-switcher-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-card, #fff);
    cursor: pointer;
    transition: all .2s;
    font-size: 13px;
    color: var(--text-main, #1a1a2e);
}
.workspace-switcher-btn:hover {
    border-color: #3b82f6;
    background: #f0f7ff;
}
.workspace-switcher-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.workspace-switcher-arrow {
    font-size: 10px;
    color: #9ca3af;
    margin-left: 6px;
    flex-shrink: 0;
}
.workspace-switcher-dropdown {
    position: absolute;
    top: 100%;
    left: 8px;
    right: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 200;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
}
.workspace-switcher-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 13px;
    color: #1a1a2e;
}
.workspace-switcher-option:hover {
    background: #f0f7ff;
}
.workspace-switcher-option.active {
    background: #e0e7ff;
    font-weight: 600;
}
.workspace-switcher-option-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.workspace-switcher-option-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #4338ca;
}

/* Dossier detail items */
.dossier-detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light, var(--border));
}
.dossier-detail-item:last-child { border-bottom: none; }
.dossier-detail-icon { font-size: 1.3rem; flex-shrink: 0; }
.dossier-detail-info { flex: 1; min-width: 0; }
.dossier-detail-name {
    display: block;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dossier-detail-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.dossier-detail-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* PDF export layout options */
.pdf-layout-opt {
    padding: 12px 6px;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.pdf-layout-opt:hover { border-color: var(--primary); }
.pdf-layout-opt.active { border-color: var(--primary); background: var(--primary-light, #eff6ff); }
.pdf-layout-opt strong { font-size: 1.3rem; }
.pdf-layout-opt small { font-size: 0.7rem; color: var(--text-muted); }

/* PDF cart grid */
.pdf-cart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}
.pdf-cart-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.pdf-cart-thumb {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
}
.pdf-cart-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

/* Photo select checkbox overlay */
.photo-select-cb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(255,255,255,0.85);
    border: 2px solid var(--border);
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.12s, border-color 0.12s;
}
.photo-select-cb.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* PDF toolbar in package details modal header */
.pdf-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}
.pdf-modal-toolbar .modal-close {
    position: static;
    margin: 0;
}

/* Admin: Message configuration ("Mensajes" tab) */
.msgcfg-tags { margin-bottom: 14px; line-height: 2; }
.msgcfg-tag {
    display: inline-block;
    background: var(--bg-input, #f3f4f6);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 0.8rem;
    color: var(--text-secondary, #374151);
}
.msgcfg-tag-click { cursor: pointer; }
.msgcfg-tag-click:hover { background: var(--border, #e5e7eb); }
.msgcfg-card {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--bg-card, #fff);
}
.msgcfg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.msgcfg-title { font-weight: 600; color: var(--text-primary); }
.msgcfg-custom {
    font-size: 0.7rem;
    font-weight: 600;
    color: #2563eb;
    background: #dbeafe;
    padding: 1px 7px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}
.msgcfg-channel,
.msgcfg-subject,
.msgcfg-template {
    padding: 8px 11px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
}
.msgcfg-channel { flex-shrink: 0; }
.msgcfg-subject { width: 100%; margin-bottom: 8px; }
.msgcfg-template { width: 100%; resize: vertical; }
.msgcfg-tags-row { font-size: 0.8rem; margin-top: 6px; line-height: 1.9; }
.msgcfg-actions { margin-top: 10px; text-align: right; }

/* ── Widget global de subida de fotos ─────────────────────────
   Visible solo mientras hay fotos subiéndose: miniatura de la última
   subida y contador total (p. ej. 13/60). Esquina inferior derecha. */
#uploadWidget {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2100; /* por encima de modales, debajo de nada crítico */
    display: none;
    align-items: flex-start;
    gap: 10px;
    width: 320px;
    max-width: calc(100vw - 32px);
    padding: 12px;
    background: #1f2430;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    font-size: 13px;
    cursor: grab;
    user-select: none;
}
#uploadWidget.uw-dragging { cursor: grabbing; }
#uploadWidget .uw-close { cursor: pointer; }
#uploadWidget .uw-thumb {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}
#uploadWidget .uw-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
#uploadWidget .uw-body {
    flex: 1;
    min-width: 0;
}
#uploadWidget .uw-title {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
}
#uploadWidget .uw-counter {
    font-variant-numeric: tabular-nums;
    color: #9db8ff;
}
#uploadWidget.uw-done .uw-counter { color: #7fd99f; }
#uploadWidget .uw-name {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 15px;
}
#uploadWidget .uw-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    margin-top: 7px;
    overflow: hidden;
}
#uploadWidget .uw-bar-fill {
    height: 100%;
    width: 0;
    background: #4f8cff;
    transition: width 0.25s ease;
}
#uploadWidget.uw-done .uw-bar-fill { background: #3fbf6f; }
#uploadWidget .uw-errors {
    color: #ff9d9d;
    font-size: 12px;
    margin-top: 4px;
}
#uploadWidget .uw-aviso {
    color: #ffd27a;
    font-size: 12px;
    line-height: 1.35;
    margin-top: 6px;
}
#uploadWidget .uw-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}
#uploadWidget .uw-close:hover { color: #fff; }

