:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #24344d;
    --border: #334155;
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --danger: #f87171;
    --success: #4ade80;
    --warning: #fbbf24;
    --info: #38bdf8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ Auth Redesign ============ */
.v-auth-page {
    margin: 0;
    padding: 0;
    background-color: #040711;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.v-auth-container {
    display: flex;
    flex: 1;
    min-height: 100vh;
    width: 100%;
}

/* Left Column: White Card */
.v-auth-left {
    width: 440px;
    min-width: 380px;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #040711;
    z-index: 5;
    box-sizing: border-box;
}

.v-login-card {
    background: #ffffff;
    color: #0f172a;
    border-radius: 24px;
    padding: 2rem 2rem 1.75rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.v-brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.v-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.v-brand-name {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.5px;
    color: #0f172a;
    display: block;
    line-height: 1.1;
}

.v-brand-sub {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: 1.2px;
}

.v-card-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.25rem;
    letter-spacing: -0.5px;
}

.v-card-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

/* Quick Access Pills */
.v-quick-access {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 0.55rem 0.75rem;
}

.v-quick-title {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.v-quick-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.v-pill-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    font-size: 0.7rem;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.v-pill-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.v-pill-role {
    font-size: 0.58rem;
    padding: 0.08rem 0.25rem;
    border-radius: 4px;
    font-weight: 800;
}
.v-pill-role.owner { background: #dbeafe; color: #1e40af; }
.v-pill-role.mkt { background: #fce7f3; color: #9d174d; }
.v-pill-role.sup { background: #fef3c7; color: #92400e; }
.v-pill-role.des { background: #e0e7ff; color: #3730a3; }
.v-pill-role.cli { background: #dcfce7; color: #166534; }

.v-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.v-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.v-field-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
}

.v-input-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.v-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.v-auth-page .v-input-box input[type="email"],
.v-auth-page .v-input-box input[type="password"],
.v-auth-page .v-input-box input {
    width: 100% !important;
    height: 44px !important;
    padding: 0.6rem 2.6rem 0.6rem 2.5rem !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    color: #0f172a !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    font-family: inherit !important;
    box-shadow: none !important;
}

.v-auth-page .v-input-box input::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

.v-auth-page .v-input-box input[type="email"]:focus,
.v-auth-page .v-input-box input[type="password"]:focus,
.v-auth-page .v-input-box input:focus {
    border-color: #2563eb !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
}

.v-input-highlight {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25) !important;
}

.v-pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    z-index: 2;
}

.v-pw-toggle:hover {
    color: #475569;
}

.v-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    gap: 0.5rem;
}

.v-checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #475569;
    cursor: pointer;
}

.v-checkbox-container input {
    width: 15px;
    height: 15px;
    accent-color: #2563eb;
    cursor: pointer;
}

.v-forgot-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.v-forgot-link:hover {
    text-decoration: underline;
}

.v-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.v-submit-btn:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.v-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
}

/* Client Box */
.v-client-card {
    background: #f0f6ff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.v-client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.v-client-body {
    flex: 1;
}

.v-client-heading {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 0.15rem;
}

.v-client-sub {
    font-size: 0.75rem;
    color: #475569;
    margin: 0 0 0.6rem;
    line-height: 1.35;
}

.v-client-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.45rem 0.8rem;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.v-client-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* Right Column: Dark Cosmic Diagram */
.v-auth-right {
    flex: 1;
    background: radial-gradient(circle at 65% 45%, #0d1b3e 0%, #040711 75%);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2.2rem 3rem 1.5rem;
    overflow: hidden;
    justify-content: space-between;
}

.v-top-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    z-index: 10;
}

.v-proposal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 0 20px rgba(37,99,235,0.4);
    transition: all 0.2s ease;
}

.v-proposal-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(37,99,235,0.6);
    text-decoration: none;
}

