/* public/css/hub-osc.css */

:root {
    --hub-primary: #144e76;
    --hub-primary-light: #1e6fa7;
    --hub-primary-dark: #0f3a57;
    --hub-accent: #22c55e;
    --hub-accent-light: #4ade80;
    --hub-warning: #f59e0b;
    --hub-danger: #ef4444;
    --hub-info: #3b82f6;
    --hub-bg: #f0f4f8;
    --hub-bg-card: #ffffff;
    --hub-text: #0f172a;
    --hub-text-muted: #64748b;
    --hub-border: #e2e8f0;
    --hub-border-focus: #1e6fa7;
    --hub-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --hub-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --hub-shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --hub-radius: 12px;
    --hub-radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--hub-bg);
    color: var(--hub-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== NAV ===== */
.hub-osc-nav {
    background: var(--hub-primary);
    padding: 0 1.5rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hub-osc-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.hub-osc-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    transition: opacity 0.2s;
}
.hub-osc-brand:hover { opacity: 0.9; color: white; }

.hub-osc-logo { height: 40px; width: auto; }

.hub-osc-brand-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}
.hub-osc-brand-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.hub-osc-nav-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hub-osc-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    margin-right: 0.5rem;
}

.hub-osc-nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--hub-radius-sm);
    transition: all 0.2s;
    border: none;
    background: none;
    cursor: pointer;
}
.hub-osc-nav-link:hover { background: rgba(255,255,255,0.15); color: white; }
.hub-osc-nav-link.active { background: rgba(255,255,255,0.2); color: white; }
.hub-osc-logout:hover { background: rgba(239,68,68,0.3); }

/* ===== MAIN ===== */
.hub-osc-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* ===== FOOTER ===== */
.hub-osc-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--hub-text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--hub-border);
}

/* ===== ALERTS ===== */
.hub-osc-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--hub-radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.hub-osc-alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.hub-osc-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.hub-osc-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fed7aa; }
.hub-osc-alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== CARDS ===== */
.hub-card {
    background: var(--hub-bg-card);
    border-radius: var(--hub-radius);
    border: 1px solid var(--hub-border);
    box-shadow: var(--hub-shadow-sm);
    overflow: hidden;
}

.hub-card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--hub-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hub-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--hub-primary), var(--hub-primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.hub-card-title h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hub-primary);
    margin: 0;
}
.hub-card-title p {
    font-size: 0.85rem;
    color: var(--hub-text-muted);
    margin: 0.125rem 0 0;
}

.hub-card-body { padding: 2rem; }
.hub-card-footer { padding: 1.25rem 2rem; border-top: 1px solid var(--hub-border); background: #f8fafc; }

/* ===== BADGES DE STATUS ===== */
.hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.hub-badge-draft { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.hub-badge-pending { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.hub-badge-approved { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.hub-badge-rejected { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ===== PROGRESS BAR ===== */
.hub-progress-container { margin-bottom: 1.5rem; }
.hub-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--hub-text-muted);
    font-weight: 500;
}
.hub-progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.hub-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--hub-primary), var(--hub-primary-light));
}
.hub-progress-fill.complete { background: linear-gradient(90deg, #16a34a, #22c55e); }

/* ===== FORM STYLES ===== */
.hub-form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--hub-border);
}
.hub-form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.hub-form-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--hub-primary);
    margin-bottom: 1.25rem;
}
.hub-form-section-title i {
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hub-primary), var(--hub-primary-light));
    color: white;
    border-radius: 8px;
}

.hub-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.hub-form-row.single { grid-template-columns: 1fr; }
.hub-form-row.triple { grid-template-columns: 1fr 1fr 1fr; }

.hub-form-group { display: flex; flex-direction: column; }

.hub-form-group label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hub-text);
    margin-bottom: 0.375rem;
}
.hub-form-group label i { color: var(--hub-primary-light); font-size: 0.9rem; }
.hub-form-group label .required { color: var(--hub-danger); }

