:root {
    --bg-dark: #0B132B;
    --panel-dark: #1C2541;
    --accent: #5BC0BE;
    --highlight: #ff8c00;
    --success: #2ca02c;
    --danger: #a83232;
    --text-main: #ffffff;
    --text-muted: #8e95a5;
    
    --glass-bg: #1C2541; /* Solid background instead of transparent */
    --glass-border: #3A506B;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

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

/* Fondo plano */
#bg-canvas {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    background-color: var(--bg-dark);
}

#app-container {
    width: 100vw; height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
    padding: 20px;
}

/* Vistas */
.view { display: none; width: 100%; height: 100%; flex-direction: column; align-items: center; }
.view.active { display: flex; }

/* Animaciones */
.fade-in { animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tipografía */
.title { font-family: 'Outfit', sans-serif; font-size: 2.5rem; font-weight: 800; margin-bottom: 10px; text-align: center; background: linear-gradient(90deg, #fff, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.subtitle { font-size: 1.1rem; color: var(--text-muted); font-style: italic; margin-bottom: 30px; text-align: center; }
.highlight { color: var(--highlight) !important; -webkit-text-fill-color: var(--highlight); }
.section-title { align-self: flex-start; margin: 10px 0 20px 40px; font-family: 'Outfit', sans-serif; }

/* Componentes Glassmorphism */
.glass-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 30px;
    width: 100%;
    max-width: 450px;
    transition: transform 0.3s ease;
}

.glass-box h2 { text-align: center; margin-bottom: 20px; font-family: 'Outfit', sans-serif; }

/* Formularios */
input, select {
    width: 100%; padding: 12px 15px; margin-bottom: 15px;
    background: rgba(11, 19, 43, 0.7);
    border: 1px solid rgba(91, 192, 190, 0.4);
    border-radius: 8px; color: white;
    font-size: 1rem; font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 10px rgba(91, 192, 190, 0.3); }
input::placeholder { color: rgba(255,255,255,0.4); }

label { font-size: 0.85rem; color: var(--accent); margin-bottom: 5px; display: block; }

/* Botones */
.btn {
    padding: 12px 20px; border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s ease;
    text-align: center; color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.3); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(135deg, #1f6aa5, var(--accent)); width: 100%; }
.btn-secondary { background: #3A506B; }
.btn-success { background: linear-gradient(135deg, #1b681b, var(--success)); }
.btn-warning { background: linear-gradient(135deg, #d47400, var(--highlight)); }
.btn-danger { background: linear-gradient(135deg, #822222, var(--danger)); }

.btn-big { height: 130px; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; padding: 20px; border-radius: 16px; }

/* Menú Principal */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; width: 100%; max-width: 600px; margin-top: 30px; }
.logout-btn { position: absolute; bottom: 40px; width: 200px; }
.back-btn { align-self: flex-start; margin: 20px 0 10px 40px; }
.top-bar { width: 100%; padding: 20px 40px; display: flex; justify-content: flex-start; gap: 15px; align-items: center; }

/* Layout Oficina */
.split-layout { display: flex; width: 100%; max-width: 1200px; height: calc(100vh - 120px); gap: 20px; padding: 0 40px 20px 40px; }
.left-panel { flex: 1; display: flex; flex-direction: column; overflow-y: auto; max-width: 450px; }
.right-panel { flex: 1.5; display: flex; flex-direction: column; overflow-y: auto; max-width: 100%; padding-right: 10px; }

.scrollable-list { overflow-y: auto; flex-grow: 1; padding-right: 10px; margin-top: 10px; }
.scrollable-list::-webkit-scrollbar { width: 6px; }
.scrollable-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

.btn-group { display: flex; gap: 10px; margin-top: 20px; }
.btn-group .btn { flex: 1; }

/* Listas Inbox / Torneos */
.list-item { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; transition: background 0.3s ease; }
.list-item:hover { background: rgba(255,255,255,0.05); }
.list-item-info { flex: 1; font-size: 0.9rem; line-height: 1.4; }
.list-item-actions { display: flex; gap: 5px; align-items: center; }

.item-couple { border-left: 4px solid var(--highlight); }
.item-received { border-left: 4px solid var(--accent); }
.item-sent { border-left: 4px solid var(--text-muted); }

/* Grid CCAA */
.ccaa-grid { width: 100%; max-width: 1200px; padding: 0 40px 40px 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; overflow-y: auto; }
.ccaa-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; padding: 20px; text-align: center; display: flex; flex-direction: column; justify-content: space-between; height: 140px; transition: transform 0.2s; }
.ccaa-card:hover { transform: translateY(-5px); }
.ccaa-card h3 { color: var(--accent); font-size: 1.1rem; margin-bottom: 5px; }

.full-width-list { width: 100%; max-width: 1200px; padding: 0 40px 40px 40px; }

.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }
.badge-warning { background: var(--highlight); color: white; }

.legend { font-size: 0.85rem; text-align: center; margin-top: 20px; color: var(--text-muted); line-height: 1.5; }
.footer { position: absolute; bottom: 20px; font-size: 0.8rem; color: var(--text-muted); }

/* Checkboxes */
.check-item { display: flex; align-items: center; margin-bottom: 8px; font-size: 0.85rem; }
.check-item input { width: 16px; height: 16px; margin: 0 10px 0 0; }

/* Media Queries para Móviles y Tablets */
@media (max-width: 768px) {
    body { overflow-y: auto; }
    #app-container { height: auto; min-height: 100vh; justify-content: flex-start; padding-top: 40px; padding-bottom: 40px; }
    .view { height: auto; justify-content: flex-start; }
    .footer { position: relative; bottom: auto; margin-top: 40px; text-align: center; width: 100%; }
    
    .title { font-size: 1.8rem; }
    .split-layout { flex-direction: column; height: auto; padding: 0 15px 20px 15px; }
    .left-panel, .right-panel { max-width: 100%; width: 100%; }
    .menu-grid { grid-template-columns: 1fr; gap: 15px; padding: 0 15px; }
    .btn-big { height: 80px; font-size: 1rem; }
    .top-bar { padding: 15px; flex-direction: column; align-items: stretch; }
    .top-bar .btn { width: 100%; margin-bottom: 10px; }
    .ccaa-grid { padding: 0 15px 20px 15px; grid-template-columns: 1fr; }
    .full-width-list { padding: 0 15px 20px 15px; }
    .glass-box { padding: 20px; }
    .section-title { margin-left: 15px; }
    .back-btn { margin-left: 15px; width: calc(100% - 30px); }
    .logout-btn { position: relative; bottom: auto; margin-top: 30px; width: 90%; }
    .list-item { flex-direction: column; align-items: flex-start; }
    .list-item-actions { margin-top: 15px; width: 100%; flex-wrap: wrap; }
    .list-item-actions .btn { flex: 1; }
}
