/* =============================================
   G-CAPITAL — Dashboard Privado Styles
   ============================================= */

/* ── Body ── */
.db-body {
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* ══════════════════════════════════════════════
   GATE DE ACEPTACIÓN
   ══════════════════════════════════════════════ */
.gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 11, 13, 0.97);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    max-width: 560px;
    width: 100%;
    animation: stepIn 0.4s cubic-bezier(.16, 1, .3, 1);
}

.gate-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 20px;
}

.gate-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.gate-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.gate-text p {
    margin-bottom: 10px;
}

.gate-text p:last-child {
    margin-bottom: 0;
}

.gate-check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    cursor: pointer;
}

.gate-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ══════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════════ */
.db-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.db-priv-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 0.66rem;
    font-weight: 700;
    color: #f59e0b;
}

.db-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-glow-sm);
    border: 1.5px solid rgba(34, 197, 94, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
}

.db-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ── Sidebar ── */
.db-sidebar {
    width: 210px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    flex-shrink: 0;
}

.db-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.db-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
    transition: var(--transition);
}

.db-nav-item:hover {
    background: var(--bg-card-inner);
    color: var(--text-primary);
}

.db-nav-item.active {
    background: var(--accent-glow-sm);
    color: var(--accent);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.db-nav-sep {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* ── Main ── */
.db-main {
    flex: 1;
    padding: 32px;
    overflow-x: hidden;
}

.db-view {
    animation: stepIn 0.3s cubic-bezier(.16, 1, .3, 1);
}

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

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

.db-view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.db-view-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.db-view-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* NDA banner */
.db-nda-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.db-nda-banner svg {
    flex-shrink: 0;
    color: var(--accent);
}

.db-legal-footer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.db-legal-footer svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   PROJECT CARDS
   ══════════════════════════════════════════════ */
.db-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.db-proy-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: var(--transition);
}

.db-proy-card:hover {
    border-color: rgba(34, 197, 94, 0.2);
    transform: translateY(-2px);
}

.db-proy-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.db-proy-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    flex-shrink: 0;
    background: var(--accent-glow-sm);
    border: 1px solid rgba(34, 197, 94, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--accent);
}

.db-proy-info {
    flex: 1;
    min-width: 0;
}

.db-proy-name {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-proy-sector {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.db-proy-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.db-proy-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.db-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-meta-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.db-meta-val {
    font-size: 0.8rem;
    font-weight: 700;
}

.db-meta-val.green {
    color: var(--accent);
}

/* Status pills */
.db-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.64rem;
    font-weight: 700;
}

.db-status::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.db-status.estructuracion {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent);
}

.db-status.validacion {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.db-status.expansion {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
}

.db-status.cerrada {
    background: var(--bg-card-inner);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.db-status.cerrada::before {
    display: none;
}

/* Action buttons */
.btn-reunion-sm,
.btn-docs-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
    border: none;
}

.btn-reunion-sm {
    background: var(--accent-glow-sm);
    color: var(--accent);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.btn-reunion-sm:hover {
    background: var(--accent);
    color: #000;
}

.btn-docs-sm {
    background: var(--bg-card-inner);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-docs-sm:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ══════════════════════════════════════════════
   DOCUMENT MODULE
   ══════════════════════════════════════════════ */
.docs-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    transition: var(--transition);
}

.doc-card.doc-available {
    border-color: rgba(34, 197, 94, 0.1);
}

.doc-card.doc-available:hover {
    border-color: rgba(34, 197, 94, 0.25);
}

.doc-card.doc-locked {
    opacity: 0.7;
}

.doc-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-name {
    font-size: 0.875rem;
    font-weight: 700;
}

.doc-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.doc-status {
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 100px;
}

.doc-status.available {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent);
}

.doc-status.locked {
    background: var(--bg-card-inner);
    color: var(--text-muted);
}

.btn-doc-action {
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
    white-space: nowrap;
}

.btn-doc-action:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-doc-action.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ══════════════════════════════════════════════
   CONTRACT MODULE
   ══════════════════════════════════════════════ */
.contrato-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.contrato-form-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    position: sticky;
    top: 80px;
}

