/* =========================================================================
   IVCA | Evaluador de Ferias Académicas
   Design System alineado a IVCA (Azul #154ec1, Verde #00c853, Cyan #00b0ff)
   ========================================================================= */

:root {
    --primary: #154ec1;
    --primary-hover: #0e3b99;
    --primary-light: #eef4ff;
    --primary-border: rgba(21, 78, 193, 0.22);

    --success: #00b248;
    --success-hover: #00913a;
    --success-light: #e8f8ee;

    --cyan: #0099e6;
    --cyan-light: #e6f6ff;

    --warning: #d97706;
    --warning-light: #fef3c7;

    --danger: #dc2626;
    --danger-light: #fee2e2;

    --dark: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --border-light: #e2e8f0;

    --bg-page: #f4f7fb;
    --bg-card: #ffffff;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 6px 20px rgba(21, 78, 193, 0.09);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(21, 78, 193, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(0, 178, 72, 0.06) 0%, transparent 45%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* ==================== NAVBAR ==================== */
.app-navbar {
    background: linear-gradient(135deg, #154ec1 0%, #0d3a96 100%);
    color: #ffffff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 3px 14px rgba(13, 58, 150, 0.22);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
}

.navbar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    background: #ffffff;
    padding: 2px;
}

.navbar-title-wrap {
    display: flex;
    flex-direction: column;
}

.navbar-title {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.navbar-subtitle {
    font-size: 0.76rem;
    opacity: 0.85;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.role-pill {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.demo-banner {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #ffffff;
    text-align: center;
    padding: 8px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.demo-banner.active {
    display: flex;
}

.demo-banner button {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.demo-banner button:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ==================== LAYOUT ==================== */
.app-container {
    width: 100%;
    max-width: 1120px;
    margin: 24px auto 48px;
    padding: 0 16px;
    flex: 1;
}

.view-screen {
    display: none;
    animation: fadeSlide 0.25s ease-out;
}

.view-screen.active {
    display: block;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.card-subtle {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
}

/* ==================== HERO / HOME ==================== */
.hero-box {
    text-align: center;
    padding: 28px 16px 24px;
    max-width: 780px;
    margin: 0 auto 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero-box h1 {
    font-size: clamp(1.75rem, 3.6vw, 2.5rem);
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero-box h1 span {
    color: var(--primary);
}

.hero-box p {
    color: var(--text-muted);
    font-size: 1.02rem;
    max-width: 640px;
    margin: 0 auto;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.home-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.home-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 14px;
}

.icon-blue { background: var(--primary-light); color: var(--primary); }
.icon-green { background: var(--success-light); color: var(--success); }
.icon-cyan { background: var(--cyan-light); color: var(--cyan); }

.feature-list {
    list-style: none;
    margin: 14px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.93rem;
}

.feature-list li::before {
    content: "✓";
    color: var(--success);
    font-weight: 800;
    margin-right: 8px;
}

/* ==================== FORMS & INPUTS ==================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-label .req {
    color: var(--danger);
}

.form-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.96rem;
    color: var(--text-main);
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.input-code {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-full);
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(21, 78, 193, 0.22);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 178, 72, 0.24);
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
}

.btn-whatsapp:hover:not(:disabled) {
    background: #1ebe5b;
}

.btn-outline {
    background: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-light);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
}

.btn-soft {
    background: #f1f5f9;
    color: var(--text-main);
    border-color: var(--border-light);
}

.btn-soft:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-danger-soft {
    background: var(--danger-light);
    color: var(--danger);
    border-color: #fecaca;
}

.btn-danger-soft:hover:not(:disabled) {
    background: #fecaca;
}

/* ==================== WIZARD STEPPER ==================== */
.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.wizard-step {
    background: #f1f5f9;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s;
}

.wizard-step .step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.wizard-step.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.wizard-step.active .step-num {
    background: var(--primary);
}

.wizard-step.done {
    background: var(--success-light);
    border-color: var(--success);
    color: #0f763a;
}

.wizard-step.done .step-num {
    background: var(--success);
}

.wizard-pane {
    display: none;
}

.wizard-pane.active {
    display: block;
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.repeater-row {
    background: #f8fafc;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.repeater-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.repeater-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.quick-gen-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.quick-gen-bar input[type="number"] {
    width: 82px;
    padding: 8px 10px;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-align: center;
}

/* ==================== DASHBOARD HEADER & TABS ==================== */
.fair-header-card {
    background: linear-gradient(135deg, #0f172a 0%, #154ec1 100%);
    color: #ffffff;
    border: none;
    position: relative;
    overflow: hidden;
}

.fair-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.fair-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.meta-chip {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-activa { background: #dcfce7; color: #166534; }
.status-cerrada { background: #fee2e2; color: #991b1b; }
.status-pendiente { background: #fef3c7; color: #92400e; }

.tabs-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-bottom: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.18s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-pane {
    display: none;
}

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

/* ==================== KPI GRID & PODIUM ==================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    margin-top: 4px;
}

.kpi-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.podium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.podium-card {
    border-radius: var(--radius-md);
    padding: 18px;
    border: 2px solid var(--border-light);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.podium-1 { border-color: #f59e0b; background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%); }
.podium-2 { border-color: #94a3b8; background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%); }
.podium-3 { border-color: #d97706; background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%); }

.podium-rank {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
}

.podium-score {
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--primary);
}

/* ==================== TABLES ==================== */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.score-bar-track {
    width: 100%;
    min-width: 100px;
    height: 8px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 4px;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--cyan));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
    background: #e2e8f0;
    color: var(--dark);
}

.rank-1 { background: #fef3c7; color: #b45309; }
.rank-2 { background: #e2e8f0; color: #334155; }
.rank-3 { background: #ffedd5; color: #c2410c; }

.clickable-score {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
    border: 1px solid var(--primary-border);
    transition: all 0.15s;
}

.clickable-score:hover {
    background: var(--primary);
    color: #ffffff;
}

/* ==================== EVALUATOR SCORING UI ==================== */
.group-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.group-eval-card {
    background: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 18px;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.group-eval-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.group-eval-card.scored {
    border-left: 5px solid var(--success);
}

.group-eval-card.pending {
    border-left: 5px solid #f59e0b;
}

.criterion-score-box {
    background: #f8fafc;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
}

.criterion-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.criterion-name {
    font-weight: 800;
    color: var(--dark);
    font-size: 0.98rem;
}

.criterion-max-pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.criterion-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    white-space: pre-line;
}

.score-input-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.score-slider {
    flex: 1;
    min-width: 180px;
    accent-color: var(--primary);
    height: 8px;
    cursor: pointer;
}

.score-num-input {
    width: 92px;
    padding: 9px 10px;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    color: var(--primary);
}

.quick-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.quick-pill {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: #ffffff;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    min-width: 38px;
    transition: all 0.15s;
}

.quick-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.quick-pill.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.sticky-score-bar {
    position: sticky;
    bottom: 12px;
    background: #0f172a;
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-lg);
    margin-top: 18px;
}

.sticky-total {
    font-size: 1.25rem;
    font-weight: 900;
}

/* ==================== ACCESS LINKS LIST ==================== */
.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.link-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.link-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.code-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #0f172a;
    color: #38bdf8;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    letter-spacing: 1px;
    display: inline-block;
}

/* ==================== PRIVACY NOTICE ==================== */
.privacy-notice {
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    color: #1e3a8a;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* ==================== CRONÓMETRO EN VIVO (JURADO) ==================== */
.timer-bar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.timer-bar.timer-warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
}

.timer-bar.timer-expired {
    border-color: #ef4444;
    background: linear-gradient(135deg, #450a0a 0%, #991b1b 100%);
    animation: timerPulse 1.1s infinite alternate;
}

@keyframes timerPulse {
    from { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
    to { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.08); }
}

.timer-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    line-height: 1;
}

.timer-mode-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.timer-mode-btn {
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 5px 11px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.timer-mode-btn.active {
    background: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
}

.timer-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ==================== NÓMINA DE DEFENSA (INTEGRANTES) ==================== */
.roster-box {
    background: #f8fafc;
    border: 1.5px solid var(--primary-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 18px;
}

.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.roster-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.roster-item.checked {
    border-color: var(--success);
    background: var(--success-light);
}

.roster-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--success);
    flex-shrink: 0;
}

/* ==================== BANDAS DE CALIFICACIÓN DINÁMICAS ==================== */
.bands-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.band-chip {
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    border: 1.5px solid var(--border-light);
    background: #ffffff;
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: all 0.18s ease;
}

.band-chip strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.band-chip.band-excelente.matched {
    border-color: #16a34a;
    background: #dcfce7;
    color: #14532d;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.18);
}

.band-chip.band-bueno.matched {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1e3a8a;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}

.band-chip.band-regular.matched {
    border-color: #d97706;
    background: #fef3c7;
    color: #78350f;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}

.level-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.level-excelente { background: #dcfce7; color: #166534; }
.level-bueno { background: #dbeafe; color: #1e40af; }
.level-regular { background: #fef3c7; color: #92400e; }

/* Vista rápida de enlaces mágicos */
.link-url-preview {
    margin-top: 8px;
    width: 100%;
    padding: 7px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    background: #ffffff;
    border: 1px dashed var(--primary-border);
    border-radius: var(--radius-sm);
    color: var(--primary);
    word-break: break-all;
}

/* Ajuste UX: evitar solapamiento de barra flotante con Observaciones */
#form-submit-score {
    padding-bottom: 24px;
}

#eval-observaciones {
    margin-bottom: 12px;
}

.sticky-score-bar {
    z-index: 50;
}

/* ==================== IMPORTADOR WORD / PDF & CATEGORÍAS ==================== */
.import-dropzone {
    border: 2px dashed var(--primary);
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    margin-bottom: 14px;
}

.import-dropzone:hover,
.import-dropzone.dragover {
    background: #dbeafe;
    border-color: var(--primary-hover);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    background: var(--cyan-light);
    color: #0369a1;
    border: 1px solid rgba(3, 105, 161, 0.22);
    font-size: 0.74rem;
    font-weight: 800;
    margin-right: 6px;
    vertical-align: middle;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* ==================== BORRADOR LOCAL, COLA OFFLINE Y EDITOR DE INTEGRANTES ==================== */
.draft-banner {
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    color: #92400e;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.86rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.draft-banner.active {
    display: flex;
}

.offline-queue-banner {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1.5px solid #f97316;
    color: #9a3412;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.offline-queue-banner.active {
    display: flex;
}

.status-draft {
    background: #e0f2fe;
    color: #0369a1;
}

.status-queued {
    background: #ffedd5;
    color: #c2410c;
}

.member-editor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.member-editor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

.member-remove-btn {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.member-remove-btn:hover {
    background: #fecaca;
}

.member-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ==================== MODAL & TOAST ==================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1500;
}

.modal-backdrop.open {
    display: flex;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: fadeSlide 0.2s ease-out;
}

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

.modal-close {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-main);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(90px);
    background: #0f172a;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.28s ease;
    max-width: 92vw;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }

/* ==================== FOOTER ==================== */
.app-footer {
    text-align: center;
    padding: 20px 16px;
    color: var(--text-muted);
    font-size: 0.84rem;
    border-top: 1px solid var(--border-light);
    background: #ffffff;
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

/* ==================== PRINT / ACTA CONSOLIDADA ==================== */
#print-acta-container {
    display: none;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .app-navbar,
    .demo-banner,
    .app-container,
    .app-footer,
    .modal-backdrop,
    .toast {
        display: none !important;
    }
    #print-acta-container {
        display: block !important;
        padding: 12px;
        font-family: Arial, Helvetica, sans-serif;
        color: #000000;
    }
    .acta-header {
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 14px;
    }
    .acta-header h1 { font-size: 16pt; margin-bottom: 4px; }
    .acta-header h2 { font-size: 12pt; font-weight: normal; margin-bottom: 4px; }
    .acta-meta {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
        font-size: 9.5pt;
        margin-bottom: 12px;
    }
    .acta-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
        margin-bottom: 24px;
    }
    .acta-table th, .acta-table td {
        border: 1px solid #333;
        padding: 6px 8px;
        text-align: left;
    }
    .acta-table th {
        background: #eef2f7 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .acta-signatures {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 24px;
        margin-top: 42px;
        page-break-inside: avoid;
    }
    .acta-sig-box {
        text-align: center;
        font-size: 9pt;
    }
    .acta-sig-line {
        border-top: 1px solid #000;
        margin-bottom: 6px;
        height: 40px;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 860px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .podium-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .wizard-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    .bands-strip {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 18px 16px;
    }
    .app-navbar {
        padding: 10px 14px;
    }
    .navbar-subtitle {
        display: none;
    }
}
