:root {
    --primary: #0866ff;
    --primary-dark: #074fc2;
    --secondary: #12b886;
    --bg: #f4f7fb;
    --sidebar: #101827;
    --sidebar-hover: #1f2a3d;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #dbe3ef;
    --white: #ffffff;
    --danger: #dc3545;
    --warning: #f59f00;
    --success: #12b886;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(8,102,255,.16), transparent 30%),
        radial-gradient(circle at bottom right, rgba(18,184,134,.16), transparent 30%),
        #f4f7fb;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(15,23,42,.12);
    padding: 34px;
    border: 1px solid rgba(219,227,239,.9);
}

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

.login-logo img {
    max-width: 240px;
    max-height: 90px;
    object-fit: contain;
}

.logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    font-size: 30px;
    font-weight: 900;
    color: var(--primary);
}

.login-title {
    text-align: center;
    margin: 0 0 6px;
    font-size: 24px;
}

.login-subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 24px;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8,102,255,.12);
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-danger {
    background: #fff0f0;
    color: #a61e1e;
    border: 1px solid #ffc9c9;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 18px 14px;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 18px;
}

.sidebar-brand img {
    max-width: 210px;
    max-height: 74px;
    object-fit: contain;
}

.sidebar-brand .logo-fallback {
    color: #fff;
    font-size: 24px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d9e2f1;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--sidebar-hover);
    color: #fff;
}

.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
}

