/* ============================================
   Clube Alívio — Dashboard Médico
   Design System & Styles
   ============================================ */

/* === CSS Variables === */
:root {
    --primary: #6C3CE1;
    --primary-light: #8B5CF6;
    --primary-dark: #5B2DC9;
    --primary-glow: rgba(108, 60, 225, 0.3);
    --accent: #7CC1C8;
    --accent-dark: #5BA8B0;

    --bg-dark: #0f0f1a;
    --bg-main: #1a1a2e;
    --bg-card: #242737;
    --bg-card-hover: #2D3048;
    --bg-surface: #373C58;
    --bg-surface-light: #454B6B;
    --bg-input: #2D3048;

    --text-primary: #FFFFFF;
    --text-secondary: #B0B3C6;
    --text-muted: #7A7D8E;

    --success: #4CAF50;
    --success-light: #66BB6A;
    --warning: #FFC107;
    --warning-dark: #FF9800;
    --error: #EF5350;
    --error-dark: #D32F2F;
    --danger: #FF5252;

    --gradient-start: #6C3CE1;
    --gradient-end: #7CC1C8;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(108, 60, 225, 0.2);

    --sidebar-width: 260px;
    --topbar-height: 64px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--accent); }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-surface-light); }

/* === Screen Management === */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* === Utility === */
.hidden { display: none !important; }

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border: 1px solid rgba(108, 60, 225, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(108, 60, 225, 0.3);
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--bg-input);
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.toggle-password:hover { color: var(--text-secondary); }

.login-error {
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--error);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108, 60, 225, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-login {
    margin-top: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 24px;
}

/* Login Background Decoration */
.login-bg-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.bg-circle-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.bg-circle-2 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: -50px;
    left: -50px;
    animation: float 10s ease-in-out infinite reverse;
}

.bg-circle-3 {
    width: 200px;
    height: 200px;
    background: var(--primary-light);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
#dashboard-screen {
    display: none;
    min-height: 100vh;
}

#dashboard-screen.active {
    display: flex;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-dark);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar-brand h2 {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(108, 60, 225, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(108, 60, 225, 0.2), rgba(108, 60, 225, 0.1));
    color: var(--primary-light);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item i, .nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--error);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar i, .user-avatar svg {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: rgba(239, 83, 80, 0.1);
    color: var(--error);
}

.btn-logout i, .btn-logout svg {
    width: 18px;
    height: 18px;
}

/* === Main Content === */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    width: calc(100vw - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    min-width: 0;
    min-height: 100vh;
    position: relative;
}

