/* crm-frontend.css */

.crm-frontend-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    max-width: 1200px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.crm-frontend-wrap h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

.crm-locked {
    background-color: #ffebe8;
    border: 1px solid #c00;
    color: #c00;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    margin: 20px auto;
    max-width: 600px;
}

/* Dashboard Summary */
.crm-dashboard-summary-frontend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.crm-dashboard-summary-frontend .crm-summary-box {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    flex: 1 1 calc(33% - 20px); /* 3 columnas */
    max-width: 250px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.crm-dashboard-summary-frontend .crm-summary-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.crm-dashboard-summary-frontend .crm-summary-box strong {
    display: block;
    font-size: 1.1em;
    color: #555;
    margin-bottom: 8px;
}

.crm-dashboard-summary-frontend .crm-summary-box .crm-count-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #0073aa; /* WordPress primary color */
}

/* Navigation Tabs */
.crm-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 25px;
    justify-content: center;
}

.crm-tab-btn {
    padding: 12px 20px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    border: none;
    background-color: transparent;
    cursor: pointer;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* Alineación para que el borde se vea como subrayado */
}

.crm-tab-btn:hover {
    color: #0073aa;
}

.crm-tab-btn.crm-tab-active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    font-weight: 600;
}

/* Panel Content */
.crm-panel-content h3 {
    font-size: 1.8em;
    color: #444;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

/* Toolbar (Filters and Buttons) */
.crm-toolbar-frontend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 25px;
    justify-content: flex-start;
}

.crm-filter-form {
    display: flex;
    gap: 10px;
}

.crm-select.crm-filter-field {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.9em;
}

/* Generic Button Styles */
.crm-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
    font-size: 0.95em;
}

.crm-btn-primary {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.crm-btn-primary:hover {
    background-color: #006799;
    color: #fff;
    border-color: #006799;
}

.crm-btn-secondary {
    background-color: #f0f0f1;
    color: #333;
    border-color: #c3c4c7;
}

.crm-btn-secondary:hover {
    background-color: #e0e0e0;
    color: #222;
    border-color: #b3b4b7;
}

.crm-btn-info {
    background-color: #2ea44f; /* Greenish for info/edit */
    color: #fff;
    border-color: #2ea44f;
}

.crm-btn-info:hover {
    background-color: #2c974b;
    color: #fff;
    border-color: #2c974b;
}

.crm-btn-danger {
    background-color: #cb4e4e; /* Reddish for delete */
    color: #fff;
    border-color: #cb4e4e;
}

.crm-btn-danger:hover {
    background-color: #bc3e3e;
    color: #fff;
    border-color: #bc3e3e;
}

.crm-btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 4px;
}

/* Form Card (Create/Edit) */
.crm-form-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.crm-form-frontend .crm-field-wrap {
    margin-bottom: 15px;
}

.crm-form-frontend label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.4;
}

.crm-form-frontend .crm-input,
.crm-form-frontend .crm-textarea,
.crm-form-frontend .crm-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Asegura que padding no aumente el ancho */
}

.crm-form-frontend .crm-textarea {
    min-height: 100px;
    resize: vertical;
}

.crm-form-frontend .crm-input:focus,
.crm-form-frontend .crm-textarea:focus,
.crm-form-frontend .crm-select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.crm-form-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.crm-file-preview-frontend {
    margin-top: 5px;
    font-size: 0.9em;
    color: #555;
}
.crm-file-preview-frontend a {
    color: #0073aa;
    text-decoration: none;
}
.crm-file-preview-frontend a:hover {
    text-decoration: underline;
}

/* Table Listing */
.crm-table-container {
    overflow-x: auto; /* Permite scroll horizontal en tablas grandes */
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden; /* Para que los bordes de la tabla se vean redondeados */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.crm-table th,
.crm-table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.crm-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #444;
    white-space: nowrap; /* Evita que los encabezados se rompan */
}

.crm-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.crm-table tr:hover {
    background-color: #f0f8ff; /* Light blue on hover */
}

.crm-table td {
    color: #555;
}

.crm-table td .crm-btn {
    margin-right: 5px;
}

/* Pagination */
.crm-pagination {
    margin-top: 25px;
    text-align: center;
}

.crm-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    background-color: #fff;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.crm-pagination .page-numbers:hover {
    background-color: #f0f0f0;
    border-color: #c0c0c0;
}

.crm-pagination .page-numbers.current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
    font-weight: bold;
}

/* Notices (Success/Error Messages) */
.crm-notice {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    border-left: 5px solid;
}

.crm-notice-success {
    background-color: #e6ffe6;
    border-color: #2ea44f;
    color: #2ea44f;
}

.crm-notice-error {
    background-color: #ffebe8;
    border-color: #cb4e4e;
    color: #cb4e4e;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .crm-dashboard-summary-frontend .crm-summary-box {
        flex: 1 1 calc(50% - 15px); /* 2 columnas */
    }
    .crm-toolbar-frontend {
        justify-content: center;
    }
    .crm-tab-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .crm-frontend-wrap {
        padding: 15px;
        margin: 15px auto;
    }
    .crm-dashboard-summary-frontend .crm-summary-box {
        flex: 1 1 100%; /* 1 columna */
        max-width: 100%;
    }
    .crm-toolbar-frontend {
        flex-direction: column;
        align-items: stretch;
    }
    .crm-toolbar-frontend .crm-filter-form,
    .crm-toolbar-frontend .crm-btn {
        width: 100%;
        margin-right: 0;
    }
    .crm-form-actions {
        flex-direction: column;
        gap: 10px;
    }
    .crm-form-actions .crm-btn {
        width: 100%;
    }
    .crm-table-container {
        width: 100%;
        overflow-x: auto;
    }
    .crm-table {
        min-width: 700px; /* Asegura que la tabla no se colapse demasiado */
    }
}