.v-right-hero {
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.v-hero-title {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0 0 0.4rem;
}

.v-gradient-text {
    background: linear-gradient(90deg, #38bdf8 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.v-hero-description {
    font-size: 0.95rem;
    color: #94a3b8;
    max-width: 540px;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.v-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.v-feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(51, 65, 85, 0.8);
    backdrop-filter: blur(8px);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
}

/* Diagram Stage */
.v-diagram-stage {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v-orbit-container {
    position: relative;
    width: 100%;
    height: 440px;
}

.v-network-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.v-center-emblem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v-emblem-ring {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.8), inset 0 0 15px rgba(59, 130, 246, 0.5);
    animation: pulseGlow 3s infinite alternate;
}

.v-emblem-core {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #060914;
    border: 1.5px solid #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
}

@keyframes pulseGlow {
    0% { transform: scale(0.97); box-shadow: 0 0 18px rgba(59,130,246,0.6); }
    100% { transform: scale(1.04); box-shadow: 0 0 35px rgba(59,130,246,1); }
}

.v-node-social {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 9999px;
    padding: 0.35rem 0.8rem;
    display: flex;
    gap: 0.6rem;
    z-index: 4;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
}

.v-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.v-social-icon:hover {
    transform: scale(1.25);
}

.v-card-node {
    position: absolute;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.9);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    width: 145px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 4;
    transition: all 0.3s ease;
}

.v-card-node:hover {
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.25);
}

.node-leads { top: 35px; left: 20px; }
.node-marketing { top: 35px; right: 20px; }
.node-crm { top: 185px; right: 10px; border-color: rgba(34, 197, 94, 0.4); }
.node-ventas { bottom: 35px; right: 20px; border-color: rgba(245, 158, 11, 0.4); }
.node-reportes { bottom: 10px; left: 240px; }
.node-automation { bottom: 35px; left: 20px; border-color: rgba(168, 85, 247, 0.4); }

.v-node-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.v-node-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #60a5fa;
}

.v-node-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.68rem;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.v-node-list li {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.v-node-list li::before {
    content: "•";
    color: #3b82f6;
    font-size: 0.8rem;
}

.v-bottom-quote {
    text-align: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 0.55rem 1.25rem;
    backdrop-filter: blur(8px);
    max-width: 580px;
    margin: 0.5rem auto 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Footer Bar */
.v-auth-footer {
    height: 46px;
    background: #02040a;
    border-top: 1px solid rgba(30, 41, 59, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    z-index: 10;
}

.v-footer-center a {
    color: #64748b;
    text-decoration: none;
}

.v-footer-center a:hover {
    color: #94a3b8;
    text-decoration: underline;
}

.v-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #94a3b8;
}

.v-status-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

@media (max-width: 1080px) {
    .v-auth-container { flex-direction: column; }
    .v-auth-left { width: 100%; max-width: 500px; margin: 0 auto; padding: 2rem 1.5rem; }
    .v-auth-right { padding: 2rem 1.5rem; }
}


/* ============ App shell ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand { padding: 1.2rem 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-brand a { font-weight: 800; letter-spacing: 1px; color: var(--accent); }
.sidebar-nav { flex: 1; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; overflow-y: auto; }
.sidebar-section { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 0.6rem 0.85rem 0.2rem; }
.sidebar-nav a {
    color: var(--muted);
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.sidebar-user { color: var(--text); font-weight: 600; margin-bottom: 0.35rem; }

.app-main { flex: 1; padding: 1.5rem 2rem; max-width: 1200px; }
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.app-header h1 { margin: 0; font-size: 1.5rem; }
.header-actions { display: flex; gap: 0.5rem; }

/* ============ Cards & KPIs ============ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.card-title { margin: 0 0 1rem; font-size: 1.05rem; color: var(--accent); }
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.kpi-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 1.35rem; font-weight: 700; color: var(--text); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============ Tables ============ */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--border); }
.table thead th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .5px; }
.table tbody tr:hover { background: var(--surface-2); }
.row-actions { display: flex; gap: 0.6rem; align-items: center; justify-content: flex-end; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 0.75rem 0; gap: 0.75rem; }

/* ============ Badges ============ */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--border);
}
.badge-active, .badge-published_to_client { background: rgba(74,222,128,.12); color: var(--success); border-color: var(--success); }
.badge-paused, .badge-in_review { background: rgba(251,191,36,.12); color: var(--warning); border-color: var(--warning); }
.badge-completed, .badge-approved { background: rgba(56,189,248,.12); color: var(--info); border-color: var(--info); }
.badge-archived, .badge-draft { background: rgba(148,163,184,.15); color: var(--muted); border-color: var(--border); }
.badge-planned, .badge-changes_requested { background: rgba(56,189,248,.12); color: var(--info); border-color: var(--info); }
.badge-client { background: rgba(74,222,128,.12); color: var(--success); }
.badge-internal { background: rgba(148,163,184,.15); color: var(--muted); }