/* === Topbar === */
.topbar {
    height: var(--topbar-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.sidebar-toggle:hover { background: var(--bg-surface); }

.page-title {
    font-size: 20px;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.topbar-date i, .topbar-date svg {
    width: 16px;
    height: 16px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.btn-icon i, .btn-icon svg {
    width: 18px;
    height: 18px;
}

/* === Loading Overlay === */
.loading-overlay {
    position: absolute;
    inset: var(--topbar-height) 0 0 0;
    background: rgba(15, 15, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-surface);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.loading-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* === Pages === */
.page {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === KPI Cards === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-grid-sm {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: rgba(255, 255, 255, 0.08);
}

.kpi-card-sm {
    padding: 20px;
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon i, .kpi-icon svg {
    width: 24px;
    height: 24px;
}

.kpi-icon-users {
    background: rgba(108, 60, 225, 0.15);
    color: var(--primary-light);
}

.kpi-icon-crises {
    background: rgba(124, 193, 200, 0.15);
    color: var(--accent);
}

.kpi-icon-intensity {
    background: rgba(255, 193, 7, 0.15);
    color: var(--warning);
}

.kpi-icon-alert {
    background: rgba(239, 83, 80, 0.15);
    color: var(--error);
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.kpi-card-sm .kpi-value {
    font-size: 24px;
}

.kpi-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-card-alert {
    border-color: rgba(239, 83, 80, 0.2);
    background: linear-gradient(135deg, var(--bg-card), rgba(239, 83, 80, 0.05));
}

.kpi-card-alert .kpi-value {
    color: var(--error);
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i, .card-header h3 svg {
    width: 18px;
    height: 18px;
    color: var(--primary-light);
}

.card-header-alert h3 i, .card-header-alert h3 svg {
    color: var(--error);
}

.card-body {
    padding: 20px 24px;
}

/* === Charts === */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    margin-bottom: 0;
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-container-sm {
    height: 280px;
}

.chart-container-lg {
    height: 400px;
}

/* === Tables === */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.tables-grid .card {
    margin-bottom: 0;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

#table-patients {
    table-layout: fixed;
}

#table-patients th,
#table-patients td,
#table-top-patients th,
#table-top-patients td {
    padding-left: 12px;
    padding-right: 12px;
}

#table-patients td:nth-child(1),
#table-patients td:nth-child(2),
#table-patients td:nth-child(3) {
    white-space: normal;
    word-break: break-word;
}

#table-patients th:nth-child(1),
#table-patients td:nth-child(1) {
    width: 24%;
}

#table-patients th:nth-child(2),
#table-patients td:nth-child(2) {
    width: 17%;
}

#table-patients th:nth-child(3),
#table-patients td:nth-child(3) {
    width: 12%;
}

#table-patients th:nth-child(4),
#table-patients td:nth-child(4) {
    width: 7%;
}

#table-patients th:nth-child(5),
#table-patients td:nth-child(5) {
    width: 10%;
}

#table-patients th:nth-child(6),
#table-patients td:nth-child(6) {
    width: 11%;
}

#table-patients th:nth-child(7),
#table-patients td:nth-child(7) {
    width: 13%;
}

.overview-full-card {
    margin-bottom: 24px;
}

.overview-medications-card .chart-container-sm {
    height: 320px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(108, 60, 225, 0.05);
}

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