.hub-form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    font-size: 0.9rem;
    color: var(--hub-text);
    background: white;
    transition: all 0.2s;
    font-family: inherit;
}
.hub-form-control:focus {
    outline: none;
    border-color: var(--hub-border-focus);
    box-shadow: 0 0 0 3px rgba(30,111,167,0.12);
}
.hub-form-control.is-invalid { border-color: var(--hub-danger); }
.hub-form-control:disabled { background: #f8fafc; color: var(--hub-text-muted); cursor: not-allowed; }

textarea.hub-form-control { min-height: 100px; resize: vertical; }
select.hub-form-control { cursor: pointer; }

.hub-form-hint {
    font-size: 0.78rem;
    color: var(--hub-text-muted);
    margin-top: 0.25rem;
}

.hub-form-error {
    font-size: 0.78rem;
    color: var(--hub-danger);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hub-form-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
}
.hub-form-switch label { margin: 0; cursor: pointer; }
.hub-form-switch input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: #cbd5e1;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}
.hub-form-switch input[type="checkbox"]::after {
    content: '';
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.hub-form-switch input[type="checkbox"]:checked { background: var(--hub-accent); }
.hub-form-switch input[type="checkbox"]:checked::after { transform: translateX(20px); }

/* ===== BUTTONS ===== */
.hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--hub-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}
.hub-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.hub-btn-primary {
    background: linear-gradient(135deg, var(--hub-primary), var(--hub-primary-light));
    color: white;
    box-shadow: 0 2px 8px rgba(20,78,118,0.3);
}
.hub-btn-primary:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(20,78,118,0.4); transform: translateY(-1px); color: white; }

.hub-btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.hub-btn-success:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(22,163,74,0.4); transform: translateY(-1px); color: white; }

.hub-btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}
.hub-btn-danger:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(239,68,68,0.3); transform: translateY(-1px); color: white; }

.hub-btn-outline {
    background: white;
    color: var(--hub-primary);
    border: 2px solid var(--hub-primary);
}
.hub-btn-outline:hover:not(:disabled) { background: var(--hub-primary); color: white; }

.hub-btn-secondary {
    background: #f1f5f9;
    color: var(--hub-text);
    border: 1px solid var(--hub-border);
}
.hub-btn-secondary:hover:not(:disabled) { background: #e2e8f0; color: var(--hub-text); }

.hub-btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.hub-btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }

.hub-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hub-border);
    margin-top: 1.5rem;
}

/* ===== DATA DISPLAY ===== */
.hub-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.hub-data-grid.single { grid-template-columns: 1fr; }
.hub-data-grid.triple { grid-template-columns: 1fr 1fr 1fr; }

