/* SADI - Design Minimalista */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #d3d3d3;
    --success-color: #3db4bb;
    --bs-btn-border-color: #3db4bb;
    --accent-color: #764ba2;
    --warning-color: #9f00ff;
    --danger-color: #ff6b6b;
    --dark-color: #2d3748;
    --highlight-text: #fdf039;
    --light-gray: #f7fafc;
    --border-color: #e2e8f0;
    --text-muted: #718096;
    --sidebar-width: 260px;
    --admin-topbar-height: 72px;
}

.btn-success{
  --bs-btn-color: #fff;
  --bs-btn-bg: #3db4bb;
  --bs-btn-border-color: #3db4bb;

  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #349ea4;

  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #2f8f94;
  --bs-btn-active-border-color: #2f8f94;

  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #3db4bb;
  --bs-btn-disabled-border-color: #3db4bb;
}

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

body {
    font-family: "Gotham Rounded", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--dark-color);
    background: var(--light-gray);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100%;
    overflow-x: hidden;
}

/* Navbar Admin */
body.admin-shell {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(900px 420px at 8% 12%, rgba(118, 75, 162, 0.14), transparent 62%),
        radial-gradient(900px 420px at 92% 92%, rgba(102, 126, 234, 0.16), transparent 62%),
        #faf8ff;
}

.admin-main {
    flex: 1 0 auto;
    padding: calc(var(--admin-topbar-height) + 18px) 0 1.75rem 0;
    position: relative;
}

.sadi-page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 33, 52, 0.45);
    backdrop-filter: blur(1px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility .15s ease;
}

.sadi-page-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sadi-page-loader__content {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.2rem;
    border: 1px solid var(--border-color);
    background: radial-gradient(300px 120px at 8% 12%, rgba(118, 75, 162, 0.14), transparent 62%), radial-gradient(300px 120px at 92% 92%, rgba(102, 126, 234, 0.16), transparent 62%), #faf8ff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    color: var(--dark-color);
    font-size: 14px;
    font-weight: 500;
}

.sadi-page-loader__icon {
    font-size: 1.4rem;
    color: var(--primary-color);
    animation: sadi-loader-spin 1s linear infinite;
}

.sadi-loader-inline {
    display: inline-block;
    color: currentColor;
    line-height: 1;
    animation: sadi-loader-spin 1s linear infinite;
}

@keyframes sadi-loader-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.admin-topbar {
    background: var(--primary-gradient) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 18px rgba(45, 55, 72, 0.18);
    margin: 0;
    margin-top: 0 !important;
    left: 0;
    min-height: var(--admin-topbar-height);
    padding: 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 1040;
}

.admin-topbar.navbar {
    padding-bottom: 0 !important;
    padding-top: 0 !important;
}

body.admin-shell > .admin-topbar:first-child {
    margin-top: 0 !important;
}

.admin-topbar__container {
    align-items: center;
    min-height: var(--admin-topbar-height);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.admin-topbar__brand {
    align-items: center;
    color: #ffffff !important;
    display: inline-flex;
    font-size: 1.55rem;
    font-weight: 500;
    gap: 0.65rem;
    letter-spacing: 0.25px;
    line-height: 1;
}

.admin-topbar__brand i {
    color: #ffffff;
    font-size: 1.35rem;
}

.admin-topbar .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: none;
}

.admin-topbar .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.admin-topbar .navbar-collapse {
    padding: 0;
}

.admin-topbar .navbar-nav {
    align-items: center;
    gap: 0.25rem;
}

.admin-topbar .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 16px;
    font-weight: 400;
    margin: 0;
    padding: 0.45rem 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.admin-topbar .nav-link i {
    margin-right: 0.2rem;
}

.admin-topbar .nav-link:hover,
.admin-topbar .nav-link:focus {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff !important;
}

.admin-topbar .nav-link.active {
    background: rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    color: #ffffff !important;
}