/* === Buttons === */
.btn-view {
    background: rgba(108, 60, 225, 0.15);
    color: var(--primary-light);
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-view:hover {
    background: rgba(108, 60, 225, 0.3);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 20px;
    font-family: inherit;
    transition: var(--transition);
}

.btn-back:hover { color: var(--primary-light); }

.btn-back i, .btn-back svg {
    width: 18px;
    height: 18px;
}

/* === Alerts === */
.alert-banner {
    background: linear-gradient(135deg, rgba(239, 83, 80, 0.1), rgba(255, 152, 0, 0.1));
    border: 1px solid rgba(239, 83, 80, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.alert-banner i, .alert-banner svg {
    width: 32px;
    height: 32px;
    color: var(--error);
    flex-shrink: 0;
}

.alert-banner h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.alert-banner p {
    font-size: 13px;
    color: var(--text-secondary);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.alert-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border-left: 4px solid var(--error);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    cursor: pointer;
}

.alert-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.alert-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(239, 83, 80, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-item-icon i, .alert-item-icon svg {
    width: 20px;
    height: 20px;
    color: var(--error);
}

.alert-item-info {
    flex: 1;
}

.alert-item-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.alert-item-detail {
    font-size: 13px;
    color: var(--text-secondary);
}

.alert-item-days {
    font-size: 24px;
    font-weight: 800;
    color: var(--error);
    min-width: 60px;
    text-align: center;
}

.alert-item-days small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

/* === Patient Detail === */
.patient-header-card {
    background: linear-gradient(135deg, rgba(108, 60, 225, 0.15), rgba(124, 193, 200, 0.1));
    border: 1px solid rgba(108, 60, 225, 0.15);
    border-radius: var(--radius-xl);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.patient-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.patient-avatar-lg i, .patient-avatar-lg svg {
    width: 36px;
    height: 36px;
    color: white;
}

.patient-header-info h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.patient-header-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.patient-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.tag-purple {
    background: rgba(108, 60, 225, 0.2);
    color: var(--primary-light);
}

.tag-blue {
    background: rgba(124, 193, 200, 0.2);
    color: var(--accent);
}

.documents-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.documents-total-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: rgba(124, 193, 200, 0.15);
    color: var(--accent);
}

.documents-unread-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    background: rgba(239, 83, 80, 0.16);
    color: #FF8A80;
    border: 1px solid rgba(239, 83, 80, 0.18);
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.document-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
}

.document-card-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.document-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(108, 60, 225, 0.15);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.document-icon i,
.document-icon svg {
    width: 22px;
    height: 22px;
}

.document-info {
    min-width: 0;
    flex: 1;
}

.document-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.document-title-row h4 {
    font-size: 15px;
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.document-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.document-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-doc-secondary,
.btn-doc-danger {
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-doc-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.btn-doc-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-doc-danger {
    background: rgba(239, 83, 80, 0.15);
    color: #FF8A80;
}

.btn-doc-danger:hover {
    background: rgba(239, 83, 80, 0.28);
}

.btn-view:disabled,
.btn-doc-secondary:disabled,
.btn-doc-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* === Intensity Badge === */
.intensity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: white;
}

/* === Page Toolbar === */
.page-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i, .search-box svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-card);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.toolbar-info {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 32px;
}

/* === Chip Tags in Tables === */
.chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-surface);
    color: var(--text-secondary);
    margin: 1px 2px;
    white-space: nowrap;
}

.chip-trigger {
    background: rgba(255, 193, 7, 0.15);
    color: var(--warning);
}

.chip-symptom {
    background: rgba(239, 83, 80, 0.15);
    color: var(--error);
}

.chip-location {
    background: rgba(108, 60, 225, 0.15);
    color: var(--primary-light);
}

.chip-med {
    background: rgba(124, 193, 200, 0.15);
    color: var(--accent);
}

.chip-er {
    background: rgba(239, 83, 80, 0.2);
    color: var(--error);
    font-weight: 700;
}

.chip-pain-type {
    background: rgba(139, 92, 246, 0.15);
    color: #8B5CF6;
}

.chip-effectiveness {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: 2px;
}

.chip-document-category {
    background: rgba(108, 60, 225, 0.15);
    color: var(--primary-light);
}

.chip-document-read {
    background: rgba(76, 175, 80, 0.15);
    color: #66BB6A;
}

.chip-document-unread {
    background: rgba(239, 83, 80, 0.16);
    color: #FF8A80;
}

.chip-document-patient {
    background: rgba(124, 193, 200, 0.15);
    color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .kpi-grid-sm {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .tables-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-toggle {
        display: flex;
    }

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

    .page {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .kpi-grid,
    .kpi-grid-sm {
        grid-template-columns: 1fr;
    }

    .patient-header-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .patient-tags {
        justify-content: center;
    }

    .documents-header-meta,
    .document-card,
    .document-card-main,
    .document-actions,
    .detail-top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .document-actions {
        justify-content: stretch;
    }

    .login-card {
        margin: 16px;
        padding: 32px 24px;
    }

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

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }
}

/* === Sidebar Overlay for Mobile === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* === Animations === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-light) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

/* ============================================
   DOCTOR LOGIN / REGISTER STYLES
   ============================================ */

.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0 20px;
    gap: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.login-divider span {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-doctor-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Botões de acesso médico na tela de login */
.btn-doctor-action {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    background: transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    min-height: 48px;
}

.btn-doctor-action span {
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-doctor-action svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
}

/* Botão Entrar como Médico */
.btn-doctor-login-action {
    border: 1.5px solid rgba(139, 92, 246, 0.4);
    color: var(--primary-light);
}

.btn-doctor-login-action:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

/* Botão Cadastrar Médico */
.btn-doctor-register-action {
    border: 1.5px solid rgba(124, 193, 200, 0.4);
    color: var(--accent);
}

.btn-doctor-register-action:hover {
    background: rgba(124, 193, 200, 0.12);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 193, 200, 0.2);
}

/* Manter compatibilidade com .btn-outline existente em outros lugares */
.btn-outline {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1.5px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius);
    color: var(--primary-light);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.btn-outline:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-outline i, .btn-outline svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-doctor-register {
    border-color: rgba(124, 193, 200, 0.3);
    color: var(--accent);
}

.btn-doctor-register:hover {
    background: rgba(124, 193, 200, 0.1);
    border-color: var(--accent);
}

.btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    padding: 12px;
    margin-top: 16px;
    transition: var(--transition);
}

.btn-link:hover {
    color: var(--primary-light);
}

.btn-link i, .btn-link svg {
    width: 16px;
    height: 16px;
}

/* Register Card (wider) */
.register-card {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border: 1px solid rgba(108, 60, 225, 0.15);
}

.form-row {
    width: 100%;
}

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

/* Select styling */
.input-wrapper select {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--bg-input);
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.input-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-wrapper select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Date input */
.input-wrapper input[type="date"] {
    color-scheme: dark;
}

/* ============================================
   DOCTOR DASHBOARD STYLES
   ============================================ */

#doctor-dashboard-screen {
    display: none;
    min-height: 100vh;
}

