* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.topbar {
    background: #0f172a;
    color: white;
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 22px;
    font-weight: 700;
}

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

.card {
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    margin-bottom: 22px;
}

.login-card {
    max-width: 420px;
    margin: 80px auto;
}

h1, h2, h3 {
    margin-top: 0;
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    margin: 7px 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

button,
.button {
    background: #2563eb;
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: #1d4ed8;
}

.danger {
    background: #dc2626;
}

.danger:hover {
    background: #b91c1c;
}

.secondary {
    background: #475569;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f8fafc;
}

.actions form {
    display: inline-block;
    margin: 2px;
}

.actions input[type="text"] {
    width: 160px;
    margin: 0;
}

.message {
    padding: 12px;
    background: #e0f2fe;
    border-radius: 6px;
    margin-bottom: 15px;
}

.quota-bar {
    height: 18px;
    background: #e2e8f0;
    border-radius: 9px;
    overflow: hidden;
    margin-top: 8px;
}

.quota-fill {
    height: 100%;
    background: #2563eb;
}

.breadcrumb a {
    text-decoration: none;
}

.toolbar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.toolbar > div {
    flex: 1;
    min-width: 280px;
}

.logout {
    margin: 0;
}

@media (max-width: 700px) {
    table {
        font-size: 14px;
    }

    .actions input[type="text"] {
        width: 110px;
    }
}

.footer {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    padding: 25px 15px 35px;
    line-height: 1.7;
}

.status-new {
    font-weight: 700;
}

.status-viewed {
    font-weight: 600;
}

.status-downloaded {
    font-weight: 600;
}

.dentist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.dentist-header p {
    margin-bottom: 0;
    color: #64748b;
}

.dentist-summary {
    display: flex;
    gap: 12px;
}

.summary-box {
    min-width: 95px;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
}

.summary-number {
    display: block;
    font-size: 25px;
    font-weight: 700;
}

.summary-label {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    color: #64748b;
}

.exam-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: #f1f5f9;
}

.status-new {
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

@media (max-width: 700px) {

    .dentist-header {
        display: block;
    }

    .dentist-summary {
        margin-top: 20px;
    }

    .summary-box {
        flex: 1;
    }
}

.exam-back {
    margin-bottom: 18px;
}

.exam-back a {
    text-decoration: none;
}

.exam-header-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 35px;
}