.admin-topbar .dropdown-menu {
    border: 1px solid rgba(102, 126, 234, 0.18);
    box-shadow: 0 10px 24px rgba(45, 55, 72, 0.16);
    margin-top: 0.5rem;
    padding: 0.35rem;
}

.admin-topbar .dropdown-item {
    color: var(--dark-color);
    font-size: 13px;
    margin: 0;
    padding: 0.5rem 0.8rem;
}

.admin-topbar .dropdown-item:hover,
.admin-topbar .dropdown-item:focus {
    background: rgba(102, 126, 234, 0.12);
    color: var(--primary-dark);
}

.admin-topbar .dropdown-item.active {
    background: rgba(102, 126, 234, 0.18);
    color: var(--primary-dark);
    font-weight: 600;
}

.admin-card-text {
    color: var(--light-gray);
    font-size: 16px;
    margin-top: 4px;
    font-weight: 500;
}

@media (min-width: 992px) {
    .admin-topbar .navbar-collapse {
        align-items: center;
        display: flex !important;
        justify-content: flex-end;
        position: static;
    }

    .admin-topbar__container {
        position: relative;
    }

    .admin-topbar__menu {
        left: 50%;
        margin: 0;
        position: absolute;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
    }

    .admin-topbar__account {
        margin-left: auto;
        position: relative;
        z-index: 2;
    }
}

@media (max-width: 991.98px) {
    .admin-topbar__brand {
        font-size: 1.2rem;
    }

    .admin-topbar .navbar-collapse {
        margin-top: 0.5rem;
    }

    .admin-topbar .navbar-nav {
        align-items: stretch;
    }

    .admin-topbar .nav-link {
        display: block;
        width: 100%;
    }
}

/* Sidebar */
.sidebar {
    background: white;
    box-shadow: none;
    border-right: 1px solid var(--border-color);
    width: var(--sidebar-width);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar .nav-link {
    color: #6c757d;
    padding: 12px 20px;
    margin: 0;
    border-radius: 0;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    font-size: 16px;
}

.sidebar .nav-link:hover {
    background: var(--light-gray);
    color: var(--dark-color);
    border-left-color: var(--border-color);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    color: var(--primary-color);
    font-weight: 500;
    border-left-color: var(--primary-color);
}

.main-content {
    min-height: 100vh;
}

/* Main content com sidebar (admin) */
.has-sidebar .main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
}

/* Cards */
.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
    overflow: hidden;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: white;
    color: var(--dark-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 400;
    font-size: 14px;
}

.card-header.bg-primary {
    background: var(--primary-gradient) !important;
    color: white;
    border: none;
}

.card-header.bg-success {
    background: var(--success-color) !important;
    color: white;
    border: none;
}

.card-header.bg-info {
    background: var(--primary-gradient) !important;
    color: white;
    border: none;
}

.card-header.bg-warning {
    background: var(--warning-color) !important;
    color: var(--highlight-text);
    border: none;
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 0;
    font-weight: 500;
    font-size: 12px;
}

.badge.bg-primary {
    background: var(--primary-gradient) !important;
    color: white;
}

.badge.bg-info {
    background: var(--primary-color) !important;
    color: white;
}

.badge.bg-success {
    background: var(--success-color) !important;
    color: white;
}

.badge.bg-warning {
    background: var(--warning-color) !important;
    color: var(--light-gray) !important;
}

.badge.bg-danger {
    background: var(--danger-color) !important;
    color: white;
}

.badge.bg-secondary {
    background: var(--secondary-color) !important;
    color: var(--dark-color);
}

.badge.bg-purple {
    background: var(--accent-color) !important;
    color: white;
}

/* Buttons */
.btn {
    border-radius: 0;
    font-weight: 400;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    text-align: center;
    line-height: normal;
    padding: 6px 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4293 100%);
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

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

