:root {
    --noche: #232C18;
    --crema: #F6F1E2;
    --verde: #3F5028;
    --lima: #CFE6A0;
    --terracota: #B35A22;

    --font-titulo: "Archivo", system-ui, sans-serif;
    --font-cuerpo: "Public Sans", system-ui, sans-serif;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-cuerpo);
    font-size: 16px;
    line-height: 1.5;
    color: var(--noche);
    background-color: var(--crema);
}

/* ============= Pantallas =============  */

.pantalla {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Pantalla de acceso */
.pantalla-acceso {
    background-color: var(--noche);
}

.acceso-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.acceso-container .logo {
    width: 120px;
    height: auto;
    margin-bottom: 40px;
}

.acceso-container h1 {
    font-family: var(--font-titulo);
    font-size: 32px;
    font-weight: 700;
    color: var(--crema);
    margin-bottom: 40px;
}

.acceso-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.acceso-form input {
    padding: 12px 16px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-cuerpo);
    background-color: var(--crema);
    color: var(--noche);
}

.acceso-form input::placeholder {
    color: #999;
}

.clave-wrap {
    position: relative;
    display: flex;
}

.clave-wrap input {
    flex: 1;
    padding-right: 56px;
}

.btn-ver-clave {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    background: none;
    border: none;
    color: #666;
    font-family: var(--font-cuerpo);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-ver-clave:hover {
    color: var(--noche);
}

.error-acceso {
    min-height: 24px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--lima);
    background-color: rgba(207, 230, 160, 0.2);
    padding: 8px 12px;
    border-radius: 4px;
    display: none;
}

.error-acceso.visible {
    display: block;
}

/* Pantalla ¿Quién eres? */
.pantalla-quien {
    background-color: var(--crema);
}

.quien-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.quien-container .logo {
    width: 120px;
    height: auto;
    margin-bottom: 40px;
}

.quien-container h2 {
    font-family: var(--font-titulo);
    font-size: 28px;
    font-weight: 700;
    color: var(--verde);
    margin-bottom: 40px;
}

.selector-personas {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-persona {
    padding: 20px 16px;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-titulo);
    background-color: white;
    color: var(--verde);
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    min-height: 60px;
    transition: all 0.2s;
}

.btn-persona:hover {
    border-color: var(--lima);
    background-color: #fafaf8;
}

.btn-persona:active {
    background-color: var(--lima);
    color: var(--noche);
}

/* Pantalla app */
.pantalla-app {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: auto;
    padding: 0;
}

.header {
    background-color: var(--noche);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-header {
    width: 80px;
    height: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.persona-nombre {
    font-family: var(--font-titulo);
    font-size: 18px;
    font-weight: 600;
    color: var(--crema);
}

.btn-cambiar {
    background: none;
    border: none;
    color: var(--lima);
    font-family: var(--font-cuerpo);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.btn-cambiar:hover {
    opacity: 0.8;
}

/* Pestañas */
.tabs {
    display: flex;
    background-color: var(--crema);
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    flex: 1;
    padding: 16px;
    font-family: var(--font-cuerpo);
    font-size: 16px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--noche);
    background-color: var(--lima);
    border-bottom-color: var(--verde);
}

.tab-btn:hover:not(.active) {
    color: var(--noche);
}

/* Contenido de pestañas */
.tab-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--crema);
}

.tab-panel {
    display: none;
    padding: 24px;
    max-width: 640px;
    margin: 0 auto;
}

.tab-panel.active {
    display: block;
}

/* Mi día */
.plan-info {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #666;
}

.seccion-plan {
    margin-bottom: 32px;
}

.seccion-plan h3 {
    font-family: var(--font-titulo);
    font-size: 18px;
    font-weight: 700;
    color: var(--verde);
    margin-bottom: 16px;
}

.plan-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-item {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
}

.plan-item-colegio {
    font-family: var(--font-titulo);
    font-size: 14px;
    font-weight: 600;
    color: var(--verde);
    margin-bottom: 8px;
}

.plan-item-id {
    display: inline-block;
    background-color: var(--lima);
    color: var(--noche);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.plan-item-contacto {
    font-weight: 600;
    margin-bottom: 4px;
}

.plan-item-datos {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.plan-item-detalle {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.plan-item-vence {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.plan-item-btn {
    background-color: var(--terracota);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-family: var(--font-cuerpo);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    min-height: 44px;
}

.plan-item-btn:hover {
    opacity: 0.9;
}

.plan-item-vacio {
    color: #999;
    text-align: center;
    padding: 32px 16px;
    font-size: 14px;
}

/* Hechos hoy */
.form-toques {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-family: var(--font-titulo);
    font-size: 14px;
    font-weight: 600;
    color: var(--verde);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-cuerpo);
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: var(--noche);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--lima);
    box-shadow: 0 0 0 2px rgba(207, 230, 160, 0.2);
}

.form-group textarea {
    min-height: 80px;
}

.form-group small {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.canal-buttons {
    display: flex;
    gap: 8px;
}

.btn-canal {
    flex: 1;
    padding: 10px 12px;
    font-family: var(--font-cuerpo);
    font-size: 14px;
    font-weight: 600;
    background-color: #f5f5f5;
    color: #999;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.btn-canal.active {
    background-color: var(--lima);
    color: var(--noche);
    border-color: var(--lima);
}

.btn-canal:hover {
    border-color: var(--lima);
}

.nota-fecha {
    font-size: 12px;
    color: #999;
    margin-bottom: 16px;
    text-align: center;
}

.btn-guardar {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--terracota);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: var(--font-cuerpo);
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    min-height: 44px;
    transition: opacity 0.2s;
}

.btn-guardar:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-guardar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mensaje-guardado {
    background-color: var(--lima);
    color: var(--noche);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.mensaje-guardado.visible {
    display: block;
}

.hechos-list-section {
    margin-top: 32px;
}

.hechos-list-section h3 {
    font-family: var(--font-titulo);
    font-size: 18px;
    font-weight: 700;
    color: var(--verde);
    margin-bottom: 16px;
}

.hechos-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hechos-item {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
}

.hechos-item-hora {
    font-family: var(--font-titulo);
    font-size: 12px;
    font-weight: 700;
    color: #999;
    margin-bottom: 8px;
}

.hechos-item-colegio {
    font-family: var(--font-titulo);
    font-size: 14px;
    font-weight: 600;
    color: var(--verde);
    margin-bottom: 6px;
}

.hechos-item-id {
    display: inline-block;
    background-color: var(--lima);
    color: var(--noche);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 6px;
}

.hechos-item-canal {
    display: inline-block;
    font-size: 11px;
    color: #666;
}

.hechos-item-contenido {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    white-space: pre-wrap;
    word-break: break-word;
}

.hechos-item-vacio {
    color: #999;
    text-align: center;
    padding: 24px 16px;
    font-size: 14px;
}

/* Botones generales */
.btn {
    padding: 12px 20px;
    background-color: var(--terracota);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-cuerpo);
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    min-height: 44px;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-entrar {
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .pantalla {
        padding: 16px;
    }

    .acceso-container {
        width: 100%;
    }

    .quien-container {
        width: 100%;
    }

    .tab-panel {
        padding: 16px;
    }
}

/* Atributo hidden */
[hidden] {
    display: none !important;
}
