/* ═══════════════════════════════════════════════════════════════
   CUENTA DE COKI STUDIOS (CS ACCOUNT DESIGN SYSTEM)
   Coherencia Visual Unificada con Coki Studios OS (Dark & Light)
   ═══════════════════════════════════════════════════════════════ */

:root, html.dark-theme, body.dark-mode {
    --bg-page: #06090f;
    --bg-card: rgba(13, 17, 23, 0.85);
    --bg-card-sub: rgba(255, 255, 255, 0.04);
    --bg-hover: rgba(255, 255, 255, 0.07);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.06);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    --accent-blue: #6366f1;
    --accent-blue-hover: #4f46e5;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 14px 40px rgba(0, 0, 0, 0.5);
}

/* Modo Claro Unificado Coki Studios */
html.light-theme {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-sub: #f1f5f9;
    --bg-hover: #e2e8f0;
    --border-color: rgba(15, 23, 42, 0.08);
    --border-subtle: rgba(15, 23, 42, 0.06);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    
    --accent-blue: #4f46e5;
    --accent-blue-hover: #4338ca;
    --accent-green: #059669;
    --accent-orange: #d97706;
    --accent-red: #dc2626;
    --accent-purple: #7c3aed;
    
    --shadow-card: 0 4px 16px rgba(15, 23, 42, 0.04);
    --shadow-elevated: 0 12px 32px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    line-height: 1.5;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

html.light-theme body::before {
    background-image:
        linear-gradient(rgba(79, 70, 229, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.025) 1px, transparent 1px);
}

/* ── HEADER SUPERIOR COHERENTE CON COKI STUDIOS ── */
.cs-header {
    background: rgba(6, 9, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}
html.light-theme .cs-header {
    background: rgba(255, 255, 255, 0.88);
}

.cs-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cs-logo-title {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.cs-logo-title span {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cs-header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 820px) {
    .cs-header-nav {
        display: none;
    }
}

/* ── LAYOUT PRINCIPAL (SIDEBAR + CONTENIDO) ── */
.cs-app-layout {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 65px);
}

@media (max-width: 900px) {
    .cs-app-layout {
        grid-template-columns: 1fr;
    }
}

/* ── SIDEBAR LATERAL ── */
.cs-sidebar {
    padding: 32px 20px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-card);
}
@media (max-width: 900px) {
    .cs-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
    }
}

.cs-profile-snippet {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.cs-avatar-wrap {
    position: relative;
    margin-bottom: 14px;
}

.cs-avatar-large {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
    border: 3px solid var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #4f46e5, #0284c7);
}

.cs-avatar-edit-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 2px solid var(--bg-card);
    cursor: pointer;
}

.cs-profile-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cs-profile-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
    word-break: break-all;
}

.cs-plan-pill {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-blue);
}

/* Navegación Vertical */
.cs-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cs-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.cs-nav-item:hover {
    background: var(--bg-hover);
}

.cs-nav-item.active {
    background: var(--accent-blue);
    color: #ffffff;
    font-weight: 600;
}

.cs-nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ── CONTENIDO PRINCIPAL (DERECHA) ── */
.cs-main-content {
    padding: 36px 40px;
    max-width: 960px;
}
@media (max-width: 900px) {
    .cs-main-content {
        padding: 24px 20px;
    }
}

.cs-section-header {
    margin-bottom: 28px;
}

.cs-section-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.cs-section-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.5;
}

/* ── TARJETAS Y GRID ESTILO APPLE ── */
.cs-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.cs-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.cs-card:hover {
    box-shadow: var(--shadow-elevated);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.cs-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.cs-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.cs-card-icon {
    font-size: 18px;
    color: var(--accent-blue);
}

.cs-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.cs-card-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 12px;
}

/* ── BARRA DE BÚSQUEDA TIPO GOOGLE ACCOUNT ── */
.cs-search-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cs-search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: var(--text-primary);
    font-family: inherit;
}

.cs-quick-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 28px;
    scrollbar-width: none;
}

.cs-quick-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.cs-quick-pill:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
}

/* ── BOTONES USER-FRIENDLY ── */
.cs-btn-apple {
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 980px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.cs-btn-apple:hover {
    background: var(--accent-blue-hover);
}

.cs-btn-subtle {
    background: var(--bg-card-sub);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 980px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.cs-btn-subtle:hover {
    background: var(--bg-hover);
}

/* ── LISTAS Y FILAS DE AJUSTES ── */
.cs-list-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.cs-list-row {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s ease;
}

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

.cs-list-row:hover {
    background: var(--bg-card-sub);
}

.cs-list-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.cs-list-sublabel {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}