.btn-outline-primary {
    color: var(--primary-color);
    background: transparent;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-outline-success {
    border: 1px solid var(--success-color);
    color: var(--success-color);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: white;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 0;
    background-color: var(--light-gray);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-color);
    border-radius: 0;
    font-weight: 500;
    transition: width 0.3s ease;
}

.progress-bar.bg-success {
    background: var(--success-color);
}

.progress-bar.bg-warning {
    background: var(--warning-color);
}

.progress-bar.bg-danger {
    background: var(--danger-color);
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 8px 12px;
    transition: border-color 0.2s ease;
    font-size: 14px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#formResposta .form-control,
#formResposta .form-select {
    border-color: var(--primary-dark);
}

#formResposta .form-control:focus,
#formResposta .form-select:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(85, 104, 211, 0.16);
}

.form-label {
    color: var(--dark-color);
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-check-input {
    border-radius: 4px;
    width: 1.2em;
    height: 1.2em;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

/* Questionários - seleção de procedimentos (create/edit) */
.procedimentos-dual-select {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
    height: 360px !important;
    min-height: 360px;
    max-height: 360px;
}

.procedimentos-dual-select option {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
    padding-top: .2rem;
    padding-bottom: .2rem;
}

.procedimentos-dual-row {
    align-items: stretch;
}

.procedimentos-select-overlay-wrap {
    position: relative;
}

.procedimentos-select-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    z-index: 2;
}

.procedimentos-select-overlay.is-success {
    color: var(--accent-color);
}

.procedimentos-select-overlay.is-error {
    color: var(--danger-color);
}

.procedimentos-select-overlay > div {
    display: inline-flex;
    align-items: center;
}

.procedimentos-select-mono {
    font-size: 12px !important;
}

.procedimentos-transfer-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.procedimentos-transfer-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.btn-procedimentos-transfer-create,
.btn-procedimentos-transfer-edit {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-procedimentos-transfer-create i,
.btn-procedimentos-transfer-edit i {
    font-size: 1.7rem;
    line-height: 1;
}

/* Alerts */
.alert {
    border: 1px solid !important;
    border-radius: 0;
    padding: 12px 16px;
    font-size: 14px;
}

.alert-success {
    background: white;
    color: var(--success-color);
    border-color: var(--success-color);
}

.alert-warning {
    background: white;
    color: #9f00ff;
    border-color: var(--warning-color);
}

.alert-danger {
    background: white;
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.alert-info {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-top: 4px;
}

.stats-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 6px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--light-gray);
}

/* Relatorios - cards de destaque */
.report-kpi-row .card {
    position: relative;
    border: 1px solid #dbe4ee;
    border-top-width: 4px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: 0 6px 18px rgba(31, 41, 55, 0.06);
}

.report-kpi-row .card .card-body {
    padding: 0.9rem 1rem;
}

.report-kpi-row .card small {
    color: #5f6f82 !important;
    font-weight: 500;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-kpi-row .card strong {
    display: inline-block;
    margin-top: 0.1rem;
    color: #1f2b3d;
    font-size: 1.35rem;
    font-weight: 700 !important;
    line-height: 1;
}

.report-kpi-row .col-md-2:nth-child(6n + 1) .card,
.report-kpi-row .col-md-3:nth-child(6n + 1) .card {
    border-top-color: #667eea;
}

.report-kpi-row .col-md-2:nth-child(6n + 2) .card,
.report-kpi-row .col-md-3:nth-child(6n + 2) .card {
    border-top-color: #f59e0b;
}

.report-kpi-row .col-md-2:nth-child(6n + 3) .card,
.report-kpi-row .col-md-3:nth-child(6n + 3) .card {
    border-top-color: #3b82f6;
}

.report-kpi-row .col-md-2:nth-child(6n + 4) .card,
.report-kpi-row .col-md-3:nth-child(6n + 4) .card {
    border-top-color: #22c55e;
}

.report-kpi-row .col-md-2:nth-child(6n + 5) .card,
.report-kpi-row .col-md-3:nth-child(6n + 5) .card {
    border-top-color: #14b8a6;
}

.report-kpi-row .col-md-2:nth-child(6n + 6) .card,
.report-kpi-row .col-md-3:nth-child(6n + 6) .card {
    border-top-color: #a855f7;
}

/* List Group Items */
.list-group-item {
    transition: all 0.2s ease;
}

.list-group-item:hover {
    border-left-color: var(--primary-color) !important;
    background-color: var(--light-gray);
}

/* Tables */
.table {
    border-radius: 0;
    overflow: visible;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.table thead th {
    background: var(--light-gray);
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 15px;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--light-gray);
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-right: 1px solid var(--border-color);
}

.table tbody td:last-child {
    border-right: none;
}

/* Sessões de Questionário (admin) */
.sessoes-table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    min-height: 400px;
}

.sessoes-table-responsive td,
.sessoes-table-responsive th {
    overflow: visible !important;
}

.sessoes-table-responsive table {
    font-size: 11px;
}

.sessoes-table-responsive table small {
    font-size: 11px;
}

.sessoes-table-responsive .dropdown-menu {
    z-index: 1065;
}

/* Public Forms - Questionário */
.wizard-container {
    max-width: 800px;
    margin: 0 auto;
}

.wizard-header {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    border-radius: 0;
}

.wizard-progress {
    margin: 1.5rem 0;
}

.wizard-progress .progress {
    height: 10px;
}

/* Modal */
.modal-header {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0;
    padding: 1rem 1.5rem;
}

.modal-content {
    border: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 1.5rem;
    font-size: 14px;
    color: var(--dark-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background: var(--light-gray);
}

.modal-title {
    font-size: 16px;
    font-weight: 500;
}

/* Modais de questão - layout amplo com rolagem interna única */
.modal-questionario-questao {
    max-width: min(1200px, 96vw);
}

/* Toast Notifications */
.toast {
    border: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
}

.toast-header {
    border-radius: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 15px;
}

.toast-header strong {
    font-size: 14px;
    font-weight: 500;
}

.toast-body {
    padding: 12px 15px;
    font-size: 14px;
    color: var(--dark-color);
    background: white;
}

.toast .btn-close {
    font-size: 11px;
}

/* Footer */
.footer-sadi {
    background: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 3px solid var(--primary-color);
}

.admin-shell .footer-sadi {
    margin-top: 0;
    position: relative;
}

.footer-sadi a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-sadi a:hover {
    color: white;
}

/* Input Groups */
.input-group {
    border-radius: 0;
}

.input-group .form-control,
.input-group .btn {
    border-radius: 0;
}

/* Dropdown */
.dropdown-menu {
    border-radius: 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: absolute !important;
    will-change: transform;
}

.dropdown-menu-end {
    right: 0;
    left: auto;
}

.dropdown-item {
    font-size: 14px;
    padding: 8px 16px;
}

.dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--dark-color);
}