.exam-label {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.exam-patient-name {
    margin-bottom: 7px;
    font-size: 28px;
}

.exam-code {
    color: #64748b;
    font-size: 14px;
}

.exam-meta {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.exam-meta-item {
    min-width: 110px;
}

.exam-meta-item span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 5px;
}

.exam-meta-item strong {
    display: block;
}

.exam-note {
    background: #f8fafc;
    border-left: 4px solid #cbd5e1;
    padding: 14px;
    border-radius: 4px;
}

.section-description {
    color: #64748b;
    margin-top: -5px;
    margin-bottom: 20px;
}

.exam-files {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exam-file-row {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.exam-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.exam-file-icon {
    font-size: 28px;
}

.exam-file-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.exam-file-size {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

.exam-file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 700px) {

    .exam-header-card {
        display: block;
    }

    .exam-meta {
        margin-top: 25px;
    }

    .exam-file-row {
        display: block;
    }

    .exam-file-actions {
        margin-top: 16px;
        flex-wrap: wrap;
    }

    .exam-file-actions .button {
        display: inline-block;
    }
}

.operator-header p {
    margin-bottom: 0;
    color: #64748b;
}

.recipient-selector {
    margin: 12px 0 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recipient-option {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: 10px 14px;
    background: #f8fafc;
    cursor: pointer;
}

.recipient-option input {
    margin: 0;
}

.exam-textarea {
    width: 100%;
    max-width: 650px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
}

.operator-recipient {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    white-space: nowrap;
}

.operator-recipient:last-child {
    margin-bottom: 0;
}

.exam-code-small {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
}

.table-responsive {
    overflow-x: auto;
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 18px;
}

.login-logo {
    max-width: 230px;
    width: 100%;
    height: auto;
    display: inline-block;
}

/* Ajuste final da tela de login */
.login-card {
    max-width: 620px;
}

.login-logo-wrap {
    text-align: center;
    margin: -5px 0 18px;
}

.login-logo {
    width: 100%;
    max-width: 520px;
    height: auto;
    display: inline-block;
}

/* Harmonização da tela de login */

.login-card {
    max-width: 620px;
    padding: 32px;
}

.login-logo-wrap {
    text-align: center;
    margin: 0 0 22px;
}

.login-logo {
    width: 100%;
    max-width: 500px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.login-card h2 {
    margin-bottom: 8px;
}

.login-card > p {
    margin-top: 0;
    margin-bottom: 24px;
    color: #64748b;
}

.login-card form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.login-card form label {
    display: block;
    margin: 0 0 6px;
    font-weight: 600;
}

.login-card form input[type="text"],
.login-card form input[type="password"] {
    width: 100%;
    max-width: none;
    margin: 0 0 18px;
    padding: 11px 12px;
}

.login-card form button {
    align-self: flex-start;
    margin-top: 2px;
    min-width: 90px;
}

@media (max-width: 700px) {
    .login-card {
        padding: 24px;
    }

    .login-logo {
        max-width: 100%;
    }
}

/* Refinamento final do formulário de login */

.login-card form {
    max-width: 420px;
    margin: 0 auto;
}

.login-card form label {
    width: 100%;
    margin-bottom: 5px;
}

.login-card form input[type="text"],
.login-card form input[type="password"] {
    width: 100%;
    max-width: 420px;
    padding: 9px 11px;
    margin-bottom: 14px;
}

.login-card form button {
    align-self: flex-start;
    min-width: 82px;
    padding: 9px 16px;
}

.login-card h2,
.login-card > p {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* Somente o botão Entrar da tela de login */
.login-card form button[type="submit"] {
    background: #f97316;
}

.login-card form button[type="submit"]:hover {
    background: #ea580c;
}

.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.agenda-header p {
    margin-bottom: 0;
    color: #64748b;
}

.agenda-summary {
    display: flex;
    gap: 12px;
}

.agenda-filters {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.agenda-filters > div {
    min-width: 190px;
}

.agenda-filters label {
    display: block;
    margin-bottom: 6px;
}

.agenda-filters select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
}

.agenda-filter-button {
    min-width: auto !important;
}

.agenda-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.agenda-toolbar h3 {
    margin-bottom: 0;
}

@media (max-width: 700px) {

    .agenda-header {
        display: block;
    }

    .agenda-summary {
        margin-top: 20px;
    }

    .agenda-filters {
        display: block;
    }

    .agenda-filters > div {
        margin-bottom: 15px;
    }
}

.dentist-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.appointment-form {
    max-width: 760px;
}

.appointment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 8px;
}

.appointment-form label {
    display: block;
    margin: 10px 0 6px;
}

.appointment-form select,
.appointment-form input[type="text"],
.appointment-form input[type="date"],
.appointment-form input[type="time"] {
    width: 100%;
    max-width: none;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
}

.appointment-submit {
    margin-top: 20px;
}

@media (max-width: 700px) {
    .appointment-grid {
        grid-template-columns: 1fr;
    }
}

.dentist-appointments {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.dentist-appointment-card {
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 18px;
    background: #ffffff;
}

.dentist-appointment-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.dentist-appointment-time {
    font-size: 1.35rem;
    font-weight: 700;
}

.dentist-appointment-patient {
    font-size: 1.08rem;
    font-weight: 600;
    margin-top: 3px;
}

.dentist-appointment-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 24px;
    margin-bottom: 14px;
}

.response-badge {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
}

.response-pending {
    background: #fff7d6;
    color: #7a5b00;
}

.response-accepted {
    background: #dcfce7;
    color: #166534;
}

.response-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.appointment-staff-note {
    margin: 14px 0;
    padding: 12px;
    background: #f4f6f8;
    border-radius: 7px;
}

.dentist-response-form {
    margin-top: 16px;
}

.dentist-response-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    resize: vertical;
    margin-top: 6px;
}

.dentist-response-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.accept-button {
    background: #15803d;
}

.accept-button:hover {
    background: #166534;
}

.reject-button {
    background: #b91c1c;
}

.reject-button:hover {
    background: #991b1b;
}

.response-time {
    margin-top: 10px;
    font-size: .82rem;
    color: #64748b;
}

.appointment-cancelled-box {
    margin-top: 14px;
    padding: 12px;
    border-radius: 7px;
    background: #f1f5f9;
}

@media (max-width: 700px) {

    .dentist-appointment-info {
        grid-template-columns: 1fr;
    }

    .dentist-appointment-top {
        flex-direction: column;
    }
}

/* Ajuste visual - observação do dentista */
.dentist-response-form textarea {
    display: block;
    width: 100% !important;
    max-width: none !important;
    min-width: 100%;
    min-height: 96px;
    box-sizing: border-box;
    padding: 12px 14px;
    margin-top: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
}

.dentist-response-actions {
    margin-top: 12px;
}

/* ======================================================
   RELATÓRIOS GERENCIAIS
   ====================================================== */

.report-filters {
    display: grid;
    grid-template-columns:
        minmax(130px, 1fr)
        minmax(130px, 1fr)
        minmax(150px, 1fr)
        minmax(170px, 1fr)
        auto;
    gap: 14px;
    align-items: end;
    margin-top: 20px;
}

.report-filters label {
    display: block;
    margin-bottom: 6px;
}

.report-filters input,
.report-filters select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
}

.report-filter-button {
    display: flex;
    align-items: end;
}

.report-filter-button button {
    white-space: nowrap;
}


.report-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.report-stat {
    text-align: center;
    padding: 20px 12px;
}

.report-stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #172033;
}

.report-stat-label {
    display: block;
    margin-top: 5px;
    font-size: .9rem;
    color: #64748b;
}


.report-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.report-metric-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.report-metric-row:last-child {
    border-bottom: 0;
}

.report-metric-row small {
    color: #64748b;
    font-weight: normal;
}

.report-id {
    max-width: 170px;
    word-break: break-all;
    font-family: monospace;
    font-size: .78rem;
    color: #64748b;
}


@media (max-width: 1000px) {

    .report-filters {
        grid-template-columns: 1fr 1fr;
    }

    .report-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .report-columns {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 600px) {

    .report-filters {
        grid-template-columns: 1fr;
    }

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

/* ======================================================
   DETALHE / HISTÓRICO DA MARCAÇÃO
   ====================================================== */

.report-id-link {
    font-family: monospace;
    font-weight: 700;
    text-decoration: none;
}

.appointment-detail-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px 32px;
    margin-top: 22px;
}

.appointment-detail-grid > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: .82rem;
    color: #64748b;
}

.history-note {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 7px;
    background: #f8fafc;
    line-height: 1.5;
}

.history-timeline {
    margin-top: 18px;
}

.history-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 20px;
    padding: 17px 0;
    border-bottom: 1px solid #e5e7eb;
}

.history-item:last-child {
    border-bottom: 0;
}

.history-date {
    font-family: monospace;
    font-size: .82rem;
    color: #64748b;
}

.history-content {
    min-width: 0;
}

.history-user {
    margin-top: 4px;
    font-size: .84rem;
    color: #64748b;
}

.history-change {
    margin-top: 9px;
}

.history-change span,
.history-change strong {
    margin-right: 5px;
}

.technical-id {
    font-family: monospace;
    font-size: .78rem;
    color: #64748b;
    word-break: break-all;
}

@media (max-width: 700px) {

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

    .history-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* Recuperação de senha - apresentação */

.forgot-password-link {
    text-align: center;
    margin-top: 14px;
}

.forgot-password-link a {
    font-size: .9rem;
    text-decoration: none;
    color: #475569;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

.password-help-card {
    text-align: center;
}

.password-help-info {
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    line-height: 1.5;
}

.password-back-button {
    display: inline-block;
    text-decoration: none;
    margin-top: 4px;
}

/* Link Esqueci minha senha */
.forgot-password-link a {
    color: #2563eb !important;
    font-weight: 500;
}

.forgot-password-link a:hover {
    color: #1d4ed8 !important;
}

/* Rodapé institucional KDTEC */
.kdtec-footer {
    text-align: center;
    color: #f97316 !important;
    font-size: 0.88rem;
    line-height: 1.6;
    font-weight: 500;
}

.kdtec-footer div {
    color: #f97316 !important;
}


/* Valor do exame - operador */
.exam-price-field {
    display: flex;
    align-items: center;
    max-width: 220px;
    margin-top: 6px;
}

.exam-price-prefix {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-right: 0;
    border-radius: 6px 0 0 6px;
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.exam-price-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 0 6px 6px 0;
    background: white;
}

/* Cadastro de dentistas - operador */

.recipient-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    margin-bottom: 8px;
}

.recipient-title-row label {
    margin: 0;
}

.dentist-form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 700px) {
    .recipient-title-row,
    .dentist-form-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Exclusão segura de dentistas */

.danger-button {
    background: #b91c1c;
    color: #ffffff;
    border: 0;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
}

.danger-button:hover {
    background: #991b1b;
}


/* Seletor flutuante de dentistas */

.dentist-dropdown {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin-bottom: 20px;
}

.dentist-dropdown-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    cursor: pointer;
    font-size: 15px;
}

.dentist-dropdown-button:hover {
    background: #f8fafc;
}

.dentist-dropdown-arrow {
    margin-left: 12px;
    font-size: 11px;
}

.dentist-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
    padding: 10px;
}

