/* ===== VARIÁVEIS E RESETS ===== */
:root {
    --light-red: #ffcccc;
    --light-blue: #cce5ff;
    --light-green: #d4edda;
    --light-yellow: #fff3cd;
    --light-orange: #ffe5cc;
    --pastel-bg: #f8f9fa;
    --primary: #2c3e50;
    --secondary: #4a6580;
    --accent: #3498db;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--pastel-bg);
    color: #333;
    line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL ===== */

#logomarca {
    display: block;
    max-width: 400px;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px 0;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 20px;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-help {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    line-height: 1.4;
}

.form-help strong {
    color: var(--primary);
}

/* ===== BOTÕES ===== */
button {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    margin: 5px;
}

button:hover {
    background-color: var(--primary);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1c6ea4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c757d);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    background: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #2980b9;
}

.btn-small.btn-edit {
    background: #f39c12;
}

.btn-small.btn-edit:hover {
    background: #d68910;
}

.btn-save {
    background: linear-gradient(135deg, #27ae60, #219653);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-save:hover {
    background: linear-gradient(135deg, #219653, #1e8749);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

/* ===== ABAS ===== */
.tab-container {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.tab.active {
    border-bottom: 3px solid var(--secondary);
    font-weight: bold;
}

.tab-content {
    display: none;
}

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

/* ===== LAYOUTS ===== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hidden {
    display: none;
}

.stock-admin-card {
    padding: 28px;
}

.stock-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.stock-admin-layout {
    display: grid;
    grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
    gap: 24px;
}

.stock-form-panel,
.stock-list-panel {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 20px;
}

.stock-photo-uploader {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.stock-photo-preview-shell {
    width: 132px;
    height: 132px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px dashed #93c5fd;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stock-photo-preview,
.stock-item-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stock-photo-fallback,
.stock-item-photo-placeholder {
    color: #64748b;
    font-weight: 600;
    text-align: center;
    padding: 12px;
}

.stock-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stock-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.stock-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 110px;
    font-family: inherit;
}

.stock-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.inventory-status {
    min-height: 24px;
    font-size: 14px;
    margin-bottom: 10px;
}

.inventory-status.is-success {
    color: #15803d;
}

.inventory-status.is-error {
    color: #b91c1c;
}

.stock-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stock-summary-card {
    border-radius: 14px;
    background: white;
    border: 1px solid #dbeafe;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stock-summary-card strong {
    font-size: 22px;
    color: var(--primary);
}

.stock-summary-card span {
    color: #64748b;
    font-size: 13px;
}

.stock-items-list {
    display: grid;
    gap: 14px;
}

.stock-item-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: white;
    border: 1px solid #dbeafe;
}

.stock-item-photo-wrap {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    overflow: hidden;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stock-item-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.stock-item-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.stock-item-header h4 {
    margin: 0 0 6px;
    color: var(--primary);
}

.stock-item-header p {
    margin: 0;
    color: #64748b;
}

.stock-item-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: #475569;
    font-size: 14px;
}

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

.admin-partners-modal.hidden {
    display: none;
}

.admin-partners-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
}

.admin-partners-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
}

.admin-partners-card {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    margin: 20px auto;
    background: white;
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.admin-partners-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 28px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #1e3a5f, #45617f);
    color: white;
}

.admin-partners-close {
    background: rgba(255,255,255,.14);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.admin-partners-toolbar {
    display: flex;
    gap: 10px;
    padding: 18px 28px 0;
    flex-wrap: wrap;
}

.admin-partners-toolbar input {
    flex: 1 1 320px;
    min-width: 240px;
}

.admin-partners-list {
    padding: 20px 28px 28px;
    overflow: auto;
    display: grid;
    gap: 16px;
}

.admin-partner-card {
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 18px;
    background: #fbfdff;
    display: grid;
    gap: 16px;
}

.admin-partner-card-header {
    display: flex;
    gap: 14px;
    align-items: center;
}

.admin-partner-avatar {
    width: 66px;
    height: 66px;
    border-radius: 18px;
    overflow: hidden;
    background: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-partner-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-partner-avatar-fallback {
    color: #0f172a;
    font-weight: 700;
    font-size: 22px;
}

.admin-partner-identity h4 {
    margin: 0 0 4px;
    color: var(--primary);
}

.admin-partner-identity p {
    margin: 0 0 10px;
    color: #64748b;
}

.admin-partner-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-partner-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.admin-partner-details-grid div {
    background: white;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 12px;
    display: grid;
    gap: 6px;
}

.admin-partner-details-grid strong,
.admin-partner-notes strong {
    color: var(--primary);
    font-size: 13px;
}

.admin-partner-details-grid span,
.admin-partner-notes p {
    color: #475569;
    margin: 0;
}

.admin-partner-notes {
    border: 1px solid #dbeafe;
    background: white;
    border-radius: 14px;
    padding: 14px;
    display: grid;
    gap: 8px;
}

/* ===== AUDIOGRAMA ===== */
/* Garante que o canvas ocupe toda a área do container */
.audiogram-container {
    position: relative;
    height: 560px;
    min-height: 560px;
}

.audiogram-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}


.audiograms-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 20px 0;
}

.audiogram-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.audiogram-box h4 {
    text-align: center;
    margin-bottom: 18px;
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
}

.audiogram-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
    min-width: 600px;
}

.audiogram-table th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #dee2e6;
}

.audiogram-table th.ear-header {
    background: linear-gradient(135deg, #34495e, #546e7a);
    font-size: 15px;
}

.audiogram-table td {
    padding: 10px 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.audiogram-table td.frequency-cell {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--primary);
}

.audiogram-input {
    width: 80px;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
}

.audiogram-input:focus {
    border-color: var(--accent);
    background: #f8fdff;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.audiogram-input:not([value=""]) {
    border-color: #27ae60;
    background-color: #f8fff8;
}

.audiogram-input::placeholder {
    color: #adb5bd;
    font-size: 12px;
}

.audiogram-table tr:nth-child(even) {
    background: #f8f9fa;
}

.audiogram-table tr:hover {
    background: #e3f2fd;
}

.audiogram-symbol {
    font-size: 18px;
    font-weight: bold;
}

.symbol-air-right {
    color: #e74c3c;
}

.symbol-bone-right {
    color: #e74c3c;
    font-weight: bold;
}

.symbol-air-left {
    color: #3498db;
}

.symbol-bone-left {
    color: #3498db;
    font-weight: bold;
}

/* ===== LEGENDAS ===== */
.audiogram-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.legend-symbol {
    font-size: 16px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.masked-symbol {
    font-size: 18px;
}

.symbol-no-response {
    color: #2c3e50;
}

.notation-panel {
    margin-top: 16px;
}

.notation-panel h4 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 15px;
}

.notation-table-wrap {
    margin: 0;
}

.audiogram-notation-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.audiogram-notation-table th,
.audiogram-notation-table td {
    border-bottom: 1px solid #e9ecef;
    padding: 10px 8px;
    text-align: center;
    font-size: 13px;
}

.audiogram-notation-table th:first-child,
.audiogram-notation-table td:first-child {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.audiogram-notation-table tbody tr:last-child td {
    border-bottom: none;
}

.audiogram-flag {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.color-air-right { background-color: #e74c3c; }
.color-bone-right { color: #e74c3c; }
.color-air-left { background-color: #3498db; }
.color-bone-left { color: #3498db; }

/* ===== IMPEDANCIOMETRIA ===== */
.impedance-charts-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 20px 0;
}

.impedance-chart-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    height: 350px;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.5s ease;
}

.impedance-chart-box h4 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f3f4;
    flex-shrink: 0;
}

.impedance-chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    flex-grow: 1;
    min-height: 250px;
}

#timpanogram-results-right, 
#timpanogram-results-left {
    width: 100%;
    height: 100%;
    display: block;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    height: 380px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--primary);
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
    font-size: 16px;
    flex-shrink: 0;
}

#timpanogram-right, 
#timpanogram-left {
    width: 100%;
    height: 300px;
    flex-grow: 1;
}