/* Pagination */
.pagination {
    border-radius: 0;
}

.page-link {
    border-radius: 0;
    color: var(--primary-color);
    border-color: var(--border-color);
}

.page-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-dark);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Canvas de Assinatura */
.assinatura-canvas-wrapper {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    height: clamp(170px, 30vw, 220px);
}

#canvasAssinatura.assinatura-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

@media (max-width: 576px) {
    .assinatura-canvas-wrapper {
        height: 180px;
    }
}

/* Imagens na revisão (responsivo) */
.revisao-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.revisao-img--clickable {
    cursor: pointer;
}

@media (max-width: 768px) {
    .revisao-img {
        max-width: 100%;
    }
}

.letter-spacing-1 {
    letter-spacing: 0.1em;
}

.letter-spacing-2 {
    letter-spacing: 0.2em;
}

.letter-spacing-3 {
    letter-spacing: 0.3em;
}

strong {
    font-weight: 500 !important;
}

dt {
    font-weight: 500 !important;
}

.btn-group {
    gap: 6px !important;
}

/* Layout App */
:root {
    --sadi-primary: #55acba;
    --sadi-secondary: #0e3340;
    --brand-1: #667eea;
    --brand-2: #764ba2;
    --brand-3: #8a63c7;
    --brand-4: #9d7be0;
    --text-main: #1f1b2d;
    --card-line: #ded6f1;
    --panel-bg: #f6f3ff;
    --line: #ded6f1;
    --glass: rgba(255, 255, 255, 0.12);
    --glass-line: rgba(255, 255, 255, 0.28);
    --tablet-bg: #edf1f6;
    --tablet-surface: #ffffff;
    --tablet-border: #c7d2e2;
    --tablet-primary: #5f77e6;
    --tablet-primary-dark: #4b62cc;
    --tablet-text: #23324a;
    --tablet-muted: #6b7280;
}

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