.dentist-dropdown-menu.open {
    display: block;
}

.dentist-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.dentist-dropdown-list {
    max-height: 260px;
    overflow-y: auto;
}

.dentist-dropdown-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 7px;
    border-radius: 5px;
    cursor: pointer;
}

.dentist-dropdown-option:hover {
    background: #f1f5f9;
}

.dentist-dropdown-option input {
    margin: 0;
}


/* Garante que o seletor permaneça fechado */
.dentist-dropdown-menu[hidden] {
    display: none !important;
}


/* Formulário de envio de exames - layout organizado */

.exam-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    gap: 22px 28px;
    align-items: start;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-field label {
    margin: 0;
}

.form-field-patient {
    grid-column: 1;
}

.form-field-price {
    grid-column: 2;
}

.form-field-recipients,
.form-field-files,
.form-field-notes {
    grid-column: 1 / -1;
}

.form-field-recipients .recipient-title-row {
    margin: 0 0 8px 0;
}

.form-field-recipients .dentist-dropdown {
    max-width: 520px;
    margin-bottom: 0;
}

.form-field-files input[type="file"] {
    max-width: 520px;
}

.form-field-notes .exam-textarea {
    width: 100%;
    min-height: 110px;
    box-sizing: border-box;
}

.optional-label {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
}

