/* ====================================================
   PANEL DOCENTE
   ==================================================== */

/* ════════════════════════════════════════════════════
   DASHBOARD — diseño moderno con tonalidades azules
   ════════════════════════════════════════════════════ */

/* ── Hero ── */
.dash-hero {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1d4ed8 100%);
    border-radius: 20px;
    padding: 36px 40px;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15,23,42,0.3);
}

.dash-hero-orb {
    position: absolute;
    top: -60px; right: -60px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.25) 0%, transparent 70%);
    pointer-events: none;
}

.dash-hero-content {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.dash-hero-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 6px;
}

.dash-hero-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    color: #f0f9ff;
    line-height: 1.1;
}

.dash-hero-sub {
    margin: 0;
    font-size: 14px;
    color: #93c5fd;
}

.dash-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-dash-primary {
    background: #3b82f6;
    color: #fff;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
    display: inline-block;
    font-family: inherit;
    white-space: nowrap;
}
.btn-dash-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    color: #fff;
}

.btn-dash-outline {
    background: rgba(255,255,255,0.08);
    color: #bfdbfe;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(147,197,253,0.3);
    cursor: pointer;
    transition: background 0.15s;
    display: inline-block;
    font-family: inherit;
    white-space: nowrap;
}
.btn-dash-outline:hover {
    background: rgba(255,255,255,0.14);
    color: #e0f2fe;
}