.app-layout .main-content {
    flex: 1;
}

/* Login */
body.login-page {
    margin: 0;
    font-family: "Gotham Rounded", sans-serif;
    color: var(--text-main);
    background: radial-gradient(1200px 600px at 15% 10%, #efe9ff 0%, #f8f5ff 48%, #fcfbff 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    position: relative;
    isolation: isolate;
}

.login-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(to right, rgba(118, 75, 162, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(118, 75, 162, 0.06) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at 38% 40%, black 28%, transparent 88%);
    pointer-events: none;
}

.login-hero {
    position: relative;
    background:
        radial-gradient(600px 330px at 10% 12%, rgba(255, 255, 255, 0.20), transparent 60%),
        radial-gradient(500px 300px at 90% 92%, rgba(255, 255, 255, 0.14), transparent 65%),
        linear-gradient(140deg, var(--brand-1) 0%, var(--brand-2) 56%, var(--brand-3) 100%);
    color: #fff;
    padding: 56px;
    overflow: hidden;
}

.login-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 36px 36px;
    opacity: 0.25;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.25));
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 100%;
}

.hero-title {
    margin-bottom: 6px;
    font-size: clamp(28px, 3.2vw, 44px);
    line-height: 1.15;
    font-weight: 700;
}

.hero-title span {
    display: block;
    font-style: italic;
}

.hero-title small {
    display: block;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.35;
    font-weight: 500;
    margin-top: 8px;
    opacity: 0.92;
}

.hero-subtitle {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 20px;
    max-width: 620px;
}

.hero-visual {
    position: relative;
    min-height: 360px;
    margin: 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-hero {
    background: linear-gradient(160deg, #7665ff 0%, #000000 100%);
    overflow: hidden;
}


.hero-logo-wrap {
    width: 276px;
    height: 276px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.4));
    box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.08), 0 0 38px rgba(255, 255, 255, 0.38);
    z-index: 1;
}

.hero-logo {
    font-size: 178px;
    color: #4a3f87;
    transform-origin: center;
}

.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.52) 0%, rgba(248, 245, 255, 0.92) 100%);
}

.form-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    padding: 28px;
    box-shadow: 0 18px 42px rgba(84, 58, 139, 0.15);
    backdrop-filter: blur(10px);
}

.form-card h1 {
    font-size: 28px;
    margin: 0 0 8px;
    font-weight: 700;
}

.form-card p {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.login-page .form-control {
    border: 1.5px solid #d8e3ea;
    padding: 11px 13px;
    font-size: 15px;
}

.login-page .form-control:focus {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.17);
}

.btn-login {
    border: 0;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    padding: 12px 14px;
    font-weight: 500;
    font-size: 20px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #556bd8 0%, #6f4398 100%);
}

.login-forgot-link {
    color: var(--brand-2);
    text-decoration: none;
    font-weight: 500;
}

.login-forgot-link:hover {
    color: #5f3a8b;
    text-decoration: underline;
}

.security-note {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--panel-bg);
    border: 1px solid #ddd3f2;
    padding: 7px 10px;
}