.form-field-price .exam-price-field {
    max-width: none;
    margin-top: 0;
}

.form-field-price .exam-price-field input {
    min-width: 0;
}

@media (max-width: 760px) {
    .exam-form-grid {
        grid-template-columns: 1fr;
    }

    .form-field-patient,
    .form-field-price,
    .form-field-recipients,
    .form-field-files,
    .form-field-notes {
        grid-column: 1;
    }
}


.exam-form-single {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 760px;
}

.exam-form-single .form-field {
    width: 100%;
}

.exam-form-single .exam-price-field {
    max-width: 320px;
}

.exam-form-single .dentist-dropdown {
    max-width: 520px;
}

.exam-form-single .exam-textarea {
    width: 100%;
    box-sizing: border-box;
}


/* Seletor definitivo de dentistas */

.dentist-picker {
    position: relative;
    width: 100%;
    max-width: 520px;
}

.dentist-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.dentist-picker summary::-webkit-details-marker {
    display: none;
}

.dentist-picker summary::after {
    content: "▼";
    font-size: 11px;
    margin-left: 12px;
}

.dentist-picker[open] summary::after {
    content: "▲";
}

.dentist-picker-panel {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,.14);
}

.dentist-picker-list {
    max-height: 260px;
    overflow-y: auto;
}