#doctor-dashboard-screen.active {
    display: flex;
}

.doctor-welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(108, 60, 225, 0.15), rgba(124, 193, 200, 0.1));
    border: 1px solid rgba(108, 60, 225, 0.2);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.doctor-welcome-info h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.doctor-welcome-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.doctor-welcome-stat {
    text-align: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.doctor-welcome-stat .kpi-value {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.doctor-welcome-stat .kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Export button */
.btn-export {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(108, 60, 225, 0.4);
}

.btn-export i, .btn-export svg {
    width: 16px;
    height: 16px;
}

/* Detail top bar */
.detail-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.btn-back i, .btn-back svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   RESPONSIVE — DOCTOR SCREENS
   ============================================ */
@media (max-width: 768px) {
    .register-card {
        margin: 16px;
        padding: 24px 20px;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .doctor-welcome-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px;
    }

    #doctor-sidebar {
        transform: translateX(-100%);
    }

    #doctor-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    #doctor-sidebar .sidebar-close {
        display: flex;
    }

    #doctor-dashboard-screen .sidebar-toggle {
        display: flex;
    }

    #doctor-dashboard-screen .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
}


/* ==================== MELHORIAS v2.1 ==================== */

/* Botao Acesso Administrativo */
.login-admin-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 4px;
}

.btn-admin-login-action {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    color: #cbd5e1;
}

.btn-admin-login-action:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.35);
    color: #f1f5f9;
}

/* Erros de campo individuais */
.field-error {
    display: block;
    font-size: 11.5px;
    color: #f87171;
    margin-top: 4px;
    padding-left: 2px;
}

.field-error.hidden {
    display: none;
}

/* Input com erro */
.input-wrapper input.input-error,
.input-wrapper select.input-error {
    border-color: #f87171 !important;
    background: rgba(248, 113, 113, 0.06) !important;
}

/* Mensagem de sucesso (recuperacao de senha) */
.login-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.login-success.hidden {
    display: none;
}

/* Links abaixo do formulario de login do medico */
.login-links {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 4px;
}

.btn-link-small {
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
}

.btn-link-small:hover {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.08);
}

.btn-link-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== FEEGOW INTEGRATION ==================== */

/* Botão "Procurar no Feegow" dentro do patient-header-card */
.btn-feegow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #0E1020;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(124, 193, 200, 0.25);
    align-self: flex-start;
}
.btn-feegow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(124, 193, 200, 0.4);
}
.btn-feegow i {
    width: 16px;
    height: 16px;
}