@media (max-width: 1100px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero {
        padding: 32px 22px;
    }

    .login-form-side {
        padding: 22px;
    }
}

/* Recuperacao de senha */
body.password-recovery-page,
body.password-reset-page {
    margin: 0;
    font-family: "Gotham Rounded", sans-serif;
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 8% 12%, rgba(118, 75, 162, 0.14), transparent 62%),
        radial-gradient(900px 420px at 92% 92%, rgba(102, 126, 234, 0.16), transparent 62%),
        #faf8ff;
    display: grid;
    place-items: center;
    padding: 18px;
}

.recovery-card,
.reset-card {
    width: 100%;
    border: 1px solid #ded6f1;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(84, 58, 139, 0.15);
    padding: 28px;
}

.recovery-card {
    max-width: 480px;
}

.reset-card {
    max-width: 520px;
}

.recovery-title,
.reset-title {
    margin: 0 0 6px;
    font-size: 30px;
    font-weight: 700;
    color: #2a2450;
}

.recovery-subtitle,
.reset-subtitle {
    margin: 0 0 22px;
    color: #6c6486;
    font-size: 15px;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 14px;
    color: #5e57a5;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #ded6f1;
    padding: 6px 10px;
    font-style: italic;
}

.calendario {
    display: inline-grid;
    place-items: center;
    padding: 10px 20px !important;
    background: #05050c57;
    border-radius: 12px !important;
    transform: skewX(-10deg);
    box-shadow: 4px 4px 10px rgba(94, 87, 165, 0.1);
    font-weight: 400;
    font-size: 18px !important;
}

.calendario span {
    transform: skewX(10deg); /* Corrige a inclinação do texto */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calendario .dia {
    font-size: 42px;
    line-height: 0.9;
    background: linear-gradient(135deg, #5e57a5, #8e85ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sadi-public-navbar {
    border-bottom: 1px solid var(--border-color);
}

body.public-question-page,
body.public-question-page .main-content {
    margin: 0 !important;
    padding: 0 !important;
}

body.public-question-page .bg-light.min-vh-100 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.public-question-page .sadi-public-navbar {
    margin-top: 0 !important;
}

.sadi-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
}

.sadi-brand__icon {
    color: #5e57a5 !important;
    font-size: 24px;
    line-height: 1;
}

.sadi-brand__text {
    color: #5e57a5 !important;
    font-style: italic;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.sadi-brand__suffix {
    color: #1f1b2d;
    font-size: 16px;
    font-weight: 600;
    font-style: normal;
}

.sadi-brand--inline {
    vertical-align: bottom;
}

.sadi-start-btn {
    padding: 12px 40px;
}

.password-recovery-page .btn-primary,
.password-reset-page .btn-primary {
    border: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 400;
}

.password-recovery-page .btn-primary:disabled {
    opacity: 0.85;
}

.password-recovery-page .form-control,
.password-reset-page .form-control,
.password-recovery-page .alert,
.password-reset-page .alert {
    border-radius: 0;
}

.helper-link {
    display: inline-block;
    margin-top: 14px;
    text-decoration: none;
    color: #5e57a5;
    font-weight: 500;
}

.helper-link:hover {
    text-decoration: underline;
}

/* Erros */
body.error-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Gotham Rounded", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(920px 430px at 12% 10%, rgba(102, 126, 234, 0.14), transparent 62%),
        radial-gradient(780px 390px at 88% 90%, rgba(118, 75, 162, 0.16), transparent 62%),
        #fbfaff;
}

.error-page .shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.error-card {
    width: 100%;
    max-width: 700px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    box-shadow: 0 22px 50px rgba(86, 58, 140, 0.16);
    padding: 40px 32px;
    text-align: center;
}

.error-403-page .error-card,
.error-404-page .error-card {
    max-width: 680px;
}

.error-page .code {
    font-size: clamp(52px, 7vw, 82px);
    line-height: 1;
    margin: 0 0 10px;
    color: #5f48a1;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.error-500-page .code {
    font-size: clamp(48px, 6vw, 76px);
}

.error-page h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
}