.dentist-picker-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 5px;
    cursor: pointer;
}

.dentist-picker-option:hover {
    background: #f1f5f9;
}

.dentist-picker-option input {
    margin: 0;
}


/* Upload seguro */

.upload-status-box {
    margin-top: 20px;
    max-width: 760px;
    padding: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.upload-status-line {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 9px;
}

.upload-progress-track {
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    background: #2563eb;
    transition: width .15s linear;
}

.upload-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 600;
}

#examSubmitButton:disabled {
    opacity: .65;
    cursor: not-allowed;
}


/* Últimos envios */

.recent-exams-table th {
    white-space: nowrap;
}

.recent-exams-table td {
    vertical-align: middle;
}

.exam-price-column {
    white-space: nowrap;
}

.recent-dentist-name {
    margin-bottom: 5px;
    white-space: nowrap;
}

.recent-status-row {
    min-height: 27px;
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.recent-date {
    white-space: nowrap;
}

.recent-files-count {
    text-align: center;
}


/* Barra de progresso KDTEC */
.upload-progress-bar {
    background: #f97316 !important;
}


/* =========================================================
   Últimos envios - operador
   ========================================================= */

.recent-exams-table {
    width: 100%;
}

.recent-exams-table th,
.recent-exams-table td {
    vertical-align: middle;
}

.recent-exams-table th:first-child,
.recent-exams-table td:first-child,
.recent-exams-table .recent-date,
.recent-exams-table .exam-price-column,
.recent-exams-table .recent-files-count {
    white-space: nowrap;
}

.recent-recipient-column {
    min-width: 210px;
}

.recent-recipient {
    padding: 6px 0;
}

.recent-recipient + .recent-recipient {
    margin-top: 7px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.recent-recipient-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.recent-recipient-name {
    color: #1f2937;
}

.recent-view-info {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.recent-exams-table td:last-child {
    white-space: nowrap;
}


/* Dentista + status na lista de últimos envios */
.recent-recipient {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 4px 0;
}

.recent-recipient .recent-dentist-name {
    min-width: 0;
}

/* Paginação - Meus exames */
.exam-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.pagination-info {
    color: #64748b;
    font-size: 14px;
}

/* Detalhe do exame */
.exam-back-button {
    background: #2563eb;
    color: #fff;
}

.exam-download-button {
    background: #f97316;
    color: #fff;
}

.exam-back-button:hover {
    background: #1d4ed8;
}

.exam-download-button:hover {
    background: #ea580c;
}

/* Força as cores específicas no detalhe do exame */
a.button.exam-back-button {
    background: #2563eb !important;
    color: #fff !important;
}

a.button.exam-download-button {
    background: #f97316 !important;
    color: #fff !important;
}

a.button.exam-back-button:hover {
    background: #1d4ed8 !important;
}

a.button.exam-download-button:hover {
    background: #ea580c !important;
}

/* Cadastro de dentistas */
.dentist-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px 26px;
    margin-top: 26px;
}

.dentist-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dentist-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.dentist-field input {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
}

.dentist-field small {
    display: block;
    margin-top: 7px;
    line-height: 1.35;
    opacity: .72;
}

.dentist-field-password {
    grid-column: 1 / 2;
}

.dentist-form-actions {
    margin-top: 26px;
}

@media (max-width: 760px) {
    .dentist-form-grid {
        grid-template-columns: 1fr;
    }

    .dentist-field-password {
        grid-column: auto;
    }
}

/* Cadastro de dentistas - harmonização final */
.card form.dentist-create-form {
    display: block !important;
    width: 100% !important;
}

.card form.dentist-create-form .dentist-form-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 24px 28px !important;
    width: 100% !important;
    margin-top: 26px !important;
}

.card form.dentist-create-form .dentist-field {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
}

.card form.dentist-create-form .dentist-field label {
    display: block !important;
    width: auto !important;
    margin: 0 0 7px 0 !important;
    font-weight: 600 !important;
}

.card form.dentist-create-form .dentist-field input {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 42px !important;
    margin: 0 !important;
}

.card form.dentist-create-form .dentist-field small {
    display: block !important;
    width: 100% !important;
    margin-top: 7px !important;
    line-height: 1.35 !important;
    opacity: .72 !important;
}

.card form.dentist-create-form .dentist-field-password {
    grid-column: 1 / 2 !important;
}

.card form.dentist-create-form .dentist-form-actions {
    display: block !important;
    margin-top: 26px !important;
}

@media (max-width: 760px) {
    .card form.dentist-create-form .dentist-form-grid {
        grid-template-columns: 1fr !important;
    }

    .card form.dentist-create-form .dentist-field-password {
        grid-column: auto !important;
    }
}

/* Recuperação de senha */
.auth-page {
    margin: 0;
    min-height: 100vh;
    background: #f4f6f8;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 20px 24px;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 14px;
    padding: 34px 34px 30px;
    box-sizing: border-box;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

.auth-brand {
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: #163a63;
    margin-bottom: 22px;
}

.auth-card h1 {
    margin: 0 0 12px;
    text-align: center;
    font-size: 28px;
    line-height: 1.2;
    color: #17324d;
}

.auth-description {
    margin: 0 0 24px;
    text-align: center;
    color: #667085;
    line-height: 1.55;
    font-size: 15px;
}

.auth-form {
    width: 100%;
}

.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: #263b52;
}

.auth-field input {
    width: 100% !important;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid #cfd7df;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    background: #fff;
}

.auth-field input:focus {
    outline: none;
    border-color: #2467a9;
    box-shadow: 0 0 0 3px rgba(36, 103, 169, .10);
}

.auth-primary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    background: #2467a9;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.auth-primary-button:hover {
    filter: brightness(.95);
}

