/* Encuentro v2 - Unified Stylesheet */

/* ======================== VARIABLES ======================== */
:root {
    --primary: #ab0033;
    --primary-dark: #8a0029;
    --accent: #bc955c;
    --accent-light: #d4b07a;
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --sidebar-width: 280px;
    --header-height: 56px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --transition: all 0.2s ease;
}

/* ======================== RESET & BASE ======================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

.main-content {
    flex: 1;
    padding: 2rem 1rem;
}

/* ======================== TYPOGRAPHY ======================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary);
    font-weight: 700;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

/* ======================== CARDS ======================== */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--shadow);
}
.card-header {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 1.25rem;
    border-bottom: none;
}
.card-body {
    padding: 1.5rem;
}

/* ======================== FORMS ======================== */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}
.form-control, .form-select {
    border-radius: var(--radius);
    border: 1.5px solid var(--border-color);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(171, 0, 51, 0.1);
}
.form-control.is-invalid {
    border-color: var(--danger);
}
.invalid-feedback {
    font-size: 0.8rem;
}

.input-group {
    border-radius: var(--radius);
    overflow: hidden;
}
.input-group .input-group-text {
    background: var(--bg-body);
    border: 1.5px solid var(--border-color);
    border-right: none;
    color: var(--text-muted);
    min-width: 42px;
    justify-content: center;
}
.input-group .form-control {
    border-left: none;
}
.input-group .form-control:focus + .input-group-text,
.input-group .form-control:focus ~ .input-group-text {
    border-color: var(--primary);
}

/* ======================== BUTTONS ======================== */
.btn {
    border-radius: var(--radius);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    transition: var(--transition);
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background: #a8834d;
    border-color: #a8834d;
    color: #fff;
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ======================== LOGIN ======================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1rem;
}
.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: 480px;
}
.login-header {
    background: #fff;
    color: var(--primary);
    padding: 2rem;
    text-align: center;
}
.login-header img {
    max-width: 180px;
    margin-bottom: 1rem;
}
.login-header h2 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}
.login-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}
.login-body {
    padding: 2rem;
}
.login-footer {
    padding: 1rem 2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}
.login-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ======================== SIDEBAR (Internal) ======================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
    padding-top: 0;
}
.sidebar-brand {
    padding: 1.25rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand img {
    max-width: 120px;
}
.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--accent);
}
.sidebar-nav li a i {
    width: 24px;
    margin-right: 0.75rem;
    text-align: center;
}
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ======================== PROGRESS STEPS ======================== */
.progress-steps-bar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    box-shadow: var(--shadow-sm);
}
.progress-steps-bar .progress-step {
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}
.progress-steps-bar .progress-step:hover {
    transform: translateY(-2px);
}
.progress-steps {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
    align-items: flex-start;
    position: relative;
}
.progress-steps .progress-step-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.progress-steps .progress-step-wrapper:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.25rem;
    vertical-align: middle;
    flex-shrink: 0;
    margin-top: 18px;
}
.progress-steps .progress-step-wrapper.completed:not(:last-child)::after {
    background: var(--success);
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 80px;
    text-decoration: none !important;
}
.progress-step .step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    border: 2px solid var(--border-color);
    background: #fff;
    color: var(--text-muted);
    transition: var(--transition);
}
.progress-step.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.progress-step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.progress-step span {
    text-align: center;
    max-width: 80px;
}

/* ======================== EQUIPO TABS (Sub-nav pills) ======================== */
.equipo-tabs-nav {
    padding: 0.5rem 0;
}
.equipo-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.equipo-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1.1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 130px;
    justify-content: center;
    color: var(--text-muted);
    background: var(--bg-body);
    border: 1.5px solid var(--border-color);
    text-decoration: none !important;
    transition: var(--transition);
}
.equipo-tab:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(171, 0, 51, 0.04);
}
.equipo-tab.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.equipo-tab.completed {
    color: var(--success);
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.06);
}
.equipo-tab.completed i {
    color: var(--success);
}
.equipo-tab.active i {
    color: rgba(255,255,255,0.9);
}
.equipo-tab:not(.completed):not(.active) i {
    color: var(--text-muted);
}

@media (max-width: 575.98px) {
    .equipo-tab {
        padding: 0.35rem 0.75rem;
        min-width: unset;
        font-size: 0.8rem;
    }
}

/* ======================== BADGES ======================== */
.badge-status {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
    border-radius: 4px;
}
.badge-pending {
    background: #fff3cd;
    color: #856404;
}
.badge-complete {
    background: #d4edda;
    color: #155724;
}

/* ======================== FILE UPLOAD ======================== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-body);
}
.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(171, 0, 51, 0.02);
}
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(171, 0, 51, 0.05);
}
.upload-zone i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.upload-zone p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

/* ======================== TABLES ======================== */
.table {
    font-size: 0.9rem;
}
.table thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.75rem;
    white-space: nowrap;
    border-bottom: none;
}
.table tbody td {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}
.table-responsive {
    border-radius: var(--radius);
    overflow: hidden;
}

/* ======================== UTILITIES ======================== */
.bg-primary { background: var(--primary) !important; }
.bg-accent { background: var(--accent) !important; }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }

.glow-primary {
    box-shadow: 0 0 0 3px rgba(171, 0, 51, 0.15);
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1039;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-content {
        padding: 1.5rem 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .login-body {
        padding: 1.25rem;
    }
    .progress-steps {
        gap: 0.25rem;
    }
    .progress-step {
        min-width: 60px;
    }
    .progress-step .step-circle {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    .card-body {
        padding: 1rem;
    }
}

/* ======================== PRINT ======================== */
@media print {
    .sidebar, .navbar, .footer, .btn, .no-print {
        display: none !important;
    }
    .main-content {
        padding: 0;
        margin: 0;
    }
    body {
        background: #fff;
    }
}