.error-page p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.error-page .actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-sadi {
    border: 0;
    padding: 10px 18px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
}

.btn-sadi:hover {
    color: #fff;
}

.btn-sadi-outline {
    border: 1px solid #c7bbeb;
    padding: 10px 18px;
    font-weight: 500;

    text-decoration: none;
    color: #5e4f90;
    background: #fff;
}

.btn-sadi-outline:hover {
    color: #4a3f7e;
}

/* Landing */
body.landing-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Gotham Rounded", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(900px 420px at 8% 12%, rgba(118, 75, 162, 0.14), transparent 62%),
        radial-gradient(900px 420px at 92% 92%, rgba(102, 126, 234, 0.16), transparent 62%),
        #faf8ff;
}

.landing-page .tech-grid,
.admin-shell .tech-grid,
.public-invalid-page .tech-grid,
.public-concluded-page .tech-grid,
.password-recovery-page .tech-grid,
.password-reset-page .tech-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(118, 75, 162, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(118, 75, 162, 0.08) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(circle at center, black 22%, transparent 82%);
}

.admin-shell .tech-grid {
    z-index: -1;
}

.password-recovery-page .recovery-card,
.password-reset-page .reset-card {
    position: relative;
    z-index: 1;
}

.public-concluded-page .tech-grid {
    background-image:
        linear-gradient(to right, rgba(61, 180, 187, 0.09) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(61, 180, 187, 0.09) 1px, transparent 1px);
}