.auth-button-link {
    text-align: center;
}

.auth-link-row {
    margin-top: 18px;
    text-align: center;
}

.auth-link-row a {
    color: #2467a9;
    text-decoration: none;
    font-weight: 600;
}

.auth-info-box {
    margin: 0 0 24px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #f7f9fb;
    color: #5c6b7a;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.auth-error {
    margin-top: 7px;
    color: #b42318;
    font-size: 13px;
    line-height: 1.35;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    color: #ef7d00;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 20px 14px;
    }

    .auth-card {
        padding: 26px 22px;
    }

    .auth-card h1 {
        font-size: 24px;
    }
}

/* Painel comercial / financeiro */
.management-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0;
}

.management-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.management-stat-label {
    color: #667085;
    font-size: 14px;
    font-weight: 600;
}

.management-stat-value {
    color: #183b63;
    font-size: 27px;
    line-height: 1.15;
}

.management-comparison {
    font-size: 13px;
    font-weight: 600;
}

.management-comparison.positive {
    color: #16803b;
}

.management-comparison.negative {
    color: #b42318;
}

.management-comparison.neutral {
    color: #667085;
}

.management-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.management-section-header h3 {
    margin-top: 0;
    margin-bottom: 5px;
}

.management-period-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.management-evolution {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.management-evolution-row {
    display: grid;
    grid-template-columns: 95px minmax(120px, 1fr) 180px;
    align-items: center;
    gap: 16px;
}

.management-evolution-label {
    font-size: 14px;
    font-weight: 600;
    color: #344054;
}

.management-evolution-bar-wrap {
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: #edf1f5;
}

.management-evolution-bar {
    min-width: 2px;
    height: 100%;
    border-radius: 999px;
    background: #2467a9;
}

.management-evolution-value {
    text-align: right;
    font-weight: 700;
    color: #183b63;
}

.management-evolution-value small {
    display: block;
    margin-top: 2px;
    color: #667085;
    font-weight: 400;
}

@media (max-width: 980px) {
    .management-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .management-summary-grid {
        grid-template-columns: 1fr;
    }

    .management-section-header {
        flex-direction: column;
    }

    .management-evolution-row {
        grid-template-columns: 70px 1fr;
    }

    .management-evolution-value {
        grid-column: 2;
        text-align: left;
    }
}

/* Dashboard executivo - refinamentos */

.management-period-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin: 10px 0 22px;
    padding: 12px 15px;
    border-radius: 8px;
    background: #f7f9fb;
    color: #5f6f80;
    font-size: 13px;
}

