:root {
    --bg-dark: #0f1115;
    --glass-bg: rgba(25, 28, 36, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #0284c7; /* Ferlact Blue */
    --accent-hover: #0369a1;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --card-bg: rgba(30, 34, 45, 0.7);
    --success: #10b981;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs for dynamic feel */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #0284c7;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: #3b82f6;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Layout */
.layout {
    display: flex;
    height: 100vh;
    padding: 1rem;
    gap: 1rem;
}

.sidebar {
    width: 320px; /* Ensanchado para evitar saltos de línea */
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrado */
    gap: 1rem;
    background: transparent; /* Quitamos el fondo blanco feo */
    padding: 0;
}

.logo img {
    max-width: 90%;
    height: auto;
    border-radius: 12px; /* Suaviza el fondo sólido de la imagen */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* Sombra de profundidad */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.studio-badge {
    background: var(--accent);
    color: #fff;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
    transform: translateY(-15px); /* Superpuesto sutilmente al logo */
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem;
    border-radius: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    white-space: nowrap; /* Evita que el texto se rompa en dos líneas */
}

.menu-item:hover, .menu-item.active {
    background: rgba(2, 132, 199, 0.15);
    color: #fff;
    border-color: rgba(2, 132, 199, 0.3);
    box-shadow: inset 0 0 20px rgba(2, 132, 199, 0.05);
}

.menu-item svg {
    color: var(--accent);
}

/* Main Content */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.content::-webkit-scrollbar {
    width: 8px;
}
.content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
}

.header-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

/* Control Center */
.control-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-input-group {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-width: 300px;
}

.trend-input {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.trend-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-accent {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-accent:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Grid */
.guiones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.guion-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.guion-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.borrador { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge.aprobado { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.field {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.field span {
    display: block;
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.field p {
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.5;
}

.card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.btn-approve {
    width: 100%;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-approve:hover {
    background: var(--success);
    color: #fff;
}

.btn-approve:disabled {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Loader */
.loader-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(2, 132, 199, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Table Styles */
.tendencias-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.tendencias-table th, .tendencias-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.tendencias-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.tendencias-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.badge-processed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Pipeline Semanal */
.pipeline-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.pipeline-track {
    border-top: 4px solid var(--accent);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-radius: 12px;
}

.pipeline-track:nth-child(2) {
    border-top-color: #8b5cf6;
}

.pipeline-track:nth-child(3) {
    border-top-color: #f43f5e;
}

.track-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.track-goal {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 0.5rem;
}

.track-tasks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-check {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.task-check:hover {
    background: rgba(255, 255, 255, 0.05);
}

.task-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.task-check input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.7;
}
/ *   C o n t r o l   C e n t e r   * / 
 . c o n t r o l - c e n t e r   { 
         d i s p l a y :   f l e x ; 
         j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
         a l i g n - i t e m s :   c e n t e r ; 
         p a d d i n g :   1 . 5 r e m ; 
         m a r g i n - b o t t o m :   2 r e m ; 
         g a p :   1 r e m ; 
         f l e x - w r a p :   w r a p ; 
 } 
 
 . c o n t r o l - i n p u t - g r o u p   { 
         d i s p l a y :   f l e x ; 
         g a p :   1 r e m ; 
         f l e x :   1 ; 
         m i n - w i d t h :   3 0 0 p x ; 
 } 
 
 . t r e n d - i n p u t   { 
         f l e x :   1 ; 
         b a c k g r o u n d :   v a r ( - - g l a s s - b g ) ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - g l a s s - b o r d e r ) ; 
         c o l o r :   v a r ( - - t e x t - p r i m a r y ) ; 
         p a d d i n g :   0 . 8 r e m   1 . 2 r e m ; 
         b o r d e r - r a d i u s :   8 p x ; 
         f o n t - f a m i l y :   ' O u t f i t ' ,   s a n s - s e r i f ; 
         f o n t - s i z e :   0 . 9 5 r e m ; 
         o u t l i n e :   n o n e ; 
         t r a n s i t i o n :   a l l   0 . 3 s   e a s e ; 
 } 
 
 . t r e n d - i n p u t : f o c u s   { 
         b o r d e r - c o l o r :   v a r ( - - a c c e n t ) ; 
         b o x - s h a d o w :   0   0   1 0 p x   r g b a ( 2 ,   1 3 2 ,   1 9 9 ,   0 . 2 ) ; 
 } 
 
 . b t n - s e c o n d a r y   { 
         b a c k g r o u n d :   t r a n s p a r e n t ; 
         c o l o r :   v a r ( - - t e x t - p r i m a r y ) ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - g l a s s - b o r d e r ) ; 
         p a d d i n g :   0 . 8 r e m   1 . 5 r e m ; 
         b o r d e r - r a d i u s :   8 p x ; 
         f o n t - w e i g h t :   6 0 0 ; 
         c u r s o r :   p o i n t e r ; 
         t r a n s i t i o n :   a l l   0 . 2 s   e a s e ; 
 } 
 
 . b t n - s e c o n d a r y : h o v e r   { 
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 0 5 ) ; 
         b o r d e r - c o l o r :   v a r ( - - t e x t - s e c o n d a r y ) ; 
 } 
 
 . b t n - a c c e n t   { 
         b a c k g r o u n d :   l i n e a r - g r a d i e n t ( 1 3 5 d e g ,   # 1 0 b 9 8 1 ,   # 0 5 9 6 6 9 ) ; 
         c o l o r :   w h i t e ; 
         b o r d e r :   n o n e ; 
         p a d d i n g :   0 . 8 r e m   1 . 5 r e m ; 
         b o r d e r - r a d i u s :   8 p x ; 
         f o n t - w e i g h t :   6 0 0 ; 
         c u r s o r :   p o i n t e r ; 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         g a p :   0 . 5 r e m ; 
         t r a n s i t i o n :   a l l   0 . 3 s   e a s e ; 
         b o x - s h a d o w :   0   4 p x   1 5 p x   r g b a ( 1 6 ,   1 8 5 ,   1 2 9 ,   0 . 3 ) ; 
 } 
 
 . b t n - a c c e n t : h o v e r   { 
         t r a n s f o r m :   t r a n s l a t e Y ( - 2 p x ) ; 
         b o x - s h a d o w :   0   6 p x   2 0 p x   r g b a ( 1 6 ,   1 8 5 ,   1 2 9 ,   0 . 4 ) ; 
 } 
 
 . b t n - a c c e n t : d i s a b l e d   { 
         o p a c i t y :   0 . 5 ; 
         c u r s o r :   n o t - a l l o w e d ; 
         t r a n s f o r m :   n o n e ; 
 }  
 