#impedance-results-section {
    display: block !important;
}

.impedance-ear-section {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

#ouvido-direito {
    color: red;
}

#ouvido-esq {
    color: blue;
}

/* Estados da Impedanciometria */
.impedance-normal {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 5px solid #28a745;
    color: #155724;
}

.impedance-alterado-leve {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 5px solid #ffc107;
    color: #856404;
}

.impedance-alterado-moderado {
    background: linear-gradient(135deg, #ffe5cc, #ffd8a8);
    border-left: 5px solid #fd7e14;
    color: #8a2c0d;
}

.impedance-alterado-grave {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-left: 5px solid #dc3545;
    color: #721c24;
}

.impedance-indefinido {
    background: linear-gradient(135deg, #e2e3e5, #d6d8db);
    border-left: 5px solid #6c757d;
    color: #383d41;
}

.normal { 
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.alterado-leve { 
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.alterado-moderado { 
    border-left: 4px solid #fd7e14;
    background: linear-gradient(135deg, #ffe5cc, #ffd8a8);
}

.alterado-grave { 
    border-left: 4px solid #dc3545;
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.indefinido {
    border-left: 4px solid #6c757d;
    background: linear-gradient(135deg, #e2e3e5, #d6d8db);
}

/* ===== LOGOAUDIOMETRIA ===== */
.logoaudiometry-container {
    margin: 20px 0;
}

.logoaudiometry-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    

}

.logoaudiometry-box {
    min-width: 200px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.logoaudiometry-title-direito {
    color: red;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid red;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.logoaudiometry-title-esquerdo {
    color: blue;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid blue;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.logoaudiometry-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.logoaudiometry-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.logoaudiometry-label {
    min-width: 80px;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
    text-align: right;
}

.logoaudiometry-input-container {
    flex: 1;
    display: flex;
    max-width: 200px;
}

.logoaudiometry-input {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    text-align: center;
    transition: border-color 0.3s;
}

.logoaudiometry-input:focus {
    border-color: var(--accent);
    outline: none;
}

.logoaudiometry-unit {
    background: #f8f9fa;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-left: none;
    border-radius: 0 4px 4px 0;
    color: #6c757d;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

/* Resultados Logoaudiometria */
.logoaudiometry-results {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logoaudiometry-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.professional-observations-box {
    background: white;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    padding: 18px;
}

.professional-observations-box label {
    display: block;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.professional-observations-box textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 14px;
    font: inherit;
    line-height: 1.5;
    color: #1f2937;
    background: #fcfdff;
}

.professional-observations-box textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(164, 22, 102, 0.12);
}

.logoaudiometry-result-card {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--accent);
}

.logoaudiometry-result-item {
    margin: 10px 0;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.logoaudiometry-result-label {
    font-weight: 600;
    color: var(--primary);
    display: inline-block;
    min-width: 100px;
}

.logoaudiometry-result-value {
    color: var(--accent);
    font-weight: bold;
}

.weber-result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.weber-result-item {
    text-align: center;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 6px;
    border: 1px solid #bbdefb;
}

.weber-frequency {
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 5px;
}

.weber-value {
    font-size: 16px;
    font-weight: bold;
    color: #0d47a1;
}

/* ===== SEÇÕES DE RESULTADOS ===== */
.results-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 5px solid var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-section h3 {
    color: var(--primary);
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
}

.results-container {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.unified-report {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.result-item {
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid;
}

.result-value {
    font-weight: bold;
    font-size: 16px;
    display: block;
    margin-top: 5px;
}

.analysis-note {
    font-style: italic;
    color: #6c757d;
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
}


.reflex-table-section h4 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

.reflex-table-complete {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 13px;
    min-width: 1200px;
}

/* Headers principais e secundários */
.reflex-table-complete thead tr:first-child th {
    padding: 14px 10px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #e0e0e0;
    background-color: #f5f5f5;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Células de dados - cores de fundo por ouvido */
.reflex-table-complete td {
    padding: 12px 10px;
    border: 1px solid #ecf0f1;
    text-align: center;
    height: auto;
    vertical-align: middle;
}


.reflex-input {
    width: 100%;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
}

.reflex-input:focus {
    border-color: var(--accent);
    background: #f8fdff;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.reflex-input.diff {
    background: #f8f9fa;
    color: #6c757d;
    font-style: italic;
    cursor: not-allowed;
}

.reflex-input::placeholder {
    color: #adb5bd;
    font-size: 12px;
}

.reflex-table-complete tr:nth-child(even) {
    background: #f8f9fa;
}

.reflex-table-complete tr:hover {
    background: #e3f2fd;
}

/* ===== EXAME ===== */
.exam-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.exam-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.section-description {
    color: #6c757d;
    font-style: italic;
    margin-bottom: 15px;
    font-size: 14px;
}

/* ===== RECOMENDAÇÕES ===== */
.recommendations-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.recommendations-section h4 {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.recommendations-section h6 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.recommendations-section ul {
    padding-left: 20px;
    margin: 10px 0;
}

.recommendations-section li {
    margin: 8px 0;
    padding: 5px 0;
    color: #495057;
}

.recommendations-section p {
    margin: 5px 0;
    padding: 5px 0;
    font-size: 13px;
    color: #495057;
}

/* ===== IMPEDÂNCIA AVANÇADA ===== */
.impedance-results-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--accent);
}

.impedance-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.impedance-ear-result {
    padding: 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.impedance-ear-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.impedance-summary {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.impedance-summary strong {
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
}

.impedance-summary small {
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
}

.impedance-details {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.impedance-details div {
    margin: 8px 0;
    padding: 8px;
    border-left: 3px solid #e9ecef;
    padding-left: 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.impedance-details strong {
    color: var(--primary);
    font-weight: 600;
}

.impedance-conclusion {
    padding: 25px;
    border-radius: 10px;
    margin-top: 25px;
    border-left: 5px solid;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.impedance-conclusion h5 {
    margin-bottom: 15px;
    color: inherit;
    font-size: 18px;
    font-weight: 600;
}

/* ===== MASCARAMENTO ===== */
.mask-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transform: scale(1.2);
}

.mask-checkbox:checked {
    accent-color: #9b59b6;
}

.mask-checkbox:checked + .audiogram-symbol {
    background-color: #f3e5f5;
    border-radius: 3px;
    padding: 2px;
}

tr:has(.mask-checkbox:checked) {
    background: #fff3e0 !important;
}

/* ===== AUTO-FILL ===== */
.auto-fill-section {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196f3;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.auto-fill-section .btn-primary {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
}

.auto-fill-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.auto-fill-section small {
    color: #1976d2;
    font-style: italic;
}

/* ===== AÇÕES ===== */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.action-buttons-impedance {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.action-buttons-small {
    display: flex;
    gap: 5px;
}

/* ===== DASHBOARD PARCEIRO ===== */
.referred-list-section {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.follow-up-section {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.follow-up-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.follow-up-card {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: transform 0.3s;
}

.follow-up-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.follow-up-card h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--primary);
}

.follow-up-card span {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-in-progress {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.status-waiting {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.status-needs-action {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.status-completed {
    background: #e8f5e9;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.status-waiting-payment {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.exam-status.completed {
    color: #28a745;
}

.exam-status.pending {
    color: #ffc107;
}

/* Result Classes */
.result-normal {
    color: #28a745;
}

.result-mild {
    color: #ffc107;
}

.result-moderate {
    color: #fd7e14;
}

.result-severe {
    color: #dc3545;
}

.result-undefined {
    color: #6c757d;
}

/* ===== TOASTS ===== */
.save-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    max-width: 350px;
    z-index: 1000;
    border-left: 4px solid #27ae60;
    animation: slideInRight 0.3s ease;
}

.save-toast.success {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #f0fff4, #e6f7eb);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

.toast-message strong {
    display: block;
    color: #155724;
    margin-bottom: 4px;
}

.toast-message small {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* ===== MENSAGENS ===== */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.upcoming-item {
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent);
}

.upcoming-date {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.upcoming-info {
    margin-bottom: 10px;
    color: #495057;
    font-size: 14px;
}

.upcoming-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== HEARING LOSS COLORS ===== */
.hearing-loss-normal {
    background-color: var(--light-green);
    padding: 5px;
    border-radius: 4px;
}

.hearing-loss-mild {
    background-color: var(--light-yellow);
    padding: 5px;
    border-radius: 4px;
}

.hearing-loss-moderate {
    background-color: var(--light-orange);
    padding: 5px;
    border-radius: 4px;
}

.hearing-loss-severe {
    background-color: var(--light-red);
    padding: 5px;
    border-radius: 4px;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1200px) {
    .audiograms-container,
    .impedance-charts-results {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .audiogram-container {
        height: 500px;
        min-height: 500px;
    }
    
    .impedance-chart-box {
        height: 320px;
    }
    
    .impedance-chart-container {
        height: 250px;
    }
}

@media (max-width: 968px) {
    .impedance-results-grid {
        grid-template-columns: 1fr;
    }
    
    .audiogram-container {
        height: 460px;
        min-height: 460px;
    }
}

@media (max-width: 768px) {
    .stock-admin-layout {
        grid-template-columns: 1fr;
    }

    .stock-item-card {
        grid-template-columns: 1fr;
    }

    .stock-item-photo-wrap {
        width: 100%;
        max-width: 180px;
        height: 180px;
    }

    .admin-partners-card {
        width: min(100vw - 20px, 1120px);
        max-height: calc(100vh - 20px);
        margin: 10px auto;
    }

    .admin-partners-toolbar,
    .admin-partners-list,
    .admin-partners-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .two-columns {
        grid-template-columns: 1fr;
    }
    
    .tab-container {
        flex-wrap: wrap;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .results-section {
        padding: 20px 15px;
    }
    
    .audiogram-container {
        height: 420px;
        min-height: 420px;
    }
    
    .impedance-chart-box {
        height: 280px;
        padding: 15px;
    }
    
    .impedance-chart-container {
        height: 220px;
    }
    
    .chart-container {
        height: 320px;
        padding: 15px;
    }
    
    #timpanogram-right, 
    #timpanogram-left {
        height: 250px;
    }
    
    .action-buttons,
    .action-buttons-impedance {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons button,
    .action-buttons-impedance button {
        width: 100%;
        max-width: 300px;
    }
    
    .audiogram-legend {
        gap: 15px;
    }
    
    .legend-item {
        font-size: 12px;
    }
    
    .audiogram-table {
        font-size: 12px;
        min-width: 500px;
    }
    
    .audiogram-input {
        width: 60px;
        padding: 6px;
        font-size: 12px;
    }
    
    .logoaudiometry-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .logoaudiometry-box {
        min-width: 100%;
    }
    
    .weber-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .follow-up-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .referred-list-section {
        overflow-x: auto;
    }
    
    #referred-people-table {
        min-width: 800px;
    }
    
    .save-toast {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .weber-result-grid {
        grid-template-columns: 1fr;
    }
    
    .follow-up-stats {
        grid-template-columns: 1fr;
    }
    
    .logoaudiometry-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .logoaudiometry-input-container {
        width: 100%;
    }
}

/* ===== EXAME ===== */
.exam-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.exam-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.section-description {
    color: #6c757d;
    font-style: italic;
    margin-bottom: 15px;
    font-size: 14px;
}

/* ===== RECOMENDAÇÕES ===== */
.recommendations-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.recommendations-section h4 {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.recommendations-section h6 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.recommendations-section ul {
    padding-left: 20px;
    margin: 10px 0;
}

.recommendations-section li {
    margin: 8px 0;
    padding: 5px 0;
    color: #495057;
}

.recommendations-section p {
    margin: 5px 0;
    padding: 5px 0;
    font-size: 13px;
    color: #495057;
}

/* ===== IMPEDÂNCIA AVANÇADA ===== */
.impedance-results-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--accent);
}

.impedance-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.impedance-ear-result {
    padding: 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.impedance-ear-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.impedance-summary {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.impedance-summary strong {
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
}

.impedance-summary small {
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
}

.impedance-details {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.impedance-details div {
    margin: 8px 0;
    padding: 8px;
    border-left: 3px solid #e9ecef;
    padding-left: 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.impedance-details strong {
    color: var(--primary);
    font-weight: 600;
}

.impedance-conclusion {
    padding: 25px;
    border-radius: 10px;
    margin-top: 25px;
    border-left: 5px solid;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.impedance-conclusion h5 {
    margin-bottom: 15px;
    color: inherit;
    font-size: 18px;
    font-weight: 600;
}

/* ===== MASCARAMENTO ===== */
.mask-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transform: scale(1.2);
}

.mask-checkbox:checked {
    accent-color: #9b59b6;
}

.mask-checkbox:checked + .audiogram-symbol {
    background-color: #f3e5f5;
    border-radius: 3px;
    padding: 2px;
}

tr:has(.mask-checkbox:checked) {
    background: #fff3e0 !important;
}

/* ===== AUTO-FILL ===== */
.auto-fill-section {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196f3;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.auto-fill-section .btn-primary {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
}

.auto-fill-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.auto-fill-section small {
    color: #1976d2;
    font-style: italic;
}

/* ===== AÇÕES ===== */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.action-buttons-impedance {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.action-buttons-small {
    display: flex;
    gap: 5px;
}

/* ===== DASHBOARD PARCEIRO ===== */
.referred-list-section {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.follow-up-section {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.follow-up-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.follow-up-card {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: transform 0.3s;
}

.follow-up-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.follow-up-card h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--primary);
}

.follow-up-card span {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-in-progress {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.status-waiting {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.status-needs-action {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.status-completed {
    background: #e8f5e9;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.status-waiting-payment {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.exam-status.completed {
    color: #28a745;
}

.exam-status.pending {
    color: #ffc107;
}

/* Result Classes */
.result-normal {
    color: #28a745;
}

.result-mild {
    color: #ffc107;
}

.result-moderate {
    color: #fd7e14;
}

.result-severe {
    color: #dc3545;
}

.result-undefined {
    color: #6c757d;
}

/* ===== TOASTS ===== */
.save-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    max-width: 350px;
    z-index: 1000;
    border-left: 4px solid #27ae60;
    animation: slideInRight 0.3s ease;
}

.save-toast.success {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #f0fff4, #e6f7eb);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

.toast-message strong {
    display: block;
    color: #155724;
    margin-bottom: 4px;
}

.toast-message small {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* ===== MENSAGENS ===== */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.upcoming-item {
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent);
}

.upcoming-date {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.upcoming-info {
    margin-bottom: 10px;
    color: #495057;
    font-size: 14px;
}

.upcoming-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== HEARING LOSS COLORS ===== */
.hearing-loss-normal {
    background-color: var(--light-green);
    padding: 5px;
    border-radius: 4px;
}

.hearing-loss-mild {
    background-color: var(--light-yellow);
    padding: 5px;
    border-radius: 4px;
}

.hearing-loss-moderate {
    background-color: var(--light-orange);
    padding: 5px;
    border-radius: 4px;
}

.hearing-loss-severe {
    background-color: var(--light-red);
    padding: 5px;
    border-radius: 4px;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1200px) {
    .audiograms-container,
    .impedance-charts-results {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .audiogram-container {
        height: 320px;
    }
    
    .impedance-chart-box {
        height: 320px;
    }
    
    .impedance-chart-container {
        height: 250px;
    }
}

@media (max-width: 968px) {
    .impedance-results-grid {
        grid-template-columns: 1fr;
    }
    
    .audiogram-container {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
    
    .tab-container {
        flex-wrap: wrap;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .results-section {
        padding: 20px 15px;
    }
    
    .audiogram-container {
        height: 280px;
    }
    
    .impedance-chart-box {
        height: 280px;
        padding: 15px;
    }
    
    .impedance-chart-container {
        height: 220px;
    }
    
    .chart-container {
        height: 320px;
        padding: 15px;
    }
    
    #timpanogram-right, 
    #timpanogram-left {
        height: 250px;
    }
    
    .action-buttons,
    .action-buttons-impedance {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons button,
    .action-buttons-impedance button {
        width: 100%;
        max-width: 300px;
    }
    
    .audiogram-legend {
        gap: 15px;
    }
    
    .legend-item {
        font-size: 12px;
    }
    
    .audiogram-table {
        font-size: 12px;
        min-width: 500px;
    }
    
    .audiogram-input {
        width: 60px;
        padding: 6px;
        font-size: 12px;
    }
    
    .logoaudiometry-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .logoaudiometry-box {
        min-width: 100%;
    }
    
    .weber-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .follow-up-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .referred-list-section {
        overflow-x: auto;
    }
    
    #referred-people-table {
        min-width: 800px;
    }
    
    .save-toast {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .weber-result-grid {
        grid-template-columns: 1fr;
    }
    
    .follow-up-stats {
        grid-template-columns: 1fr;
    }
    
    .logoaudiometry-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .logoaudiometry-input-container {
        width: 100%;
    }
}


/* ===== TABELA DE REFLEXOS - PADRÃO CLÍNICO ===== */
.reflex-table-complete {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 13px;
    min-width: 1400px;
}

/* ===== HEADER PRINCIPAL ===== */
.reflex-table-complete thead tr:first-child th {
    padding: 14px 10px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #dcdcdc;
    background: #f2f4f6;
    color: #2c3e50;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* ===== HEADER OD ===== */
.reflex-table-complete thead tr:first-child th.ear-header:first-of-type {
    background: #1f3a5f;
    color: #ffffff;
    border-right: 8px solid #ffffff;
}

/* ===== HEADER OE ===== */
.reflex-table-complete thead tr:first-child th.ear-header:last-of-type {
    background: #5dade2;
    color: #ffffff;
    border-left: 8px solid #ffffff;
}

/* ===== SUBHEADERS OD ===== */
.reflex-table-complete thead tr:last-child th:nth-child(2),
.reflex-table-complete thead tr:last-child th:nth-child(3),
.reflex-table-complete thead tr:last-child th:nth-child(4),
.reflex-table-complete thead tr:last-child th:nth-child(5) {
    background: #eaf2f8;
    color: #1f3a5f;
    font-weight: 600;
    border: 1px solid #d6eaf8;
}

/* ===== SUBHEADERS OE ===== */
.reflex-table-complete thead tr:last-child th:nth-child(6),
.reflex-table-complete thead tr:last-child th:nth-child(7),
.reflex-table-complete thead tr:last-child th:nth-child(8),
.reflex-table-complete thead tr:last-child th:nth-child(9) {
    background: #f4f9fd;
    color: #21618c;
    font-weight: 600;
    border: 1px solid #d6eaf8;
}

/* ===== SEPARAÇÃO VISUAL OD | OE ===== */
.reflex-table-complete th:nth-child(5),
.reflex-table-complete td:nth-child(5) {
    border-right: 6px solid #ffffff !important;
}

/* ===== FREQUÊNCIA ===== */
.frequency-cell {
    font-weight: 700;
    background: #f8f9fa;
    color: #2c3e50;
    text-align: center;
    border: 1px solid #e0e0e0;
}

/* ===== CÉLULAS ===== */
.reflex-table-complete td {
    padding: 6px;
    border: 1px solid #e5e7e9;
    text-align: center;
    background: #ffffff;
}

/* ===== INPUTS ===== */
.reflex-input {
    width: 100%;
    padding: 6px 4px;
    border-radius: 4px;
    border: 1px solid #ccd1d1;
    font-size: 12px;
    text-align: center;
    background: #ffffff;
    color: #2c3e50;
}

/* ===== INPUT DIFERENÇA (AUTO) ===== */
.reflex-input.diff {
    background: #f0f3f4;
    color: #566573;
    font-weight: 600;
    cursor: not-allowed;
}

/* ===== HOVER ===== */
.reflex-table-complete tbody tr:hover td {
    background: #f7fbff;
    transition: background 0.2s ease-in-out;
}



    /* Estilos para o histórico */
.history-stats {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #3498db;
    flex: 1;
    min-width: 200px;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.patients-list {
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.exam-card, .partner-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.exam-date {
    background: #e8f4fc;
    color: #2980b9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.exam-details {
    margin-top: 10px;
}

.exam-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

.btn-small:hover {
    opacity: 0.9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.empty-state, .error-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.empty-state h3, .error-state h3 {
    color: #6c757d;
    margin-bottom: 10px;
}

.hint {
    color: #6c757d;
    font-size: 14px;
    margin-top: 10px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-box button {
    padding: 10px 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-box button:hover {
    background: #2980b9;
}


/* Adicione estas regras ao final do seu style.css */

/* Ajustes para os gráficos de timpanograma */
.impedance-chart-container {
    height: 350px !important; /* Aumenta a altura */
    min-height: 350px;
    position: relative;
}

/* Para os timpanogramas na aba de resultados */
.impedance-charts-results .impedance-chart-container {
    height: 320px !important;
    min-height: 320px;
}

/* Container dos gráficos */
.impedance-charts-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

/* Caixa individual do gráfico */
.impedance-chart-box {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.impedance-chart-box h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

/* Para a aba de exames (impedance-enhanced) */
#unified-impedance-section .impedance-chart-container {
    height: 300px !important;
    min-height: 300px;
}

/* Responsividade */
@media (max-width: 768px) {
    .impedance-chart-container {
        height: 300px !important;
    }
    
    .impedance-charts-results {
        grid-template-columns: 1fr;
    }
}


/* Estilos para o sistema de PDF */
#pdf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    color: white;
    font-size: 18px;
}

#pdf-loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Botão de PDF */
button#generate-pdf,
button#generate-pdf-results {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

button#generate-pdf:hover,
button#generate-pdf-results:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

button#generate-pdf:disabled,
button#generate-pdf-results:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* =========================================================
   REFLEXOS ACÚSTICOS - LAYOUT CLÍNICO (PATCH FINAL)
   Não altera IDs/classes do HTML
   Cole no FINAL do style.css para sobrescrever regras antigas
========================================================= */

/* Seção */
.reflex-table-section {
    margin-top: 18px;
}

.reflex-table-section h4 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Container com scroll horizontal mais “clean” */
.reflex-table-section .table-container {
    overflow-x: auto;
    margin: 14px 0 0;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Tabela */
.reflex-table-complete {
    width: 100%;
    border-collapse: separate; /* ajuda no sticky + bordas */
    border-spacing: 0;
    background: #ffffff;
    font-size: 13px;
    min-width: 1100px; /* evita esmagar demais */
}

/* Header sticky (melhora muito leitura) */
.reflex-table-complete thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* Linha 1 do header (OD/OE agrupado) */
.reflex-table-complete thead tr:first-child th {
    padding: 12px 10px;
    text-align: center;
    font-weight: 800;
    border-bottom: 1px solid #e6e9ee;
    background: #f4f6f9;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.4px;
}

/* Linha 2 do header (colunas) */
.reflex-table-complete thead tr:last-child th {
    padding: 10px 8px;
    text-align: center;
    font-weight: 700;
    border-bottom: 1px solid #e6e9ee;
    background: #fafbfc;
    color: #34495e;
    font-size: 12px;
}

/* Header OD/OE (primeira linha) */
.reflex-table-complete thead tr:first-child th.ear-header {
    color: #fff;
}

/* OD */
.reflex-table-complete thead tr:first-child th.ear-header:nth-child(2) {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

/* OE */
.reflex-table-complete thead tr:first-child th.ear-header:nth-child(3) {
    background: linear-gradient(135deg, #2e86c1, #3498db);
}

/* Separador visual OD | OE (coluna 5 do corpo = OD Ipsilateral) */
.reflex-table-complete th:nth-child(5),
.reflex-table-complete td:nth-child(5) {
    border-right: 10px solid #ffffff !important;
}

/* Primeira coluna (frequência) com sticky lateral */
.reflex-table-complete th:first-child,
.reflex-table-complete td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
}

/* Header da primeira coluna (sticky) */
.reflex-table-complete thead th:first-child {
    z-index: 4;
    background: #eef2f6;
}

/* Célula de frequência */
.reflex-table-complete td.frequency-cell,
.reflex-table-complete td:first-child {
    font-weight: 800;
    background: #f7f9fc;
    color: var(--primary);
    border-right: 1px solid #e6e9ee;
    text-align: center;
    white-space: nowrap;
}

/* Corpo */
.reflex-table-complete tbody td {
    padding: 8px;
    border-bottom: 1px solid #eef1f5;
    border-right: 1px solid #f0f2f6;
    text-align: center;
    background: #fff;
    vertical-align: middle;
}

/* Zebra */
.reflex-table-complete tbody tr:nth-child(even) td {
    background: #fbfcfe;
}

/* Hover mais sutil (não “azulão”) */
.reflex-table-complete tbody tr:hover td {
    background: #f3f8ff;
}

/* Inputs */
.reflex-input {
    width: 100%;
    min-width: 78px;
    height: 34px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #d7dde6;
    font-size: 13px;
    text-align: center;
    background: #ffffff;
    color: #2c3e50;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.reflex-input::placeholder {
    color: #a6b0bd;
    font-size: 12px;
}

/* Focus */
.reflex-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
    background: #f8fdff;
}

/* Campo de diferença (Auto) */
.reflex-input.diff {
    background: #f1f4f7;
    color: #566573;
    font-weight: 700;
    cursor: not-allowed;
    border: 1px solid #dfe5ec;
}

/* Melhorar percepção OD vs OE sem poluir:
   - OD (colunas 2..5 do corpo)
   - OE (colunas 6..9 do corpo)
*/
.reflex-table-complete tbody td:nth-child(2),
.reflex-table-complete tbody td:nth-child(3),
.reflex-table-complete tbody td:nth-child(4),
.reflex-table-complete tbody td:nth-child(5) {
    background-image: linear-gradient(0deg, rgba(231,76,60,0.035), rgba(231,76,60,0.035));
}

.reflex-table-complete tbody td:nth-child(6),
.reflex-table-complete tbody td:nth-child(7),
.reflex-table-complete tbody td:nth-child(8),
.reflex-table-complete tbody td:nth-child(9) {
    background-image: linear-gradient(0deg, rgba(52,152,219,0.03), rgba(52,152,219,0.03));
}

/* =========================================================
   ESTADOS VISUAIS (prontos para JS aplicar classes)
   Você pode aplicar essas classes no INPUT via JS:
   .reflex-present | .reflex-elevated | .reflex-absent
========================================================= */

.reflex-input.reflex-present {
    border-color: rgba(39, 174, 96, 0.6);
    background: #f7fff9;
}

.reflex-input.reflex-elevated {
    border-color: rgba(243, 156, 18, 0.75);
    background: #fffaf2;
}

.reflex-input.reflex-absent {
    border-color: rgba(231, 76, 60, 0.55);
    background: #fff6f6;
    color: #8e2a2a;
}

/* Se quiser “NR”/“Ausente” bem marcado quando o usuário digitar */
.reflex-input.reflex-absent::placeholder {
    color: rgba(231, 76, 60, 0.7);
}

/* =========================================================
   Responsividade: em telas menores, mantém scroll e melhora densidade
========================================================= */
@media (max-width: 768px) {
    .reflex-table-complete {
        min-width: 980px;
        font-size: 12px;
    }
    .reflex-input {
        min-width: 70px;
        height: 32px;
        font-size: 12px;
    }
}

/* ================================
   PATCH: Reflexos mais compactos
   Cole no FINAL do style.css
================================ */

/* Container: menos “gordo” */
.reflex-table-section .table-container{
  margin: 12px 0;
  border-radius: 10px;
}

/* Tabela: reduz min-width e melhora densidade */
.reflex-table-complete{
  font-size: 12px;
  min-width: 980px;      /* antes estava grande demais */
}

/* Cabeçalhos mais compactos */
.reflex-table-complete thead tr:first-child th{
  padding: 10px 8px;
  font-size: 11px;
}

.reflex-table-complete thead tr:last-child th{
  padding: 8px 6px;
  font-size: 11px;
  line-height: 1.2;
}

/* Células mais enxutas */
.reflex-table-complete td{
  padding: 6px;
}

/* Frequência: menor e firme */
.reflex-table-complete td.frequency-cell{
  font-size: 12px;
  padding: 6px 8px;
}

/* Inputs: menor altura e largura mínima melhor */
.reflex-input{
  height: 32px;
  padding: 6px 6px;
  font-size: 12px;
  min-width: 72px;
  border-radius: 6px;
}

/* Campo auto (diff) mais “readonly” de verdade */
.reflex-input.diff{
  height: 32px;
  font-weight: 700;
}

/* Separador OD | OE (continua evidente, mas mais fino) */
.reflex-table-complete th:nth-child(5),
.reflex-table-complete td:nth-child(5){
  border-right: 6px solid #ffffff !important;
}

/* Responsividade: diminui ainda mais em telas menores */
@media (max-width: 768px){
  .reflex-table-complete{
    min-width: 920px;
  }
  .reflex-input{
    min-width: 68px;
    height: 30px;
    font-size: 12px;
  }
}


/* ===== PTA (Média Tritonal) ao lado da Via Aérea ===== */
.air-pta-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.pta-panel {
  width: 190px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  flex-shrink: 0;
}

.pta-title {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 700;
  color: #333;
}

.pta-box {
  display: grid;
  grid-template-columns: 44px 1fr 30px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #f1f3f5;
  background: #fafafa;
  margin-bottom: 10px;
}

.pta-ear {
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.pta-right .pta-ear { color: #e74c3c; }
.pta-left  .pta-ear { color: #3498db; }

.pta-value {
  font-weight: 800;
  font-size: 22px;
  text-align: center;
  color: #111;
}

.pta-unit {
  font-size: 12px;
  text-align: right;
  color: #666;
}

@media (max-width: 900px) {
  .air-pta-wrap {
    flex-direction: column;
  }
  .pta-panel {
    width: 100%;
  }
}

.report-section {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
}

.report-section h4 {
  color: var(--primary);
    margin-bottom: 15px;
}

.history-detail-modal.hidden {
    display: none;
}

.history-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 1250;
}

.history-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.history-detail-card {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100vw - 40px));
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.history-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid #dbe4ee;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(41, 128, 185, 0.03));
}

.history-detail-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-detail-header h2 {
    margin: 0;
    color: var(--primary);
    font-size: 28px;
}

.history-detail-eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #607181;
}

.history-detail-close {
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border-radius: 999px;
    font-size: 28px;
    line-height: 1;
    background: #ffffff;
    color: var(--primary);
    border: 1px solid #dbe7f3;
}

.history-detail-load-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(47, 142, 216, 0.18);
    background: linear-gradient(135deg, #2f8ed8, #216fb7);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(33, 111, 183, 0.18);
}

.history-detail-load-btn:hover {
    filter: brightness(1.03);
}

.history-detail-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 0;
}

.history-detail-nav {
    border-right: 1px solid #e4ebf2;
    background: #f8fbff;
    padding: 18px;
    overflow: auto;
    display: grid;
    gap: 10px;
}

.history-detail-nav-button {
    width: 100%;
    margin: 0;
    text-align: left;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #dbe7f3;
    background: #ffffff;
    color: #25445f;
    display: grid;
    gap: 6px;
}

.history-detail-nav-button strong {
    font-size: 14px;
}

.history-detail-nav-button span {
  font-size: 12px;
  color: #607181;
}

.history-detail-nav-button small {
  font-size: 11px;
  color: #7a8c9d;
}

.history-detail-nav-button.active {
  border-color: #3498db;
  box-shadow: 0 10px 24px rgba(31, 73, 125, 0.12);
  background: linear-gradient(180deg, #ffffff, #f4f9ff);
}

.history-detail-nav-button.is-disabled {
  border-style: dashed;
  background: #fbfdff;
}

.history-detail-nav-button.is-disabled strong,
.history-detail-nav-button.is-disabled span,
.history-detail-nav-button.is-disabled small {
  color: #6f8090;
}

.history-detail-nav-empty {
    padding: 14px 16px;
    border: 1px dashed #c9d7e5;
    border-radius: 14px;
    background: #ffffff;
    color: #607181;
    font-size: 13px;
}

.history-detail-content {
    overflow: auto;
    padding: 22px 24px 28px;
    background: #fbfdff;
}

.history-detail-pane-header {
    margin-bottom: 18px;
}

.history-detail-pane-header h3 {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 28px;
}

.history-detail-pane-header span {
    color: #607181;
    font-size: 14px;
}

.history-detail-section {
    background: #ffffff;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(15, 35, 60, 0.05);
}

.history-detail-section h4 {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 18px;
}

.history-detail-summary,
.history-detail-empty {
    margin: 0;
    color: #4d5f70;
    line-height: 1.6;
}

.history-detail-table-wrap {
    overflow-x: auto;
}

.history-detail-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.history-detail-table th,
.history-detail-table td {
    border: 1px solid #dbe4ee;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.history-detail-table th {
    background: #f3f8fc;
    color: #264661;
    font-weight: 700;
}

.history-detail-table tbody tr:nth-child(even) {
    background: #fbfdff;
}

.history-detail-meta-grid,
.history-detail-kpi-grid,
.history-detail-visual-grid,
.history-detail-text-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.history-detail-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-detail-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-detail-kpi-grid--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-detail-visual-grid,
.history-detail-text-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-detail-text-grid .is-full {
    grid-column: 1 / -1;
}

.history-detail-meta-card,
.history-detail-kpi-card,
.history-detail-chart-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe7f3;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 35, 60, 0.06);
}

.history-detail-meta-card,
.history-detail-kpi-card {
    padding: 16px;
    display: grid;
    gap: 8px;
}

.history-detail-meta-card small,
.history-detail-kpi-card small {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6a7f93;
    font-size: 11px;
    font-weight: 700;
}

.history-detail-meta-card strong,
.history-detail-kpi-card strong {
    color: var(--primary);
    font-size: 18px;
    line-height: 1.3;
}

.history-detail-meta-card span,
.history-detail-kpi-card span {
    color: #4d5f70;
    font-size: 13px;
    line-height: 1.5;
}

.history-detail-kpi-card.od {
    border-top: 4px solid #e74c3c;
}

.history-detail-kpi-card.oe {
    border-top: 4px solid #3498db;
}

.history-detail-kpi-card.neutral {
    border-top: 4px solid #7f8c8d;
}

.history-detail-chart-card {
    padding: 18px;
}

.history-detail-chart-card h5,
.history-detail-text-grid h5 {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 16px;
}

.history-detail-canvas-shell {
    position: relative;
    min-height: 320px;
}

.history-detail-richtext {
    color: #415466;
    line-height: 1.7;
}

.history-detail-protocol-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.history-detail-protocol-band {
    margin-bottom: 16px;
}

.history-detail-protocol-band-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.history-detail-protocol-band-header small {
    display: block;
    color: #6a7f93;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 4px;
}

.history-detail-protocol-band-header strong {
    color: var(--primary);
    font-size: 16px;
}

.history-detail-protocol-band-header span {
    color: #58708a;
    font-size: 12px;
    white-space: nowrap;
}

.history-detail-protocol-band-scale {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    min-height: 48px;
    border-radius: 999px;
    padding: 0 18px;
    overflow: hidden;
    border: 1px solid rgba(139, 166, 191, 0.22);
    background: linear-gradient(90deg, rgba(241, 244, 248, 0.95) 0%, rgba(218, 231, 252, 0.95) 50%, rgba(198, 220, 255, 0.95) 100%);
}

.history-detail-protocol-band-scale span {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #24425d;
}

.history-detail-protocol-band-scale--below {
    box-shadow: inset 0 0 0 1px rgba(214, 116, 94, 0.18);
}

.history-detail-protocol-band-scale--normal {
    box-shadow: inset 0 0 0 1px rgba(89, 132, 212, 0.16);
}

.history-detail-protocol-band-scale--above {
    box-shadow: inset 0 0 0 1px rgba(84, 136, 182, 0.18);
}

.history-detail-protocol-band-marker {
    position: absolute;
    top: 6px;
    width: 18px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(180deg, #163a5f 0%, #285b92 100%);
    box-shadow: 0 8px 18px rgba(18, 44, 72, 0.24);
    border: 2px solid #ffffff;
}

.history-detail-protocol-metric {
    padding: 12px 14px;
    border: 1px solid #dbe7f3;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    display: grid;
    gap: 4px;
}

.history-detail-protocol-metric small {
    color: #6a7f93;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10px;
    font-weight: 700;
}

.history-detail-protocol-metric strong {
    color: var(--primary);
    font-size: 18px;
    line-height: 1.2;
}

.history-detail-protocol-metric span {
    color: #607181;
    font-size: 12px;
}

.history-detail-structured-list {
    margin-top: 12px;
}

.history-detail-structured-list ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.history-detail-structured-list li {
    margin-bottom: 6px;
}

body.history-detail-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .history-detail-card {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        margin: 10px auto;
    }

    .history-detail-layout {
        grid-template-columns: 1fr;
    }

    .history-detail-header {
        flex-direction: column;
        align-items: stretch;
    }

    .history-detail-header-actions {
        justify-content: space-between;
    }

    .history-detail-nav {
        border-right: none;
        border-bottom: 1px solid #e4ebf2;
        max-height: 220px;
    }

    .history-detail-content {
        padding: 18px;
    }

    .history-detail-meta-grid,
    .history-detail-kpi-grid,
    .history-detail-kpi-grid--triple,
    .history-detail-visual-grid,
    .history-detail-text-grid {
        grid-template-columns: 1fr;
    }

    .history-detail-canvas-shell {
        min-height: 280px;
    }

    .history-detail-protocol-band-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-detail-protocol-band-header span {
        white-space: normal;
    }
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
}

/* ===== ABA TESTES ===== */
.tests-hub-card {
  padding: 24px;
}

.tests-hub-header h2 {
  margin-bottom: 6px;
  color: var(--primary);
}

.tests-hub-header p {
  margin: 0 0 22px;
  color: #5f6c7b;
}

.tests-catalog-header h3 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 18px;
}

.tests-catalog-header p {
  margin: 0 0 14px;
  color: #6b7683;
  font-size: 13px;
  line-height: 1.5;
}

.tests-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.tests-protocol-card {
  width: 100%;
  margin: 0;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #dbe7f3;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: #25445f;
  text-align: left;
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(31, 73, 125, 0.08);
}

.tests-protocol-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(31, 73, 125, 0.12);
}

.tests-protocol-card-tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7683;
}

.tests-protocol-card strong {
  font-size: 20px;
  line-height: 1.3;
}

.tests-protocol-card p {
  margin: 0;
  color: #5e6f80;
  line-height: 1.5;
}

.tests-protocol-card-action {
  font-size: 13px;
  font-weight: 700;
  color: #3498db;
}

.tests-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.tests-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.tests-modal-card {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.tests-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-bottom: 1px solid #dbe7f3;
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(41, 128, 185, 0.03));
}

.tests-modal-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7683;
}

.tests-modal-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 28px;
}

.tests-modal-close {
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
  background: #ffffff;
  color: var(--primary);
  border: 1px solid #dbe7f3;
}

.tests-modal-body {
  overflow: auto;
  padding: 24px 26px 28px;
}

body.tests-modal-open {
  overflow: hidden;
}

.tests-protocol-shell {
  display: grid;
  gap: 18px;
}

.tests-protocol-banner {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(41, 128, 185, 0.02));
  border: 1px solid #d8e8f6;
  border-radius: 16px;
  padding: 22px 24px;
}

.tests-protocol-banner.compact {
  padding: 18px 20px;
}

.tests-protocol-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #607181;
}

.tests-protocol-banner h3 {
  margin: 0;
  font-size: 14px;
  color: #607181;
}

.tests-protocol-banner h2 {
  margin: 6px 0 10px;
  color: var(--primary);
  font-size: 30px;
}

.tests-protocol-banner p {
  margin: 0;
  color: #4d5f70;
  line-height: 1.6;
}

.tests-meta-grid,
.tests-intensity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tests-parameter-grid,
.tests-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tests-two-column-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tests-table-card,
.tests-observation-card,
.tests-closing-card {
  background: #ffffff;
  border: 1px solid #dfe8f1;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 35, 60, 0.05);
}

.tests-table-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.tests-table-header h4,
.tests-observation-card h4,
.tests-closing-card h4 {
  margin: 0 0 6px;
  color: var(--primary);
}

.tests-table-header p {
  margin: 0;
  color: #677889;
}

.tests-table-scroll {
  overflow-x: auto;
}

.tests-score-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #ffffff;
}

.tests-score-table th,
.tests-score-table td {
  border: 1px solid #dbe4ee;
  padding: 9px 10px;
  font-size: 13px;
}

.tests-score-table th {
  background: #f3f8fc;
  color: #264661;
  font-weight: 700;
  text-align: left;
}

.tests-score-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.tests-word-index {
  width: 54px;
  text-align: center;
  font-weight: 700;
  color: #607181;
}

.tests-word-cell {
  font-weight: 600;
  color: #2f4255;
}

.tests-check-cell {
  width: 110px;
  text-align: center;
}

.tests-check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  color: #5e6f80;
}

.tests-check-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.tests-score-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.tests-score-summary.single {
  grid-template-columns: 1fr;
}

.tests-score-box {
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid #dbe4ee;
  background: #f7fbff;
  display: grid;
  gap: 6px;
}

.tests-score-box.right {
  border-left: 4px solid #e74c3c;
}

.tests-score-box.left {
  border-left: 4px solid #3498db;
}

.tests-score-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #607181;
}

.tests-score-box strong {
  font-size: 32px;
  line-height: 1;
  color: var(--primary);
}

.tests-score-box span:last-child {
  font-size: 14px;
  font-weight: 600;
  color: #5b6d7f;
}

.tests-figure-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.tests-figure-board.is-three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tests-figure-board.is-six-columns {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tests-figure-tile {
  border: 1px solid #dbe7f3;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  padding: 16px 12px;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 112px;
  box-shadow: 0 8px 18px rgba(31, 73, 125, 0.05);
}

.tests-figure-tile.is-illustrated {
  min-height: 132px;
}

.tests-figure-icon {
  font-size: 36px;
  line-height: 1;
}

.tests-figure-label {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #365066;
}

.tests-protocol-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #ffffff;
}

.tests-protocol-table th,
.tests-protocol-table td {
  border: 1px solid #dbe4ee;
  padding: 8px 8px;
  font-size: 13px;
  text-align: center;
  vertical-align: middle;
}

.tests-protocol-table th {
  background: #f3f8fc;
  color: #264661;
  font-weight: 700;
}

.tests-protocol-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.tests-cell-input {
  width: 100%;
  min-width: 72px;
  padding: 7px 8px;
  font-size: 13px;
  text-align: center;
}

.tests-mini-check-cell {
  width: 42px;
}

.tests-mini-hit-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
}

.tests-inline-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.tests-inline-summary.is-three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tests-inline-summary div {
  border: 1px solid #dbe7f3;
  background: #f7fbff;
  border-radius: 12px;
  padding: 12px 14px;
  color: #365066;
  font-size: 14px;
}

.tests-criteria-table {
  min-width: 640px;
}

.tests-reference-card {
  background: #ffffff;
  border: 1px solid #dfe8f1;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 35, 60, 0.05);
}

.tests-reference-card h4 {
  margin: 0 0 14px;
  color: var(--primary);
}

.tests-sentence-list {
  margin: 0;
  padding-left: 22px;
  color: #4d5f70;
  line-height: 1.7;
}

.tests-stimulus-table td {
  text-align: left;
  font-size: 12px;
}

.tests-behavior-list {
  display: grid;
  gap: 12px;
}

.tests-behavior-list.is-single-column {
  grid-template-columns: 1fr;
}

.tests-behavior-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f7fbff;
  border: 1px solid #dbe7f3;
  border-radius: 12px;
  margin: 0;
  color: #365066;
}

.tests-behavior-item input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.tests-long-fields {
  display: grid;
  gap: 16px;
}

.tests-protocol-shell textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font: inherit;
}

.tests-long-fields textarea {
  min-height: 96px;
  resize: vertical;
}

.tests-protocol-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid #d7e7fb;
  border-radius: 16px;
  background: linear-gradient(180deg, #f9fcff 0%, #eef6ff 100%);
}

.tests-protocol-actions-main {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tests-protocol-save-status {
  min-height: 24px;
  font-size: 14px;
  color: #5f7893;
}

.tests-protocol-save-status.is-success {
  color: #1f7a45;
}

.tests-protocol-save-status.is-error {
  color: #b42318;
}

.tests-pdf-export {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tests-pdf-export-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid #d7e7fb;
}

.tests-pdf-export-header p {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a6580;
}

.tests-pdf-export-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  color: #1d3557;
}

.tests-pdf-export-header span {
  color: #55708a;
  font-size: 14px;
}

.tests-pdf-control {
  background: #ffffff !important;
  color: #1f2937 !important;
}

.tests-closing-options {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 12px;
}

.tests-closing-options.is-wrap label {
  min-width: 150px;
}

.tests-closing-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  color: #365066;
}

.tests-closing-options input {
  width: 16px;
  height: 16px;
  margin: 0;
}

@media (max-width: 1024px) {
  .tests-modal-card {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    margin: 12px auto;
  }
}

@media (max-width: 768px) {
  .tests-meta-grid,
  .tests-intensity-grid,
  .tests-score-summary,
  .tests-parameter-grid,
  .tests-list-grid,
  .tests-two-column-block {
    grid-template-columns: 1fr;
  }

  .tests-protocol-banner h2 {
    font-size: 24px;
  }

  .tests-hub-card {
    padding: 18px;
  }

  .tests-modal-header {
    padding: 18px;
  }

  .tests-modal-body {
    padding: 18px;
  }

  .tests-modal-header h2 {
    font-size: 22px;
  }

  .tests-protocol-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tests-protocol-actions-main {
    width: 100%;
  }

  .tests-protocol-actions-main button {
    flex: 1;
  }

  .tests-figure-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tests-inline-summary {
    grid-template-columns: 1fr;
  }
}

/* ===== REFINO VISUAL DO MVP ===== */
:root {
  --pastel-bg: #edf4fb;
  --primary: #1f3551;
  --secondary: #496785;
  --accent: #2f8ed8;
  --surface: #ffffff;
  --surface-muted: #f6f9fc;
  --surface-soft: #fbfdff;
  --border-soft: #dbe6f1;
  --border-strong: #c6d8e8;
  --text-main: #24384d;
  --text-soft: #617386;
  --shadow-soft: 0 16px 34px rgba(26, 46, 76, 0.08);
  --shadow-card: 0 18px 44px rgba(28, 51, 84, 0.1);
}

body {
  background:
    radial-gradient(circle at top left, rgba(47, 142, 216, 0.08), transparent 24%),
    linear-gradient(180deg, #edf4fb 0%, #f7fbff 100%);
  color: var(--text-main);
}

#app-screen {
  padding: 12px 0 36px;
}

.container {
  max-width: 1280px;
  padding: 24px 20px 36px;
}

header {
  padding: 22px 18px;
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-soft);
}

header h1 {
  font-size: clamp(30px, 3vw, 46px);
  letter-spacing: -0.03em;
}

.card,
.audiogram-box,
.history-detail-section,
.tests-hub-card,
.tests-table-card,
.tests-observation-card,
.tests-closing-card,
.tests-reference-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.card {
  padding: 24px;
}

.card h2,
.card h3,
.card h4 {
  color: var(--primary);
}

.form-group {
  margin-bottom: 18px;
}

label {
  margin-bottom: 8px;
  color: #31475e;
  font-weight: 700;
}

input,
select,
textarea {
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-soft);
  color: #1f2937;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(47, 142, 216, 0.12);
}

button,
.btn-primary,
.btn-secondary,
.btn-save,
.btn-small {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  box-shadow: 0 10px 20px rgba(47, 142, 216, 0.12);
}

button:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-save:hover,
.btn-small:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2873b4, var(--accent));
}

.btn-secondary {
  background: linear-gradient(135deg, #8096a8, #667b8e);
}

.btn-small {
  border-radius: 10px;
}

.tab-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 24px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.tab {
  margin: 0;
  padding: 12px 18px;
  border-radius: 12px;
  border-bottom: none;
  color: #5b6e80;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tab:hover {
  background: rgba(47, 142, 216, 0.08);
  color: var(--primary);
}

.tab.active {
  background: linear-gradient(180deg, #ffffff, #f3f9ff);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(47, 142, 216, 0.22), 0 8px 18px rgba(31, 53, 81, 0.08);
  border-bottom: none;
}

.audiogram-box {
  padding: 24px;
}

.audiogram-box h4 {
  margin-bottom: 20px;
  font-size: 18px;
}

.audiogram-table th,
.tests-protocol-table th,
.tests-score-table th,
.history-detail-table th {
  background: #eef5fb;
  color: #264661;
}

.audiogram-table td,
.tests-protocol-table td,
.tests-score-table td,
.history-detail-table td {
  background: rgba(255, 255, 255, 0.86);
}

.logoaudiometry-result-card,
.tests-score-box,
.exam-card,
.partner-card {
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 26px rgba(30, 49, 78, 0.06);
}

.results-grid,
.logoaudiometry-results-grid,
.impedance-results-grid {
  gap: 18px;
}

.tests-protocol-card {
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 16px 28px rgba(25, 48, 79, 0.08);
}

.tests-protocol-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 36px rgba(25, 48, 79, 0.14);
}

.tests-modal-card,
.history-detail-card {
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(16, 29, 47, 0.24);
}

.tests-modal-body,
.history-detail-content {
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}

.tests-protocol-banner,
.history-detail-nav,
.history-detail-nav-button.active {
  background: linear-gradient(180deg, #ffffff, #f4f9ff);
}

.history-detail-nav-button,
.tests-protocol-card,
.tests-figure-tile,
.tests-inline-summary div {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.history-detail-nav-button:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 142, 216, 0.35);
}

.tests-figure-tile {
  box-shadow: 0 10px 20px rgba(31, 53, 81, 0.05);
}

.tests-protocol-shell textarea {
  border-radius: 12px;
  border-color: var(--border-soft);
  background: var(--surface-soft);
}

.tests-protocol-actions {
  gap: 16px;
}

.tests-protocol-actions-main button {
  min-width: 180px;
}

@media (max-width: 900px) {
  .container {
    padding: 18px 12px 28px;
  }

  .tab-container {
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
  }

  .tab {
    padding: 10px 14px;
  }
}
