/* ============================================
   ESTILOS COMPARTIDOS - SISTEMA SRAD
   Colores Oficiales FAO
   ============================================ */

:root {
    --fao-blue: #116AAB;
    --fao-blue-dark: #0D5A8A;
    --fao-blue-light: #E6F2F8;
    --fao-gray-dark: #545454;
    --fao-gray-light: #F2F2F2;
    --fao-white: #FFFFFF;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --info: #2196F3;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--fao-gray-light);
    color: var(--fao-gray-dark);
    line-height: 1.6;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: linear-gradient(135deg, var(--fao-blue) 0%, var(--fao-blue-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

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

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--fao-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--fao-blue-dark);
}

.btn-secondary {
    background: var(--fao-white);
    color: var(--fao-blue);
    border: 2px solid var(--fao-blue);
}

.btn-secondary:hover {
    background: var(--fao-blue-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-icon {
    background: none;
    border: 1px solid #ddd;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--fao-gray-dark);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--fao-blue-light);
    border-color: var(--fao-blue);
    color: var(--fao-blue);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--fao-white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--fao-gray-light);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--fao-gray-dark);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--fao-gray-light);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--fao-gray-dark);
    transition: all 0.2s;
}

.tab:hover {
    color: var(--fao-blue);
}

.tab.active {
    color: var(--fao-blue);
    border-bottom-color: var(--fao-blue);
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

/* ============================================
   TABLES
   ============================================ */

.table-container {
    background: var(--fao-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--fao-blue-light);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--fao-gray-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--fao-gray-light);
}

tbody tr:hover {
    background: var(--fao-blue-light);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--fao-gray-dark);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: " *";
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.85rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--fao-blue);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--fao-white);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--fao-gray-light);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--fao-gray-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--fao-gray-dark);
}

/* ============================================
   WIZARD
   ============================================ */

.wizard {
    background: var(--fao-white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--fao-gray-light);
    z-index: 0;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.wizard-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fao-gray-light);
    color: var(--fao-gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 600;
}

.wizard-step.active .wizard-step-number {
    background: var(--fao-blue);
    color: white;
}

.wizard-step.completed .wizard-step-number {
    background: var(--success);
    color: white;
}

.wizard-content {
    min-height: 400px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--fao-gray-light);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: var(--fao-blue-light);
    color: var(--fao-blue);
}

.badge-success {
    background: #E8F5E9;
    color: #388E3C;
}

.badge-warning {
    background: #FFF3E0;
    color: #F57C00;
}

.badge-danger {
    background: #FFEBEE;
    color: #C62828;
}

.badge-info {
    background: #E3F2FD;
    color: #1976D2;
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--fao-white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-title {
    font-size: 0.9rem;
    color: var(--fao-gray-dark);
    text-transform: uppercase;
    font-weight: 500;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--fao-blue);
    margin-bottom: 0.5rem;
}

/* ============================================
   FILTERS
   ============================================ */

.filters-section {
    background: var(--fao-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

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

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex {
    display: flex;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

