/* Klinika Formy - Macro Generator Styles */
.kfmg-wrap {
    max-width: 980px;
    margin: 24px auto;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
}

.kfmg-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.kfmg-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #111827;
    font-size: 20px;
}

.kfmg-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.kfmg-grid label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    gap: 6px;
    color: #374151;
    font-weight: 500;
}

.kfmg-grid input[type="number"] {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    transition: border-color 0.2s;
}

.kfmg-grid input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
}

.kfmg-grid input[type="checkbox"] {
    margin-right: 6px;
}

.kfmg-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.kfmg-actions button {
    padding: 10px 16px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    transition: all 0.2s !important;
}

.kfmg-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kfmg-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #f9fafb;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.kfmg-summary > div {
    font-size: 14px;
    color: #374151;
}

.kfmg-summary strong {
    color: #111827;
    font-weight: 600;
}

.kfmg-meals {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kfmg-meal {
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.kfmg-meal:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.kfmg-meal h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #111827;
    font-weight: 600;
}

.kfmg-meal .macros {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.kfmg-meal .swap {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.kfmg-meal .swap input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
}

.kfmg-meal .swap button {
    padding: 8px 14px !important;
    font-size: 13px !important;
    white-space: nowrap;
}

.kfmg-meal .swap-out {
    font-size: 13px;
    color: #059669;
    font-weight: 500;
    padding: 4px 8px;
    background: #d1fae5;
    border-radius: 6px;
}

.kfmg-pill {
    background: #111827;
    color: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.kfmg-pill.error {
    background: #dc2626;
}

.kfmg-pill.success {
    background: #059669;
}

.kfmg-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: kfmg-spin 0.6s linear infinite;
}

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

@media (max-width: 768px) {
    .kfmg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .kfmg-summary {
        flex-direction: column;
        gap: 8px;
    }
    
    .kfmg-meal .swap {
        flex-direction: column;
        align-items: stretch;
    }
    
    .kfmg-meal .swap input[type="text"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .kfmg-grid {
        grid-template-columns: 1fr;
    }
    
    .kfmg-actions {
        flex-direction: column;
    }
    
    .kfmg-actions button {
        width: 100%;
    }
}