/* ── KPI Cards ── */
.dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.dash-kpi-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 12px rgba(15,23,42,0.07);
    border: 1px solid #e0eaf5;
    transition: box-shadow 0.15s, transform 0.15s;
    position: relative;
    overflow: hidden;
}
.dash-kpi-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}
.dash-kpi-blue::before   { background: linear-gradient(90deg,#1d4ed8,#60a5fa); }
.dash-kpi-indigo::before { background: linear-gradient(90deg,#4a2178,#9b7bc4); }
.dash-kpi-sky::before    { background: linear-gradient(90deg,#0891b2,#38bdf8); }

.dash-kpi-card:hover {
    box-shadow: 0 8px 28px rgba(15,23,42,0.12);
    transform: translateY(-2px);
}

.dash-kpi-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dash-kpi-blue   .dash-kpi-icon { background:#eff6ff; color:#1d4ed8; }
.dash-kpi-indigo .dash-kpi-icon { background:#f3eefa; color:#4a2178; }
.dash-kpi-sky    .dash-kpi-icon { background:#f0f9ff; color:#0891b2; }

.dash-kpi-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-kpi-num {
    font-size: 36px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.dash-kpi-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* ── Módulos row ── */
.dash-modulos-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dash-mod-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 2px 10px rgba(15,23,42,0.06);
    border: 1px solid #e0eaf5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-mod-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-mod-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-mod-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #475569;
}

.dash-mod-score {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.dash-mod-num {
    font-size: 34px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
}

.dash-mod-pct {
    font-size: 16px;
    font-weight: 700;
    color: #64748b;
}

.dash-mod-nd {
    font-size: 30px;
    font-weight: 800;
    color: #cbd5e1;
}

.dash-mod-bar-bg {
    height: 6px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}

.dash-mod-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}

.dash-mod-caption {
    font-size: 11px;
    color: #94a3b8;
}

/* ── Sections / Cards ── */
.dash-card {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(15,23,42,0.07);
    border: 1px solid #e0eaf5;
    overflow: hidden;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.dash-card-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-card-accent {
    width: 4px;
    height: 22px;
    border-radius: 99px;
    background: linear-gradient(180deg, #1d4ed8, #60a5fa);
    flex-shrink: 0;
}

.dash-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.dash-card-badge {
    font-size: 11px;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 3px 10px;
}

/* ── Dashboard table overrides ── */
.dash-table {
    margin: 0;
}
.dash-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 11px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.dash-table tbody td {
    padding: 13px 20px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
    color: #1e293b;
    font-size: 14px;
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover td { background: #f8fafc; }

/* ── Dashboard specific elements ── */
.dash-student-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-caso-titulo { color: #0f172a; font-size: 14px; }
.dash-caso-cell   { color: #475569; font-size: 13px; max-width: 180px; }

.dash-count-pill {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 700;
}

.dash-score-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-score-bar-bg {
    flex: 1;
    height: 7px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
    min-width: 80px;
}

.dash-score-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}
.fill-alta  { background: linear-gradient(90deg, #16a34a, #4ade80); }
.fill-media { background: linear-gradient(90deg, #d97706, #fbbf24); }
.fill-baja  { background: linear-gradient(90deg, #dc2626, #f87171); }

.dash-score-val {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .dash-modulos-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .dash-kpi-row      { grid-template-columns: repeat(2, 1fr); }
    .dash-modulos-row  { grid-template-columns: repeat(2, 1fr); }
    .dash-hero         { padding: 24px 20px; }
    .dash-hero-title   { font-size: 22px; }
    .dash-hero-content { flex-direction: column; }
}
@media (max-width: 540px) {
    .dash-kpi-row     { grid-template-columns: 1fr; }
    .dash-modulos-row { grid-template-columns: 1fr; }
}

/* ── Nav ── */
.nav-docente {
    background: #0f3d5e;
    color: #fff !important;
    padding: 5px 14px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
}
.nav-docente:hover { background: #1a5276; }

.nav-usuario {
    font-size: 13px;
    color: #66788a;
    padding: 0 8px;
}

/* ── Page header ── */
.doc-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 2px solid #d9e2ec;
}
.doc-page-header h1 { margin: 0 0 4px; font-size: 24px; color: #0f3d5e; }
.doc-page-header p  { margin: 0; color: #66788a; font-size: 14px; }
.doc-header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── Buttons ── */
.btn-doc-principal {
    background: #0f3d5e; color: #fff;
    padding: 8px 20px; border-radius: 6px;
    font-weight: bold; font-size: 14px;
    text-decoration: none; border: none; cursor: pointer;
    display: inline-block; transition: background .15s;
}
.btn-doc-principal:hover { background: #1a5276; color: #fff; }

.btn-doc-secundario {
    background: #eef5fb; color: #0f3d5e;
    padding: 8px 16px; border-radius: 6px;
    font-size: 14px; border: 1.5px solid #8fc5df;
    text-decoration: none; cursor: pointer;
    display: inline-block; transition: background .15s;
}
.btn-doc-secundario:hover { background: #d9edf8; }

.btn-doc-xs {
    background: #eef5fb; color: #0f3d5e;
    padding: 4px 10px; border-radius: 4px;
    font-size: 12px; border: 1px solid #8fc5df;
    text-decoration: none; cursor: pointer; display: inline-block;
    transition: background .15s;
}
.btn-doc-xs:hover { background: #d9edf8; }

.btn-toggle-off { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.btn-toggle-off:hover { background: #fecaca; }
.btn-toggle-on  { background: #dcfce7; color: #14532d; border-color: #86efac; }
.btn-toggle-on:hover  { background: #bbf7d0; }

.btn-doc-guardar {
    background: #1f9d55; color: #fff;
    padding: 10px 28px; border-radius: 6px;
    font-weight: bold; font-size: 15px;
    border: none; cursor: pointer; transition: background .15s;
}
.btn-doc-guardar:hover { background: #17874a; }

/* ── Zona de eliminación del caso ── */
.doc-danger-zone {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    flex-wrap: wrap;
    margin: 24px 0 8px; padding: 16px 20px;
    background: #fef2f2; border: 1px solid #f3c8c4; border-radius: 10px;
}
.doc-danger-zone strong { color: #b3261e; font-size: 15px; }
.doc-danger-zone p { margin: 3px 0 0; font-size: 13px; color: #7f1d1d; max-width: 62ch; }
.btn-doc-eliminar {
    background: #b3261e; color: #fff;
    padding: 10px 22px; border-radius: 6px;
    font-weight: bold; font-size: 14px; white-space: nowrap;
    border: none; cursor: pointer; transition: background .15s;
}
.btn-doc-eliminar:hover { background: #8f1c16; }

/* ── Stats grid ── */
.doc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.doc-stat-card {
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    display: flex; flex-direction: column; gap: 6px;
}
.doc-stat-num {
    font-size: 36px; font-weight: bold; color: #0f3d5e; line-height: 1;
}
.doc-stat-num small { font-size: 18px; }
.doc-stat-label { font-size: 13px; color: #66788a; }

.modulo-audio    { border-top: 4px solid #dc2626; }
.modulo-timpa    { border-top: 4px solid #2563eb; }
.modulo-reflejos { border-top: 4px solid #16a34a; }

/* ── Sections ── */
.doc-section {
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}
.doc-section h2 {
    margin: 0 0 16px;
    font-size: 17px;
    color: #0f3d5e;
    border-bottom: 1px solid #d9e2ec;
    padding-bottom: 10px;
}
.doc-empty {
    color: #94a3b8; font-style: italic;
    text-align: center; padding: 20px 0;
}

/* ── Tables ── */
.doc-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
.doc-table th {
    background: #eef5fb; color: #0f3d5e;
    padding: 10px 12px; text-align: left;
    border-bottom: 2px solid #c8dce9; font-size: 13px;
}
.doc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f4f8;
    vertical-align: middle;
}
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr:hover td { background: #f7fbfe; }
.row-inactivo td { opacity: .55; }
.col-id       { width: 40px; color: #94a3b8; }
.acciones-col { white-space: nowrap; }
.fecha-col    { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.text-muted   { color: #94a3b8; font-size: 13px; }
.col-group    { text-align: center; border-bottom: 2px solid #c8dce9; }
.subheader th { font-size: 12px; color: #66788a; background: #f7fbfe; }

/* ── Badges ── */
.dif-badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 12px; font-size: 12px; font-weight: bold;
}
.dif-básico     { background: #dcfce7; color: #14532d; }
.dif-intermedio { background: #fef3c7; color: #78350f; }
.dif-avanzado   { background: #fee2e2; color: #991b1b; }

.mod-badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 10px; font-size: 11px; font-weight: bold; margin: 1px;
}
.mod-audiometría  { background: #fee2e2; color: #991b1b; }
.mod-timpanometría { background: #dbeafe; color: #1e40af; }
.mod-reflejos     { background: #dcfce7; color: #14532d; }
.mod-bera         { background: #ede9fe; color: #4a2178; }
.mod-oae          { background: #e0f2fe; color: #0e7490; }

.estado-badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 12px; font-size: 12px; font-weight: bold;
}
.badge-activo   { background: #dcfce7; color: #14532d; }
.badge-inactivo { background: #f3f4f6; color: #6b7280; }

.score-pill {
    display: inline-block; padding: 2px 10px;
    border-radius: 12px; font-size: 13px; font-weight: bold;
}
.pill-verde   { background: #dcfce7; color: #14532d; }
.pill-naranja { background: #fef3c7; color: #78350f; }
.pill-rojo    { background: #fee2e2; color: #991b1b; }

.score-bar-wrap { display: flex; align-items: center; gap: 8px; }
.score-bar {
    height: 8px; background: #1f9d55;
    border-radius: 4px; min-width: 4px;
}

/* ── Form ── */
.doc-form { display: flex; flex-direction: column; gap: 0; }

.form-grid-2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-full { grid-column: 1 / -1; }

.form-grupo { display: flex; flex-direction: column; gap: 6px; }
.form-grupo label { font-size: 13px; font-weight: bold; color: #0f3d5e; }
.form-grupo input[type=text],
.form-grupo input[type=number],
.form-grupo select,
.form-grupo textarea {
    padding: 8px 12px; border: 1.5px solid #c8dce9;
    border-radius: 6px; font-size: 14px; color: #1f2933;
    background: #fff; width: 100%;
}
.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus { outline: none; border-color: #0f3d5e; }

.doc-subtitulo { font-size: 13px; color: #66788a; margin: 0 0 16px; }

/* ── Tabs ── */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #c8dce9;
    margin-bottom: 24px;
    overflow-x: auto;
}
.tab-btn {
    padding: 10px 20px; font-size: 14px; font-weight: bold;
    border: none; background: none; cursor: pointer;
    color: #66788a; border-bottom: 3px solid transparent;
    margin-bottom: -2px; white-space: nowrap;
    transition: color .15s;
}
.tab-btn.activo { color: #0f3d5e; border-bottom-color: #0f3d5e; }
.tab-btn:hover  { color: #0f3d5e; }

.tab-panel { animation: fadeIn .15s; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.tab-footer {
    display: flex; justify-content: flex-end; gap: 12px;
    margin-top: 24px; padding-top: 16px;
    border-top: 1px solid #d9e2ec;
}

/* ── Audiometry grid ── */
.umbral-tabla-wrap { overflow-x: auto; margin-bottom: 12px; }
.umbral-tabla {
    border-collapse: collapse; font-size: 14px; min-width: 520px;
}
.umbral-tabla th {
    background: #eef5fb; padding: 8px 14px;
    border: 1px solid #c8dce9; text-align: center; font-size: 13px;
}
.umbral-tabla th.sub {
    background: #f7fbfe; font-size: 12px; color: #66788a; font-weight: normal;
}
.umbral-tabla td { border: 1px solid #e0ecf4; padding: 4px; }
.freq-label {
    text-align: right; padding: 6px 12px;
    font-weight: bold; color: #0f3d5e; font-size: 13px;
}
.umbral-cell { text-align: center; }
.col-od { background: #fff5f5; }
.col-oi { background: #eff6ff; }
.cell-osea   { background: #fafafa; }
.cell-ausente{ background: inherit; }

.umbral-input {
    width: 72px; padding: 5px 4px; text-align: center;
    border: 1.5px solid #c8dce9; border-radius: 4px;
    font-size: 14px; font-weight: bold;
}
.inp-od { color: #dc2626; border-color: #fca5a5; }
.inp-od:focus { border-color: #dc2626; outline: none; }
.inp-oi { color: #2563eb; border-color: #93c5fd; }
.inp-oi:focus { border-color: #2563eb; outline: none; }

.umbral-leyenda {
    display: flex; gap: 20px; font-size: 12px;
    color: #66788a; flex-wrap: wrap; margin-top: 4px;
}

/* ── Tympanometry form ── */
.timpa-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.timpa-col h3 { margin: 0 0 16px; font-size: 16px; }
.timpa-detalle { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

/* ── Reflex: ausente checkbox ── */
.check-ausente {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; cursor: pointer; white-space: nowrap;
    padding: 4px;
}
.check-ausente input { cursor: pointer; }

/* ── Responsive ── */
@media (max-width: 700px) {
    .form-grid-2    { grid-template-columns: 1fr; }
    .timpa-grid     { grid-template-columns: 1fr; }
    .doc-page-header{ flex-direction: column; }
    .doc-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