.management-period-comparison strong {
    color: #263b52;
}

.management-recipient {
    padding: 3px 0;
    line-height: 1.35;
}

.management-evolution {
    margin-top: 6px;
}

.management-evolution-row {
    padding: 9px 0;
    border-bottom: 1px solid #eef1f4;
}

.management-evolution-row:last-child {
    border-bottom: 0;
}

.management-evolution-bar-wrap {
    height: 18px;
    background: #e9eef4;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
}

.management-evolution-bar {
    height: 18px;
    background: #2467a9;
    transition: width .25s ease;
}

.management-evolution-value {
    font-size: 15px;
}

.management-evolution-value small {
    font-size: 12px;
}

@media (max-width: 760px) {
    .management-period-comparison {
        flex-direction: column;
        gap: 6px;
    }
}

/* Dados clínicos básicos do paciente */
.patient-data-grid {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        minmax(150px, 1fr)
        minmax(150px, 1fr);
    gap: 16px;
    max-width: 760px;
}

.patient-data-grid .form-field {
    margin: 0;
}

.patient-data-grid input,
.patient-data-grid select {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 720px) {
    .patient-data-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Ajuste compacto dos dados do paciente */
.patient-data-grid {
    margin-top: -6px;
    margin-bottom: 4px;
}

.patient-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 8px 0 18px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f7f9fb;
    color: #5f6f80;
    font-size: 14px;
}

.patient-meta-row strong {
    color: #263b52;
}

@media (max-width: 680px) {
    .patient-meta-row {
        flex-direction: column;
        gap: 5px;
    }
}

/* Ferramentas da listagem de dentistas */
.dentist-list-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 18px 0 8px;
    flex-wrap: wrap;
}

.dentist-search-form {
    display: flex;
    gap: 8px;
    flex: 1 1 430px;
    max-width: 620px;
}

.dentist-search-form input[type="search"] {
    flex: 1;
    min-width: 230px;
}

.dentist-list-modes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dentist-search-result {
    margin-top: 10px;
    margin-bottom: 14px;
}

@media (max-width: 720px) {
    .dentist-list-tools {
        align-items: stretch;
    }

    .dentist-search-form {
        flex: 1 1 100%;
    }

    .dentist-list-modes {
        width: 100%;
    }
}

/* Ações dos exames recebidos */
.exam-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.exam-row-actions form {
    margin: 0;
}

.exam-row-actions button {
    white-space: nowrap;
}

/* Ações na lista de exames recebidos */
.exam-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.exam-row-actions form {
    margin: 0;
}

.exam-row-actions button {
    white-space: nowrap;
}