.contrato-form-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent);
}

/* Form fields */
.cf-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.cf-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.cf-input {
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 0.86rem;
    color: var(--text-primary);
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.cf-input:focus {
    border-color: var(--accent);
}

.cf-input::placeholder {
    color: var(--text-muted);
}

.cf-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.cf-sign-section {}

.cf-sign-title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cf-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
}

.cf-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
}

.cf-check label {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.6;
    cursor: pointer;
}

/* Trace record */
.cf-trace {
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.cf-trace-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.cf-trace-row:last-child {
    border-bottom: none;
}

.cf-trace-row span:first-child {
    color: var(--text-secondary);
}

.cf-trace-row span:last-child {
    font-weight: 700;
}

.cf-signed-state {
    background: var(--accent-glow-sm);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 20px;
}

/* ── CONTRACT DOCUMENT PREVIEW ── */
.contrato-preview-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.contrato-preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card-inner);
}

.contrato-doc {
    padding: 28px;
    font-size: 0.78rem;
    line-height: 1.75;
    color: var(--text-secondary);
    max-height: 780px;
    overflow-y: auto;
}

.cdoc-header {
    text-align: center;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 18px;
}

.cdoc-logo-line {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cdoc-subtitle {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cdoc-section {
    margin-bottom: 18px;
}

.cdoc-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-bottom: 8px;
}

.cdoc-section p {
    margin-bottom: 7px;
}

.cdoc-section p:last-child {
    margin-bottom: 0;
}

.cdoc-dynamic {
    color: var(--text-primary);
    font-weight: 700;
}

.cdoc-legal-note {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.cdoc-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.cdoc-sig {
    text-align: center;
}

.cdoc-sig-line {
    height: 1px;
    background: var(--border);
    margin-bottom: 8px;
}

.cdoc-sig-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cdoc-sig-role {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.cdoc-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
}

/* ══════════════════════════════════════════════
   POST-FIRMA PANEL
   ══════════════════════════════════════════════ */
.pf-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.pf-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}

.pf-card-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.pf-phase-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    gap: 0;
}

.pf-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pf-phase-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.pf-phase.active .pf-phase-dot {
    border-color: var(--accent);
    background: var(--accent-glow-sm);
    color: var(--accent);
}

.pf-phase-name {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 70px;
}

.pf-phase.active .pf-phase-name {
    color: var(--accent);
}

.pf-phase-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    min-width: 20px;
    align-self: flex-start;
    margin-top: 16px;
}

.pf-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.84rem;
}

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

.pf-row .k {
    color: var(--text-secondary);
}

.pf-row .v {
    font-weight: 700;
}

.pf-row .v.green {
    color: var(--accent);
}

/* Actas list */
.actas-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acta-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    transition: var(--transition);
}

.acta-item:hover {
    border-color: rgba(34, 197, 94, 0.2);
}

.acta-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.acta-info {
    flex: 1;
}

.acta-nombre {
    font-size: 0.84rem;
    font-weight: 700;
}

.acta-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ══════════════════════════════════════════════
   MODAL: SOLICITUD DE REUNIÓN
   ══════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    animation: stepIn 0.3s cubic-bezier(.16, 1, .3, 1);
}

.modal-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 10px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.modal-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.sol-brief {
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 4px;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media(max-width:1200px) {
    .db-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:960px) {
    .contrato-layout {
        grid-template-columns: 1fr;
    }

    .contrato-form-panel {
        position: static;
    }
}

@media(max-width:900px) {
    .db-sidebar {
        display: none;
    }

    .db-projects-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width:640px) {
    .db-main {
        padding: 16px;
    }

    .gate-card {
        padding: 24px;
    }
}