.navbar {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.navbar-logo {
    display: none;
}

.navbar-logo img {
    max-height: 42px;
    max-width: 160px;
    object-fit: contain;
}

.navbar-title {
    font-size: 20px;
    font-weight: 900;
}

.navbar-user {
    color: var(--muted);
    font-size: 14px;
    text-align: right;
}

.content {
    padding: 28px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 32px rgba(15,23,42,.05);
    margin-bottom: 20px;
}

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

.grid {
    display: grid;
    gap: 18px;
}

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

.metric {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 32px rgba(15,23,42,.05);
}

.metric-title {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.metric-value {
    font-size: 32px;
    font-weight: 900;
    margin-top: 8px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    text-align: left;
    font-size: 14px;
}

th {
    background: #f8fafc;
    font-weight: 900;
}

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

.footer {
    padding: 22px 28px;
    color: var(--muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer img {
    max-height: 34px;
    max-width: 150px;
    object-fit: contain;
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .navbar-logo {
        display: block;
    }

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

@media (max-width: 600px) {
    .content {
        padding: 18px;
    }

    .navbar {
        padding: 0 18px;
    }

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

    .login-card {
        padding: 26px;
    }
}

/* Ajuste visual da logomarca NexaClinic */
.login-logo,
.sidebar-brand,
.navbar-logo,
.footer span:last-child {
    background: #ffffff;
    border-radius: 18px;
}

.login-logo {
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
}

.sidebar-brand {
    background: #ffffff;
    padding: 12px;
    border-radius: 18px;
    margin: 0 4px 22px 4px;
    min-height: 86px;
}

.navbar-logo {
    padding: 6px 10px;
}

.footer span:last-child {
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
}

.sidebar-brand img {
    max-width: 210px;
    max-height: 62px;
}

.login-logo img {
    max-width: 280px;
    max-height: 105px;
}

.navbar-logo img {
    max-height: 38px;
    max-width: 150px;
}

.footer img {
    max-height: 30px;
    max-width: 145px;
}

/* NexaClinic - padrão visual de cadastro em caixa alta */
input[type="text"],
textarea,
select {
    text-transform: uppercase;
}

/* Campos que não devem ser forçados visualmente */
input[type="email"],
input[type="password"] {
    text-transform: none;
}

/* NexaClinic - identidade visual médica com ícones */
.sidebar {
    background:
        radial-gradient(circle at top left, rgba(18, 184, 134, .16), transparent 32%),
        linear-gradient(180deg, #071827 0%, #0b2135 52%, #071827 100%);
}

.sidebar-section-title {
    color: rgba(219, 234, 254, .58);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    padding: 12px 12px 8px;
    text-transform: uppercase;
}

.sidebar-menu a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #d9eefa;
    padding: 11px 12px;
    border-radius: 14px;
    margin-bottom: 7px;
    font-weight: 800;
    font-size: 14px;
    transition: all .18s ease;
    border: 1px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, .09);
    border-color: rgba(110, 231, 183, .20);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-menu a:hover .menu-icon,
.sidebar-menu a.active .menu-icon {
    background: linear-gradient(135deg, #0ea5e9, #14b8a6, #22c55e);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(20,184,166,.24);
}

.menu-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    color: #5eead4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 197, 253, .16);
    transition: all .18s ease;
}

.menu-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-sair {
    margin-top: 18px;
    color: #ffd6d6 !important;
}

.menu-sair .menu-icon {
    color: #ff8787;
}

.menu-sair:hover .menu-icon {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #ffffff;
}

.sidebar-brand {
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

/* NexaClinic - cabeçalhos internos com identidade médica */
.page-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(20,184,166,.20), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f0fdfa 48%, #eff6ff 100%);
    border: 1px solid rgba(14,165,233,.18);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 18px 42px rgba(15,23,42,.07);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.page-hero::before {
    content: "";
    position: absolute;
    right: -42px;
    top: -42px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(14,165,233,.10);
}

.page-hero::after {
    content: "";
    position: absolute;
    right: 68px;
    bottom: -62px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(34,197,94,.10);
}

.page-hero-left {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.page-hero-icon {
    width: 68px;
    height: 68px;
    min-width: 68px;
    border-radius: 22px;
    background: linear-gradient(135deg, #0ea5e9, #14b8a6, #22c55e);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(20,184,166,.26);
}

.page-hero-icon svg {
    width: 35px;
    height: 35px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page-hero h1 {
    margin: 0 0 5px 0;
    font-size: 27px;
    font-weight: 900;
    color: #0f172a;
}

.page-hero p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
}

.page-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Cards internos mais clínicos */
.content > .card {
    border-radius: 22px;
    border-color: rgba(148, 163, 184, .24);
}

.card h2 {
    color: #0f172a;
    font-size: 21px;
    font-weight: 900;
}

.table-wrap {
    border-color: rgba(148, 163, 184, .28);
}

th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    color: #0f172a;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0f766e);
}

@media (max-width: 700px) {
    .page-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .page-hero-left {
        align-items: flex-start;
    }

    .page-hero-icon {
        width: 58px;
        height: 58px;
        min-width: 58px;
        border-radius: 18px;
    }

    .page-hero-icon svg {
        width: 30px;
        height: 30px;
    }

    .page-hero h1 {
        font-size: 23px;
    }
}

/* NexaClinic - formulários internos */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.form-grid-filtros {
    display: grid;
    grid-template-columns: 1fr 220px 140px;
    gap: 12px;
    align-items: end;
}

.input-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220,53,69,.12) !important;
}

.btn-secondary {
    background: #e9ecef;
    color: #343a40;
}

.btn-small {
    padding: 8px 10px;
    font-size: 13px;
}

.btn-info {
    background: #e7f5ff;
    color: #1864ab;
}

.btn-edit {
    background: #edf2ff;
    color: #1c4ed8;
}

.btn-danger-soft {
    background: #fff0f0;
    color: #c92a2a;
}

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

.info-grid div {
    background: #f8fafc;
    border: 1px solid rgba(148,163,184,.24);
    border-radius: 14px;
    padding: 14px;
}

@media (max-width: 900px) {
    .form-grid-2,
    .form-grid-3,
    .form-grid-filtros,
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* NexaClinic - busca automática de CEP */
.input-loading {
    background-image: linear-gradient(90deg, rgba(14,165,233,.08), rgba(20,184,166,.14), rgba(14,165,233,.08));
    background-size: 200% 100%;
    animation: ncLoadingInput 1s linear infinite;
}

@keyframes ncLoadingInput {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* NexaClinic - identificação/documentos de pacientes */
.responsavel-box {
    border: 1px solid rgba(14,165,233,.18);
    background: linear-gradient(135deg, #f0fdfa, #eff6ff);
    border-radius: 18px;
    padding: 18px;
    margin: 8px 0 20px;
}

/* NexaClinic - listagem de menores vinculados ao responsável */
.linha-menor-sem-cpf {
    background: linear-gradient(90deg, rgba(236,254,255,.85), rgba(255,255,255,1));
}

.badge-menor {
    display: inline-flex;
    align-items: center;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ecfeff;
    color: #0369a1;
    border: 1px solid rgba(14,165,233,.22);
    font-size: 11px;
    font-weight: 900;
}

.hint-pacientes {
    margin-top: 14px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

/* NexaClinic - espaçamento dos botões de ação nas tabelas */
td .btn,
.table-wrap td .btn {
    margin: 3px 4px 3px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

td .btn:last-child,
.table-wrap td .btn:last-child {
    margin-right: 0;
}

.btn-small {
    min-width: 82px;
    text-align: center;
}

.table-wrap td:last-child {
    line-height: 2.4;
}

@media (max-width: 900px) {
    .table-wrap td .btn {
        margin-bottom: 6px;
    }
}

/* NexaClinic - botões compactos nas ações das tabelas */
.table-wrap td:last-child {
    white-space: nowrap;
    line-height: 1.4 !important;
}

.table-wrap td .btn,
td .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 2px 2px;
    padding: 6px 7px !important;
    min-width: auto !important;
    height: 30px;
    font-size: 12px !important;
    line-height: 1 !important;
    border-radius: 9px;
    white-space: nowrap;
}

.btn-small {
    min-width: auto !important;
    padding: 6px 7px !important;
    font-size: 12px !important;
}

@media (max-width: 900px) {
    .table-wrap td:last-child {
        white-space: normal;
    }

    .table-wrap td .btn {
        margin-bottom: 5px;
    }
}

/* NexaClinic - Agendamentos e Recepção */
.agenda-filtros {
    display: grid;
    grid-template-columns: 170px 1fr 260px 190px 120px;
    gap: 12px;
    align-items: end;
}

.agenda-recepcao-filtros {
    display: grid;
    grid-template-columns: 220px 120px 180px;
    gap: 12px;
    align-items: end;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.badge-agendado {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid rgba(29,78,216,.18);
}

.badge-confirmado {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid rgba(4,120,87,.18);
}

.badge-chegou {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid rgba(194,65,12,.18);
}

.badge-atendimento {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid rgba(3,105,161,.18);
}

.badge-finalizado {
    background: #f8fafc;
    color: #334155;
    border: 1px solid rgba(51,65,85,.18);
}

.badge-cancelado {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid rgba(185,28,28,.18);
}

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

.recepcao-card {
    background: #ffffff;
    border: 1px solid rgba(148,163,184,.24);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 14px 34px rgba(15,23,42,.06);
}

.recepcao-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(148,163,184,.18);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.recepcao-hora {
    color: #0284c7;
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 5px;
}

.recepcao-card h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    color: #0f172a;
}

.recepcao-card p {
    margin: 4px 0 0;
    color: #64748b;
    font-weight: 600;
}

.recepcao-info {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 14px;
    margin-bottom: 14px;
}

.recepcao-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

@media (max-width: 1100px) {
    .agenda-filtros,
    .agenda-recepcao-filtros,
    .recepcao-grid {
        grid-template-columns: 1fr;
    }
}

/* NexaClinic - Grade Médica */
.admin-agenda-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-agenda-links .btn {
    margin-right: 0;
}


/* NexaClinic - fluxo Agendamentos x Recepção */
.fluxo-agenda-info,
.fluxo-recepcao-info {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
}

.fluxo-agenda-info {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
    border: 1px solid rgba(37, 99, 235, .18);
    color: #1e3a8a;
}

.fluxo-recepcao-info {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid rgba(5, 150, 105, .18);
    color: #065f46;
}

.fluxo-agenda-info strong,
.fluxo-recepcao-info strong {
    color: #0f172a;
}

.btn-eventual {
    opacity: .82;
}

/* NexaClinic - cards da recepção mais finos e horizontais */
.recepcao-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}

.recepcao-card {
    padding: 14px 16px !important;
    border-radius: 18px !important;
}

.recepcao-top {
    display: grid !important;
    grid-template-columns: 90px minmax(220px, 1.4fr) minmax(280px, 2fr) auto !important;
    align-items: center !important;
    gap: 14px !important;
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.recepcao-top > div:first-child {
    display: contents !important;
}

.recepcao-hora {
    margin: 0 !important;
    font-size: 22px !important;
    color: #0284c7 !important;
    white-space: nowrap;
}

.recepcao-card h2 {
    font-size: 16px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.recepcao-card p {
    margin: 3px 0 0 !important;
    font-size: 13px !important;
}

.recepcao-info {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px 12px !important;
    margin: 0 !important;
    font-size: 13px !important;
}

.recepcao-info div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recepcao-acoes {
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 5px !important;
}

.recepcao-acoes .btn {
    height: 29px !important;
    padding: 5px 7px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
}

@media (max-width: 1200px) {
    .recepcao-top {
        grid-template-columns: 80px minmax(180px, 1fr) minmax(220px, 1.4fr) !important;
    }

    .recepcao-top > .status-badge {
        grid-column: 1 / 2;
    }

    .recepcao-acoes {
        grid-column: 2 / 4;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 800px) {
    .recepcao-top {
        display: block !important;
    }

    .recepcao-top > div:first-child {
        display: block !important;
    }

    .recepcao-info {
        grid-template-columns: 1fr !important;
        margin-top: 10px !important;
    }

    .recepcao-acoes {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        margin-top: 10px !important;
    }
}

/* NexaClinic - padrão visual suave para cards/listagens */
.content > .card,
.card.listagem-card,
.recepcao-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, #eefcff 100%);
    border: 1px solid rgba(148, 163, 184, .22);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .055);
}

.card h2 {
    color: #0f172a;
}

.table-wrap {
    background: rgba(255, 255, 255, .72);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .18);
    overflow: auto;
}

.table-wrap table {
    background: transparent;
}

.table-wrap thead th {
    background: linear-gradient(135deg, #f8fafc, #eef6ff);
    color: #0f172a;
    font-weight: 900;
    border-bottom: 1px solid rgba(148, 163, 184, .26);
}

.table-wrap tbody tr {
    background: rgba(255, 255, 255, .82);
}

.table-wrap tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, .86);
}

.table-wrap tbody tr:hover {
    background: linear-gradient(90deg, rgba(236, 254, 255, .92), rgba(239, 246, 255, .92));
}

.btn-success-soft {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid rgba(4, 120, 87, .22);
}

.btn-success-soft:hover {
    background: #d1fae5;
    color: #065f46;
}

/* Recepção: manter card fino e com degradê médico */
.recepcao-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 50%, #ecfdf5 100%) !important;
}

.recepcao-card:hover {
    border-color: rgba(8, 102, 255, .22);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .075);
}

/* Ações mais compactas para confirmar + consultar + editar + cancelar na mesma linha */
.table-wrap td:last-child {
    white-space: nowrap;
}

.table-wrap td .btn,
td .btn {
    margin: 2px 2px !important;
    padding: 5px 6px !important;
    height: 28px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
}

.btn-small {
    padding: 5px 6px !important;
    height: 28px !important;
    font-size: 11px !important;
    min-width: auto !important;
}

/* NexaClinic - botão Desconfirmar */
.btn-warning-soft {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid rgba(194, 65, 12, .22);
}

.btn-warning-soft:hover {
    background: #ffedd5;
    color: #9a3412;
}

/* NexaClinic - calendário visual de vagas */
.agenda-calendario-wrap {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 52%, #ecfeff 100%);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 20px;
    padding: 16px;
    margin: 16px 0 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .045);
}

.agenda-calendario-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.agenda-calendario-head strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
}

.agenda-calendario-head small {
    display: block;
    color: #64748b;
    font-weight: 600;
    margin-top: 3px;
}

.agenda-calendario-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.js-cal-titulo {
    min-width: 145px;
    text-align: center;
    font-weight: 900;
    color: #075985;
    font-size: 13px;
}

.agenda-calendario-semana,
.agenda-calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
}

.agenda-calendario-semana {
    margin-bottom: 7px;
}

.agenda-calendario-semana span {
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    color: #64748b;
}

.agenda-cal-dia {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 14px;
    min-height: 68px;
    padding: 8px 6px;
    background: rgba(255,255,255,.82);
    cursor: pointer;
    text-align: center;
    transition: .18s ease;
}

.agenda-cal-dia strong {
    display: block;
    font-size: 18px;
    color: #0f172a;
    line-height: 1;
}

.agenda-cal-dia span {
    display: block;
    font-size: 11px;
    margin-top: 7px;
    font-weight: 900;
}

.agenda-cal-dia.tem-vaga {
    background: linear-gradient(135deg, #ecfdf5, #eff6ff);
    border-color: rgba(5, 150, 105, .26);
}

.agenda-cal-dia.tem-vaga span {
    color: #047857;
}

.agenda-cal-dia.sem-vaga {
    opacity: .56;
    cursor: not-allowed;
    background: #f8fafc;
}

.agenda-cal-dia.sem-vaga span {
    color: #b91c1c;
}

.agenda-cal-dia.ativo,
.agenda-cal-dia.tem-vaga:hover {
    transform: translateY(-1px);
    border-color: rgba(8, 102, 255, .45);
    box-shadow: 0 10px 24px rgba(8, 102, 255, .13);
}

.agenda-cal-dia-vazio {
    background: transparent;
    border: 0;
    cursor: default;
    box-shadow: none;
}

.agenda-cal-vazio {
    grid-column: 1 / -1;
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    text-align: center;
}

/* NexaClinic - convênios por médico */
.convenios-medico-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.convenio-check-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 15px;
    padding: 12px;
    cursor: pointer;
}

.convenio-check-card input {
    margin-top: 3px;
}

.convenio-check-card strong {
    display: block;
    color: #0f172a;
}

.convenio-check-card small {
    display: block;
    color: #64748b;
    margin-top: 3px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .agenda-calendario-head,
    .agenda-calendario-nav {
        display: block;
    }

    .agenda-calendario-nav .btn,
    .agenda-calendario-nav span {
        margin-top: 8px;
    }

    .agenda-calendario-grid,
    .agenda-calendario-semana {
        gap: 4px;
    }

    .agenda-cal-dia {
        min-height: 58px;
        padding: 6px 4px;
    }

    .agenda-cal-dia strong {
        font-size: 15px;
    }

    .agenda-cal-dia span {
        font-size: 10px;
    }

    .convenios-medico-grid {
        grid-template-columns: 1fr;
    }
}

/* NexaClinic - convênios dentro do cadastro do médico */
.bloco-convenios-medico {
    margin-top: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 55%, #ecfeff 100%);
}

.texto-ajuda {
    color: #64748b;
    font-weight: 600;
    margin-top: -4px;
    margin-bottom: 14px;
}

.convenios-medico-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.convenio-check-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 15px;
    padding: 12px;
    cursor: pointer;
}

.convenio-check-card:hover {
    border-color: rgba(8, 102, 255, .28);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
}

.convenio-check-card input {
    margin-top: 3px;
}

.convenio-check-card strong {
    display: block;
    color: #0f172a;
}

.convenio-check-card small {
    display: block;
    color: #64748b;
    margin-top: 3px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .convenios-medico-grid {
        grid-template-columns: 1fr;
    }
}

/* NexaClinic - Especialidades */
.form-group small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-weight: 600;
}
