/* =============================================
   PILAY - Layout Principal App
   ============================================= */

/* ===== APP CONTAINER ===== */
.app-container {
    display: none;
    min-height: 100vh;
}

.app-container.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== HEADER ===== */
.app-header {
    background: linear-gradient(135deg, var(--pilay-primary-dark), var(--pilay-primary));
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-lg);
    flex-wrap: wrap;
    gap: 1rem;
}

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

.header-brand h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-badge {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-email {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

@media (max-width: 640px) {
    .app-header {
        padding: 1rem;
        justify-content: center;
        text-align: center;
    }
    
    .header-brand {
        width: 100%;
        justify-content: center;
    }
    
    .header-email {
        display: none;
    }
}

/* ===== MAIN CONTENT ===== */
.app-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 768px) {
    .app-main {
        padding: 1rem;
    }
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title .icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--pilay-accent), var(--pilay-accent-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

/* ===== SECTIONS ===== */
.section {
    margin-bottom: 2rem;
}

/* ===== GRID LAYOUTS ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===== CONFIG ROW ===== */
.config-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.config-row .form-group {
    margin-bottom: 0;
}

/* ===== RECOVERY BANNER ===== */
.recovery-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 2rem;
    background: #fef3c7;
    border-bottom: 1px solid #fbbf24;
    font-size: 0.875rem;
    color: #92400e;
    flex-wrap: wrap;
}

.recovery-icon { font-size: 1.1rem; flex-shrink: 0; }

.recovery-text { flex: 1; }

.recovery-actions { display: flex; gap: 0.5rem; }

.recovery-btn {
    padding: 0.35rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #d97706;
    background: transparent;
    color: #92400e;
    transition: all var(--transition-fast);
}

.recovery-btn:hover { background: #fde68a; }

.recovery-btn.primary {
    background: #d97706;
    color: white;
    border-color: #b45309;
}

.recovery-btn.primary:hover { background: #b45309; }