.landing-page .shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.landing-page .panel {
    width: 100%;
    max-width: 760px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--card-line);
    box-shadow: 0 24px 50px rgba(87, 57, 142, 0.16);
    padding: 44px 34px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.landing-page .logo-wrap {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.landing-logo-icon {
    color: #3a1e88;
    font-size: 80px;
}

.landing-title {
    margin: 0;
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 800;
    color: #2d2450;
    font-style: italic;
}

.landing-page .subtitle {
    margin: 10px auto 22px;
    max-width: 590px;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.65;
}

.badge-tech {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    background: rgba(118, 75, 162, 0.1);
    border: 1px solid rgba(118, 75, 162, 0.2);
    color: #4b3b73;
    margin-bottom: 18px;
}

.landing-badge {
    font-weight: 400;
    font-size: 20px;
}

.landing-page .btn-login {
    border: 0;
    padding: 12px 26px;
    font-weight: 500;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 24px rgba(118, 75, 162, 0.26);
}

.landing-page .btn-login:hover {
    color: #fff;
    background: linear-gradient(135deg, #556bd8 0%, #6f4398 100%);
}

/* Publico invalido */
body.public-invalid-page {
    background: linear-gradient(135deg, #667eea42 0%, #ab6ee9a3 100%);
    min-height: 100vh;
}

.public-status-shell {
    position: relative;
    z-index: 1;
}

.public-invalid-page .error-card {
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.public-invalid-page .icon-wrapper {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.public-invalid-page .invalid-icon {
    font-size: 5rem;
}

.public-invalid-page .invalid-title {
    color: #764ba2;
}

.public-invalid-page .invalid-alert {
    border-left: 4px solid #667eea !important;
}

.public-invalid-page .invalid-info-icon {
    color: #667eea;
    font-size: 1.2rem;
}

.public-invalid-page .invalid-list {
    font-size: 0.95rem;
}

body.public-concluded-page {
    background: linear-gradient(135deg, #667eea42 0%, #ab6ee9a3 100%);
    min-height: 100vh;
}

.public-concluded-page .icon-wrapper {
    background: linear-gradient(135deg, #3db4bb 0%, #2f8f94 100%);
}

.public-concluded-page .invalid-title {
    color: #1e6b70;
}

.public-concluded-page .invalid-alert {
    border-left: 4px solid #3db4bb !important;
}

.public-concluded-page .invalid-info-icon {
    color: #2f8f94;
}

/* Tablet */
body.tablet-page {
    background: var(--tablet-bg);
    color: var(--tablet-text);
}

.tablet-page .tablet-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 20px 28px;
}

.tablet-page .tablet-header {
    border: 1px solid var(--tablet-border);
    background: linear-gradient(120deg, #5f77e6, #7451b8);
    color: #fff;
    padding: 16px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tablet-page .tablet-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.tablet-page .tablet-title-mark {
    display: block;
    font-style: italic;
    font-weight: 700;
}

.tablet-page .tablet-title-mode {
    display: block;
    font-style: normal;
    font-weight: 700;
}

.tablet-page .tablet-subtitle {
    margin: 0;
    opacity: 0.92;
    font-size: 0.95rem;
}

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

.tablet-page .tablet-card {
    border: 1px solid var(--tablet-border);
    background: var(--tablet-surface);
}

.tablet-page .tablet-card-head {
    border-bottom: 1px solid var(--tablet-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tablet-page .tablet-card-head h2 {
    font-size: 1.05rem;
    margin: 0;
    font-weight: 700;
}

.tablet-page .tablet-updated {
    font-size: 0.87rem;
    color: var(--tablet-muted);
}

.tablet-page .tablet-table-wrap {
    overflow-x: auto;
}

.tablet-page .tablet-table {
    margin: 0;
}

.tablet-page .tablet-table thead th {
    background: #f7f9fc;
    border-bottom: 1px solid var(--tablet-border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #48556a;
    white-space: nowrap;
}

.tablet-page .tablet-col-fila {
    width: 72px;
}

.tablet-page .tablet-col-pat {
    width: 150px;
}

.tablet-page .tablet-col-status,
.tablet-page .tablet-col-date {
    width: 170px;
}

.tablet-page .tablet-table td,
.tablet-page .tablet-table th {
    border-color: var(--tablet-border);
    vertical-align: middle;
}

.tablet-page .tablet-patient-link {
    color: var(--tablet-primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.tablet-page .tablet-patient-link:hover {
    text-decoration: underline;
}

.tablet-page .tablet-meta {
    font-size: 0.82rem;
    color: var(--tablet-muted);
}

.tablet-page .tablet-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--tablet-muted);
}

@media (max-width: 992px) {
    .tablet-page .tablet-shell {
        padding: 12px;
    }

    .tablet-page .tablet-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tablet-page .tablet-actions {
        width: 100%;
    }

    .tablet-page .tablet-actions .btn,
    .tablet-page .tablet-actions form {
        flex: 1 1 auto;
    }

    .tablet-page .tablet-actions .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .tablet-page .tablet-title {
        font-size: 1.25rem;
    }

    .tablet-page .tablet-subtitle {
        font-size: 0.9rem;
    }

    .tablet-page .tablet-card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .tablet-page .tablet-table-wrap {
        overflow: visible;
    }

    .tablet-page .tablet-table {
        min-width: 0;
    }

    .tablet-page .tablet-table thead {
        display: none;
    }

    .tablet-page .tablet-table,
    .tablet-page .tablet-table tbody,
    .tablet-page .tablet-table tr,
    .tablet-page .tablet-table td {
        display: block;
        width: 100%;
    }

    .tablet-page .tablet-table tr {
        border-bottom: 1px solid var(--tablet-border);
        padding: 10px 12px;
    }

    .tablet-page .tablet-table td {
        border: 0;
        padding: 6px 0;
    }

    .tablet-page .tablet-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #5f6f88;
        margin-bottom: 2px;
        font-weight: 700;
    }

    .tablet-page .tablet-empty {
        padding: 22px 14px;
    }
}
.questao-sortable-item .drag-handle {
    cursor: grab;
}

.questao-sortable-item .drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.6;
}

.sortable-chosen {
    background: #f8f9ff;
}