/* Seção "Dados do Feegow" */
.feegow-card {
    border: 1px solid rgba(124, 193, 200, 0.25);
}
.feegow-card .card-header {
    background: linear-gradient(90deg, rgba(124, 193, 200, 0.1), transparent);
}
.feegow-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.feegow-chip {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(124, 193, 200, 0.15);
    color: var(--accent);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.btn-feegow-refresh {
    background: transparent;
    border: 1px solid rgba(124, 193, 200, 0.3);
    color: var(--accent);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}
.btn-feegow-refresh:hover {
    background: rgba(124, 193, 200, 0.1);
}
.btn-feegow-refresh i {
    width: 16px;
    height: 16px;
}

.feegow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.feegow-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border-radius: 10px;
    border-left: 3px solid var(--accent);
}
.feegow-field label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}
.feegow-field span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.feegow-particular {
    color: var(--accent);
    font-style: italic;
    font-weight: 600;
}

.feegow-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 20px 0 12px;
    font-weight: 600;
}
.feegow-subtitle i {
    width: 16px;
    height: 16px;
}
.feegow-meta {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Modal de match */
.feegow-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 25, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: feegow-fade-in 0.2s ease;
}
@keyframes feegow-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.feegow-modal-box {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.feegow-modal-box-wide {
    max-width: 780px;
}
.feegow-modal-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.feegow-modal-box h3 i {
    width: 22px;
    height: 22px;
    color: var(--accent);
}
.feegow-modal-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}
.feegow-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
}
.feegow-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.feegow-modal-query {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.feegow-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 0;
    color: var(--text-secondary);
}
.feegow-modal-error {
    background: rgba(239, 83, 80, 0.1);
    color: #EF5350;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin: 12px 0;
    border-left: 3px solid #EF5350;
}

.feegow-candidates {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}
.feegow-candidate {
    background: var(--bg-surface-light);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.15s ease;
}
.feegow-candidate:hover {
    border-color: rgba(124, 193, 200, 0.4);
}
.feegow-candidate h4 {
    font-size: 15px;
    color: var(--text-primary);
    margin: 0 0 10px;
}
.feegow-candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px 14px;
}
.feegow-candidate-grid div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.feegow-candidate-grid label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}
.feegow-candidate-grid span {
    font-size: 13px;
    color: var(--text-primary);
}
.feegow-candidate-grid em {
    color: var(--accent);
    font-style: italic;
}
.btn-feegow-confirm {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    align-self: flex-end;
}
.btn-feegow-confirm:hover:not(:disabled) {
    background: var(--primary-light);
}
.btn-feegow-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* patient-header-card precisa permitir o botão quebrar linha abaixo */
#page-patient-detail .patient-header-card {
    flex-wrap: wrap;
}

/* Feegow: row de botões */
.feegow-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
    width: 100%;
}
.btn-feegow-secondary {
    background: transparent !important;
    border: 1px solid rgba(124, 193, 200, 0.4) !important;
    color: var(--accent) !important;
    box-shadow: none !important;
}
.btn-feegow-secondary:hover {
    background: rgba(124, 193, 200, 0.1) !important;
}
.btn-feegow-sm {
    padding: 8px 14px;
    font-size: 12px;
}

/* Feegow: busca manual no modal */
.feegow-manual-search {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.feegow-manual-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}
.feegow-manual-input:focus {
    border-color: var(--accent);
}
.feegow-manual-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Feegow: chips de convênio small */
.feegow-chip-sm {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    vertical-align: middle;
    margin-left: 6px;
}
.feegow-chip-conv {
    background: rgba(124, 193, 200, 0.15);
    color: var(--accent);
}
.feegow-chip-part {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

/* Feegow: dropdown filtro de convênio */
.filter-select {
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 180px;
    transition: border-color 0.15s ease;
}
.filter-select:focus {
    border-color: var(--accent);
}
.filter-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}