/* ============ Forms ============ */
.form-stack { display: flex; flex-direction: column; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field > span { font-size: 0.82rem; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], select, textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 0.5rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.92rem;
    width: 100%;
}
textarea { resize: vertical; }
.checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.checkbox input { width: auto; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }

/* ============ Buttons ============ */
.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    background: #0369a1;
    color: #e0f2fe;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn:hover { background: #075985; text-decoration: none; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.82rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #b91c1c; color: #fee2e2; }
.btn-danger:hover { background: #991b1b; }
.btn-success { background: #15803d; color: #dcfce7; }
.btn-success:hover { background: #166534; }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 0.9rem; text-decoration: underline; }
.btn-link-danger { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font-size: 0.9rem; text-decoration: underline; }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; }

/* ============ Alerts ============ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid;
    font-size: 0.92rem;
}
.alert-success { background: rgba(74,222,128,.1); border-color: var(--success); color: var(--success); }
.alert-error { background: rgba(248,113,113,.1); border-color: var(--danger); color: var(--danger); }
.alert-warning { background: rgba(251,191,36,.1); border-color: var(--warning); color: var(--warning); }
.alert-info { background: rgba(56,189,248,.1); border-color: var(--info); color: var(--info); }

/* ============ Tabs / filters / actions ============ */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tab {
    padding: 0.55rem 1rem;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filter-bar .input { width: auto; min-width: 130px; }
.action-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem 1rem; }
.detail-grid > div { display: flex; flex-direction: column; gap: 0.15rem; }

/* ============ Misc ============ */
.list { list-style: none; padding: 0; margin: 0 0 1rem; }
.list li { padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.progress { background: var(--bg); border-radius: 9999px; height: 12px; overflow: hidden; margin: 0.5rem 0; }
.progress-bar { background: var(--accent); height: 100%; border-radius: 9999px; }
.progress-over { background: var(--danger); }
.progress-warn { background: var(--warning); }
.chart { width: 100%; height: auto; background: var(--bg); border-radius: 0.5rem; }
.chart-label { fill: var(--muted); font-size: 11px; }

/* ============ Footer (public layout legacy) ============ */
.navbar { display: flex; align-items: center; padding: 1rem 2rem; border-bottom: 1px solid var(--border); }
.brand { color: var(--accent); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.container { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 2rem; }
.footer { text-align: center; padding: 1rem; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--border); }
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h1 { font-size: 4rem; color: var(--accent); margin: 0; }
.error-page p { color: var(--muted); margin-bottom: 1.5rem; }

/* ============ V2 · Landing pública ============ */
.public-body { background: var(--bg); min-height: 100vh; }
.public-nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.public-nav-inner { max-width: 1100px; margin: 0 auto; padding: 0.9rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.hero.landing-hero { text-align: center; padding: 3.5rem 1rem 2rem; }
.hero.landing-hero h1 { font-size: 2rem; color: var(--accent); margin: 0 0 0.5rem; }
.hero.landing-hero p { color: var(--muted); margin: 0; }
.section-title { color: var(--accent); margin: 2rem 0 1rem; font-size: 1.3rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.9rem; padding: 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; }
.plan-card h3 { margin: 0; }
.plan-price { font-size: 1.5rem; font-weight: 700; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem; }
.service-card { background: var(--bg); border: 1px solid var(--border); border-radius: 0.6rem; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; cursor: pointer; }
.service-card:hover { border-color: var(--accent); }
.service-name { font-weight: 600; }
.narrow { max-width: 640px; }
.badge-warn { background: rgba(251,191,36,.12); color: var(--warning); border-color: var(--warning); }
.badge-score { background: rgba(56,189,248,.12); color: var(--info); border-color: var(--info); }

/* ============ V2 · Wizard del formulario ============ */
.form-wizard { max-width: 860px; }
.wizard-head { text-align: center; margin-bottom: 1rem; }
.wizard-steps { list-style: none; display: flex; gap: 0.4rem; flex-wrap: wrap; padding: 0; margin: 0 0 1.25rem; justify-content: center; }
.wizard-step-label { padding: 0.35rem 0.8rem; border: 1px solid var(--border); border-radius: 9999px; color: var(--muted); font-size: 0.8rem; cursor: default; }
.wizard-step-label.active { background: var(--accent); color: #082f49; border-color: var(--accent); font-weight: 600; }
.wizard-step { margin-bottom: 1.5rem; }
.wizard-nav { display: flex; gap: 0.75rem; align-items: center; justify-content: flex-end; }
.field-missing { outline: 2px solid var(--danger); border-radius: 0.4rem; padding: 0.35rem; }
.field-error { color: var(--danger); font-size: 0.8rem; }
.input-sm { width: auto; min-width: 120px; padding: 0.35rem 0.6rem; }
.success-center { text-align: center; }
.code-badge { color: var(--accent); font-size: 1.2rem; }
.snapshot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.5rem 1rem; }
.snapshot-grid > div { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.85rem; }
.brief-block { border: 1px solid var(--border); border-radius: 0.6rem; padding: 1rem; margin-bottom: 0.9rem; background: var(--bg); }
.brief-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.price-big { font-size: 2rem; font-weight: 700; color: var(--success); margin: 0; }
.table-total { background: var(--surface-2); }
.check-inline { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ============ NÚCLEO ============ */
.sidebar-section { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 0.6rem 0.85rem 0.15rem; }
.work-item { padding: 1rem; }
.work-item-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.work-item-title { margin: 0.25rem 0; font-size: 1.05rem; }
.badge-kind { background: rgba(56,189,248,.12); color: var(--info); border-color: var(--info); }
.badge-priority-urgente, .badge-priority-critica { background: rgba(248,113,113,.15); color: var(--danger); border-color: var(--danger); }
.badge-priority-alta { background: rgba(251,191,36,.12); color: var(--warning); border-color: var(--warning); }
.badge-priority-normal { background: rgba(148,163,184,.15); color: var(--muted); }
.badge-priority-baja { background: rgba(148,163,184,.15); color: var(--muted); }
.badge-new, .badge-pending, .badge-open { background: rgba(56,189,248,.12); color: var(--info); border-color: var(--info); }
.badge-working, .badge-in_progress { background: rgba(251,191,36,.12); color: var(--warning); border-color: var(--warning); }
.badge-in_review, .badge-in_review { background: rgba(251,191,36,.12); color: var(--warning); border-color: var(--warning); }
.badge-done, .badge-approved, .badge-won, .badge-paid, .badge-confirmed { background: rgba(74,222,128,.12); color: var(--success); border-color: var(--success); }
.badge-cancelled, .badge-lost, .badge-changes_requested { background: rgba(148,163,184,.15); color: var(--muted); }
.notification-unread { border-left: 3px solid var(--accent); }
.notification-critical { border-left: 3px solid var(--danger); }
.notification-message { margin: 0.35rem 0; }
.text-danger { color: var(--danger) !important; }
.new-task { position: relative; display: inline-block; }
.new-task summary { list-style: none; cursor: pointer; }
.new-task form { position: absolute; right: 0; top: 2.2rem; width: 460px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.comment { border-left: 2px solid var(--border); padding: 0.4rem 0.75rem; margin-bottom: 0.6rem; }
.funnel { display: flex; flex-direction: column; gap: 0.6rem; }
.funnel-row { display: flex; align-items: center; gap: 0.75rem; }
.funnel-label { min-width: 110px; font-size: 0.85rem; }
.funnel-row .progress { flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell { background: var(--bg); border: 1px solid var(--border); min-height: 84px; padding: 0.35rem; border-radius: 4px; }
.cal-empty { border-color: transparent; background: transparent; }
.cal-head-cell { text-align: center; font-size: 0.75rem; color: var(--muted); min-height: 0; }
.cal-day-num { font-weight: 600; font-size: 0.8rem; margin-bottom: 0.25rem; }
.cal-event { font-size: 0.72rem; padding: 0.15rem 0.35rem; margin-bottom: 0.2rem; border-radius: 3px; background: var(--surface-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ COMERCIAL ============ */
.crm-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.75rem; align-items: start; overflow-x: auto; }
.crm-column { background: var(--surface); border: 1px solid var(--border); border-radius: 0.6rem; padding: 0.75rem; min-height: 300px; }
.crm-column-title { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.crm-card { background: var(--bg); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.7rem; margin-bottom: 0.6rem; }
.crm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.3rem; }
.crm-card-head strong { font-size: 0.9rem; }
.crm-move { margin-top: 0.5rem; }
