/* AgrarProjekt Portal Styles */

/* =====================================================
   PORTAL FULL-SCREEN: oculta la admin bar de WordPress
   cuando se renderiza en modo pantalla completa
   ===================================================== */
body.agrocrm-portal-body #wpadminbar,
body.agrocrm-portal-body #wp-toolbar {
    display: none !important;
}
body.agrocrm-portal-body {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.agrocrm-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d5e4f 0%, #1a7a6b 100%);
    padding: 20px;
}

.agrocrm-login-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 450px;
    width: 100%;
    overflow: hidden;
}

.agrocrm-login-header {
    background: #0d5e4f;
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.agrocrm-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

.agrocrm-login-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.agrocrm-login-header p {
    margin: 0;
    opacity: 0.9;
}

/* Barra de usuario */
.agrocrm-user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.agrocrm-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agrocrm-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d4f3f, #1a7a60);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(13, 79, 63, 0.3);
}

.agrocrm-user-details {
    display: flex;
    flex-direction: column;
}

.agrocrm-user-name {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
}

.agrocrm-user-profile {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.agrocrm-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fee2e2;
    color: #dc2626;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid #fecaca;
}

.agrocrm-logout-btn:hover {
    background: #fecaca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.agrocrm-logout-link {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.agrocrm-logout-link:hover {
    text-decoration: underline;
}

.agrocrm-logout-icon {
    color: #dc2626;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
}

.agrocrm-logout-icon:hover {
    background: #fee2e2;
}

@media (max-width: 768px) {
    .agrocrm-user-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .agrocrm-logout-btn {
        width: 100%;
        justify-content: center;
    }
}

.agrocrm-form {
    padding: 40px 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group label .icon {
    margin-right: 5px;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0d5e4f;
}

.agrocrm-forgot-password {
    display: block;
    margin-top: 5px;
    color: #0d5e4f;
    font-size: 13px;
    text-decoration: none;
}

.agrocrm-forgot-password:hover {
    text-decoration: underline;
}

.agrocrm-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.agrocrm-btn-primary {
    background: #0d5e4f;
    color: white;
    width: 100%;
}

.agrocrm-btn-primary:hover {
    background: #0a4a3d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 94, 79, 0.3);
}

.agrocrm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.agrocrm-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.agrocrm-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.agrocrm-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.agrocrm-login-footer {
    padding: 20px 30px;
    text-align: center;
    background: #f5f5f5;
    font-size: 12px;
    color: #666;
}

/* Upload & Download Pages */
.agrocrm-upload-container,
.agrocrm-download-container,
.agrocrm-clients-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.agrocrm-upload-container h2,
.agrocrm-download-container h2,
.agrocrm-clients-container h2 {
    color: #0d5e4f;
    margin-bottom: 30px;
    font-size: 28px;
}

.agrocrm-upload-box,
.agrocrm-search-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.agrocrm-upload-info {
    background: #f0f7f6;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 25px;
    border-left: 4px solid #0d5e4f;
}

.agrocrm-upload-info code {
    display: block;
    background: #fff;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-family: monospace;
    color: #0d5e4f;
}

.search-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.search-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.search-row .agrocrm-btn {
    width: auto;
}

/* Table Styles */
.agrocrm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.agrocrm-table th,
.agrocrm-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.agrocrm-table th {
    background: #0d5e4f;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

.agrocrm-table tr:hover {
    background: #f5f5f5;
}

.results-count {
    padding: 10px 0;
    color: #666;
    font-size: 14px;
}

.btn-download {
    background: #0d5e4f;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-download:hover {
    background: #0a4a3d;
}

/* Progress Bar */
.agrocrm-progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #0d5e4f;
    width: 0%;
    transition: width 0.3s;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .search-row {
        flex-direction: column;
    }
    
    .search-row .form-group {
        width: 100%;
    }
    
    .agrocrm-table {
        font-size: 12px;
    }
    
    .agrocrm-table th,
    .agrocrm-table td {
        padding: 8px;
    }
}