.hub-data-item {
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
}
.hub-data-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--hub-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}
.hub-data-value {
    font-size: 0.95rem;
    color: var(--hub-text);
    font-weight: 500;
    word-break: break-word;
}
.hub-data-value.empty { color: #94a3b8; font-style: italic; }

/* ===== STATUS PANEL ===== */
.hub-status-panel {
    padding: 1.25rem 1.5rem;
    border-radius: var(--hub-radius-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.hub-status-panel.draft { background: #f1f5f9; border: 1px solid #cbd5e1; }
.hub-status-panel.pending { background: #fffbeb; border: 1px solid #fde68a; }
.hub-status-panel.approved { background: #f0fdf4; border: 1px solid #bbf7d0; }
.hub-status-panel.rejected { background: #fef2f2; border: 1px solid #fecaca; }

.hub-status-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.hub-status-panel.draft .hub-status-icon { background: #e2e8f0; color: #475569; }
.hub-status-panel.pending .hub-status-icon { background: #fde68a; color: #92400e; }
.hub-status-panel.approved .hub-status-icon { background: #bbf7d0; color: #166534; }
.hub-status-panel.rejected .hub-status-icon { background: #fecaca; color: #991b1b; }

.hub-status-text h4 { font-size: 0.95rem; font-weight: 600; margin: 0; }
.hub-status-text p { font-size: 0.82rem; color: var(--hub-text-muted); margin: 0.125rem 0 0; }

/* ===== LOGIN PAGE ===== */
.hub-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #cfe3f0 0%, #d9e9f5 50%, #cfe3f0 100%);
    padding: 1.5rem;
}

.hub-login-container {
    width: 100%;
    max-width: 520px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--hub-shadow-lg);
    overflow: hidden;
    border: 1px solid rgba(20,78,118,0.08);
}

.hub-login-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    background: linear-gradient(135deg, var(--hub-primary), var(--hub-primary-light));
    color: white;
}
.hub-login-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}
.hub-login-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.hub-login-header p { font-size: 0.9rem; opacity: 0.85; }

.hub-login-body { padding: 2rem; }
.hub-login-footer {
    text-align: center;
    padding: 1.25rem 2rem;
    background: #f8fafc;
    border-top: 1px solid var(--hub-border);
    font-size: 0.78rem;
    color: var(--hub-text-muted);
}

/* ===== DISCLAIMER ===== */
.hub-disclaimer-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.8;
}
.hub-disclaimer-content h4 { color: var(--hub-primary); margin-bottom: 0.75rem; font-size: 1rem; }
.hub-disclaimer-content p { margin-bottom: 0.75rem; }

.hub-disclaimer-accept {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--hub-radius-sm);
    margin-bottom: 1.5rem;
}
.hub-disclaimer-accept input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--hub-primary); cursor: pointer; }
.hub-disclaimer-accept label { font-weight: 600; font-size: 0.9rem; cursor: pointer; }

/* ===== ADMIN STATS ===== */
.hub-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.hub-stat-card {
    background: white;
    border-radius: var(--hub-radius);
    padding: 1.25rem;
    border: 1px solid var(--hub-border);
    text-align: center;
    transition: all 0.2s;
}
.hub-stat-card:hover { box-shadow: var(--hub-shadow-md); transform: translateY(-2px); }

.hub-stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--hub-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}
.hub-stat-label { font-size: 0.8rem; color: var(--hub-text-muted); font-weight: 500; }

/* ===== ADMIN TABLE ===== */
.hub-table-wrapper { overflow-x: auto; }

.hub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.hub-table th {
    background: #f8fafc;
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--hub-text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--hub-border);
}
.hub-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--hub-border);
    vertical-align: middle;
}
.hub-table tr:hover td { background: #f8fafc; }
.hub-table tr:last-child td { border-bottom: none; }

/* ===== ADMIN FILTERS ===== */
.hub-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--hub-border);
    flex-wrap: wrap;
}

.hub-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hub-filter-group label { font-size: 0.8rem; font-weight: 600; color: var(--hub-text-muted); white-space: nowrap; }

.hub-filter-select, .hub-filter-input {
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    font-size: 0.85rem;
    color: var(--hub-text);
    background: white;
    min-width: 160px;
}
.hub-filter-select:focus, .hub-filter-input:focus {
    outline: none;
    border-color: var(--hub-border-focus);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hub-osc-nav { padding: 0 1rem; }
    .hub-osc-main { padding: 1.25rem 1rem; }
    .hub-card-body { padding: 1.25rem; }
    .hub-card-header { padding: 1.25rem; }
    .hub-form-row { grid-template-columns: 1fr; }
    .hub-form-row.triple { grid-template-columns: 1fr; }
    .hub-data-grid { grid-template-columns: 1fr; }
    .hub-data-grid.triple { grid-template-columns: 1fr; }
    .hub-form-actions { flex-direction: column-reverse; }
    .hub-form-actions .hub-btn { width: 100%; }
    .hub-osc-user-info { display: none; }
    .hub-login-body { padding: 1.5rem; }
    .hub-admin-stats { grid-template-columns: 1fr 1fr; }
    .hub-filters { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
    .hub-osc-brand-text { display: none; }
    .hub-admin-stats { grid-template-columns: 1fr; }
}

/* ===== SPINNER ===== */
.hub-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: hub-spin 0.6s linear infinite;
}
@keyframes hub-spin { to { transform: rotate(360deg); } }

/* ===== PAGINATION ===== */
.hub-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1.25rem;
}
.hub-pagination a, .hub-pagination span {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--hub-text);
    border: 1px solid var(--hub-border);
    transition: all 0.2s;
}
.hub-pagination a:hover { background: var(--hub-primary); color: white; border-color: var(--hub-primary); }
.hub-pagination .active { background: var(--hub-primary); color: white; border-color: var(--hub-primary); }
.hub-pagination .disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== AUTO-SAVE INDICATOR ===== */
.hub-autosave-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--hub-text-muted);
    font-weight: 500;
}
.hub-autosave-indicator.saving { color: var(--hub-warning); }
.hub-autosave-indicator.saved { color: var(--hub-accent); }
.hub-autosave-indicator.error { color: var(--hub-danger); }
