/* ============================================================
   Djantech UI — Design System próprio (sem Bootstrap CSS)
   Marca: primária laranja #E07B20 | secundária cinza-escuro #2D2D2D
   Dark mode: "Tema Pantera Negra" (data-theme="dark" no <html>)
   Obs.: os componentes .modal e .dropdown-menu mantêm os nomes de
   classe do Bootstrap 4 por compatibilidade com o Bootstrap JS
   (dependences/index.min.js) e com o push.js.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
   --primary: #e07b20;
   --primary-hover: #c4650f;
   --primary-soft: rgba(224, 123, 32, 0.1);
   --on-primary: #ffffff;
   --hero-accent: #2d2d2d;
   --secondary: #2d2d2d;
   --success: #10b981;
   --danger: #ef4444;
   --warning: #f59e0b;
   --info: #0ea5e9;
   --bg-color: #f8fafc;
   --card-bg: #ffffff;
   --text-main: #2d2d2d;
   --text-muted: #64748b;
   --border-color: #e2e8f0;
   --heading-color: #e07b20;
   --table-head-bg: #2d2d2d;
   --table-head-color: #ffffff;
   --brand-stripe: rgba(224, 123, 32, 0.08);
   --sidebar-bg: #2d2d2d;
   --sidebar-text: #d6d6d6;
   --sidebar-active: #e07b20;
   --topbar-bg: #ffffff;
   --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
   --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
   --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
   --radius-lg: 0.75rem;
   --radius-md: 0.5rem;
   --radius-sm: 0.25rem;
   --sidebar-width: 260px;
   --topbar-height: 64px;
   --transition-speed: 0.3s;
}

/* Tema Pantera Negra */
[data-theme='dark'] {
   --bg-color: #0d0d0d;
   --card-bg: #1a1a1a;
   --text-main: #f5f5f5;
   --text-muted: #9e9e9e;
   --border-color: #2d2d2d;
   --table-head-bg: #000000;
   --table-head-color: var(--primary);
   --brand-stripe: rgba(224, 123, 32, 0.12);
   --sidebar-bg: #000000;
   --sidebar-text: #bdbdbd;
   --topbar-bg: #1a1a1a;
   --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
   --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
   --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
   box-sizing: border-box;
}
html {
   font-size: 16px;
}
body {
   margin: 0;
   font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
   font-size: 0.875rem;
   line-height: 1.5;
   color: var(--text-main);
   background-color: var(--bg-color);
   transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}
h1, h2, h3, h4, h5, h6 {
   margin: 0 0 0.5rem 0;
   font-weight: 600;
   line-height: 1.2;
   color: var(--heading-color);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.9375rem; }
h6 { font-size: 0.875rem; }
p { margin: 0 0 0.75rem 0; }
a {
   color: var(--primary);
   text-decoration: none;
}
a:hover {
   color: var(--primary-hover);
}
img { max-width: 100%; }
ul { margin: 0; padding: 0; }
hr {
   border: 0;
   border-top: 1px solid var(--border-color);
   margin: 1rem 0;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- 3. Layout (shell / sidebar / topbar / conteúdo) ---------- */
.app-shell {
   display: flex;
   min-height: 100vh;
}
.app-sidebar {
   width: var(--sidebar-width);
   min-width: var(--sidebar-width);
   background: var(--sidebar-bg);
   color: var(--sidebar-text);
   display: flex;
   flex-direction: column;
   position: fixed;
   top: 0;
   left: 0;
   bottom: 0;
   z-index: 1030;
   transition: transform var(--transition-speed) ease;
   overflow-y: auto;
}
.app-main {
   flex: 1;
   min-width: 0;
   margin-left: var(--sidebar-width);
   display: flex;
   flex-direction: column;
   min-height: 100vh;
}
.app-content {
   flex: 1;
   padding: 1.5rem;
}
.sidebar-backdrop {
   display: none;
   position: fixed;
   inset: 0;
   background: rgba(0, 0, 0, 0.5);
   z-index: 1025;
}
@media (max-width: 1024px) {
   .app-sidebar { transform: translateX(-100%); }
   .app-main { margin-left: 0; }
   body.sidebar-open .app-sidebar { transform: translateX(0); }
   body.sidebar-open .sidebar-backdrop { display: block; }
}

/* ---------- 4. Sidebar ---------- */
.sidebar-brand {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 1rem 1.25rem;
   height: var(--topbar-height);
   border-bottom: 3px solid var(--primary);
   color: #fff;
}
.sidebar-brand img {
   width: 36px;
   height: 36px;
   object-fit: contain;
}
.sidebar-brand .brand-name {
   font-size: 1.125rem;
   font-weight: 700;
   color: #fff;
   margin: 0;
}
.sidebar-nav {
   list-style: none;
   padding: 0.75rem 0;
   flex: 1;
}
.sidebar-nav li { list-style: none; }
.sidebar-nav a {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.65rem 1.25rem;
   color: var(--sidebar-text);
   font-weight: 500;
   border-left: 3px solid transparent;
   transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.sidebar-nav a:hover {
   color: #fff;
   background: rgba(224, 123, 32, 0.15);
}
.sidebar-nav a.active {
   color: #fff;
   border-left-color: var(--sidebar-active);
   background: linear-gradient(90deg, rgba(224, 123, 32, 0.25), transparent);
}
.sidebar-nav a i {
   width: 20px;
   text-align: center;
   font-size: 0.9375rem;
   color: var(--primary);
}
.sidebar-nav .has-submenu > a::after {
   content: '\f107'; /* fa-angle-down */
   font-family: 'Font Awesome 6 Free', 'FontAwesome';
   font-weight: 900;
   margin-left: auto;
   transition: transform 0.2s;
}
.sidebar-nav .has-submenu.open > a::after {
   transform: rotate(180deg);
}
.sidebar-submenu {
   list-style: none;
   max-height: 0;
   overflow: hidden;
   transition: max-height var(--transition-speed) ease;
   background: rgba(0, 0, 0, 0.25);
}
.has-submenu.open > .sidebar-submenu {
   max-height: 600px;
}
.sidebar-submenu a {
   padding: 0.5rem 1.25rem 0.5rem 2.75rem;
   font-size: 0.8125rem;
   font-weight: 400;
}
.sidebar-footer {
   padding: 1rem 1.25rem;
   font-size: 0.75rem;
   color: var(--sidebar-text);
   border-top: 1px solid rgba(255, 255, 255, 0.08);
   text-align: center;
}
.sidebar-footer img { vertical-align: middle; }

/* Toasts (toastr) nunca devem cobrir as ações do topbar */
#toast-container.toast-top-right,
#toast-container.toast-top-full-width {
   top: calc(var(--topbar-height) + 10px) !important;
}

/* ---------- 5. Topbar ---------- */
.app-topbar {
   height: var(--topbar-height);
   background: var(--topbar-bg);
   border-bottom: 1px solid var(--border-color);
   display: flex;
   align-items: center;
   gap: 1rem;
   padding: 0 1.5rem;
   position: sticky;
   top: 0;
   z-index: 1020;
   transition: background-color var(--transition-speed) ease;
}
.topbar-title {
   font-size: 1.125rem;
   font-weight: 600;
   color: var(--text-main);
   margin: 0;
}
.topbar-actions {
   margin-left: auto;
   display: flex;
   align-items: center;
   gap: 0.75rem;
}
.icon-btn {
   background: var(--card-bg);
   border: 1px solid var(--border-color);
   color: var(--text-main);
   border-radius: 50%;
   width: 40px;
   height: 40px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   position: relative;
   transition: background-color 0.2s, border-color 0.2s;
   font-size: 1rem;
}
.icon-btn:hover,
.icon-btn:focus {
   background: var(--primary-soft);
   border-color: var(--primary);
   outline: 0;
}
.icon-btn-sm {
   width: 32px;
   height: 32px;
   font-size: 0.875rem;
}
.btn-group {
   display: inline-flex;
}
.btn-group .btn {
   border-radius: 0;
}
.btn-group .btn:first-child {
   border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.btn-group .btn:last-child {
   border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.btn-outline-primary.active {
   background: var(--primary);
   color: var(--on-primary);
}
.hamburger-btn { display: none; }
@media (max-width: 1024px) {
   .hamburger-btn { display: inline-flex; }
}
.nav-notify-badge {
   position: absolute;
   top: -4px;
   right: -4px;
   min-width: 18px;
   height: 18px;
   padding: 0 4px;
   font-size: 10px;
   font-weight: 700;
   color: #fff;
   background: var(--danger);
   border-radius: 9px;
   line-height: 18px;
   text-align: center;
}
.avatar-initials {
   width: 40px;
   height: 40px;
   border-radius: 50%;
   background: var(--primary);
   color: var(--on-primary);
   font-weight: 700;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   text-transform: uppercase;
   cursor: pointer;
}

/* ---------- 6. Dropdown (compatível com Bootstrap JS) ---------- */
.dropdown { position: relative; }
.dropdown-menu {
   display: none;
   position: absolute;
   top: 100%;
   left: 0;
   z-index: 1040;
   min-width: 12rem;
   padding: 0.5rem 0;
   margin: 0.25rem 0 0;
   background: var(--card-bg);
   border: 1px solid var(--border-color);
   border-radius: var(--radius-md);
   box-shadow: var(--shadow-lg);
   color: var(--text-main);
   animation: dropdownSlideIn 0.25s ease;
}
.dropdown-menu-right { right: 0; left: auto; }
.dropdown-menu.show { display: block; }
.dropdown-item {
   display: flex;
   align-items: center;
   width: 100%;
   padding: 0.5rem 1rem;
   color: var(--text-main);
   background: transparent;
   border: 0;
   white-space: nowrap;
}
.dropdown-item:hover {
   background: var(--brand-stripe);
   color: var(--text-main);
}
@keyframes dropdownSlideIn {
   from { opacity: 0; transform: translateY(8px); }
   to { opacity: 1; transform: translateY(0); }
}

/* Dropdown de notificações */
.notification-dropdown {
   min-width: 320px;
   padding: 0;
   overflow: hidden;
}
.notification-dropdown .dropdown-header,
.notification-dropdown .dropdown-footer {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0.75rem 1rem;
   background: var(--bg-color);
}
.notification-dropdown .dropdown-header { border-bottom: 1px solid var(--border-color); }
.notification-dropdown .dropdown-footer { border-top: 1px solid var(--border-color); justify-content: center; }
.notification-scroll {
   max-height: 380px;
   overflow-y: auto;
}
#notifications-list { list-style: none; padding: 0.5rem; margin: 0; }
.notification-item { list-style: none; }
.notification-item .timeline-panel {
   display: flex;
   align-items: flex-start;
   gap: 0.75rem;
   padding: 0.75rem;
   border-radius: var(--radius-sm);
   border-bottom: 1px solid var(--border-color);
   cursor: pointer;
}
.notification-item .timeline-panel:hover { background: var(--brand-stripe); }
.notification-item.unread .timeline-panel { background: var(--primary-soft); }
.notification-skeleton .skeleton-line {
   background: var(--border-color);
   border-radius: 4px;
   animation: pulse-skeleton 1.5s infinite;
}
@keyframes pulse-skeleton {
   0% { opacity: 0.6; }
   50% { opacity: 1; }
   100% { opacity: 0.6; }
}
.notify-modal-item {
   transition: background-color 0.2s ease;
   border-left: 4px solid transparent;
}
.notify-modal-item:hover { background-color: var(--brand-stripe); }
.notify-modal-item.unread {
   background-color: var(--primary-soft);
   border-left-color: var(--primary);
}

/* ---------- 7. Modal (compatível com Bootstrap JS) ---------- */
.fade { transition: opacity 0.15s linear; }
.fade:not(.show) { opacity: 0; }
.modal-open { overflow: hidden; }
.modal {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   z-index: 1050;
   width: 100%;
   height: 100%;
   overflow: hidden;
   outline: 0;
}
.modal-open .modal { overflow-x: hidden; overflow-y: auto; }
.modal-backdrop {
   position: fixed;
   inset: 0;
   z-index: 1045;
   background-color: #000;
}
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 0.55; }
.modal-dialog {
   position: relative;
   width: auto;
   max-width: 500px;
   margin: 1.75rem auto;
   pointer-events: none;
}
.modal.fade .modal-dialog {
   transform: translateY(-40px);
   transition: transform 0.3s ease-out;
}
.modal.show .modal-dialog { transform: none; }
.modal-dialog-centered {
   display: flex;
   align-items: center;
   min-height: calc(100% - 3.5rem);
}
.modal-lg { max-width: 800px; }
.modal-content {
   position: relative;
   display: flex;
   flex-direction: column;
   width: 100%;
   background: var(--card-bg);
   color: var(--text-main);
   border-radius: var(--radius-lg);
   box-shadow: var(--shadow-lg);
   pointer-events: auto;
   overflow: hidden;
}
.modal-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 1rem 1.25rem;
   background: var(--table-head-bg);
   border-bottom: 2px solid var(--primary);
}
.modal-header .modal-title {
   margin: 0;
   color: var(--table-head-color);
}
.modal-body { padding: 1.25rem; }
.modal-body.p-0 { padding: 0; }
.modal-footer {
   display: flex;
   align-items: center;
   justify-content: flex-end;
   gap: 0.5rem;
   padding: 0.75rem 1.25rem;
   border-top: 1px solid var(--border-color);
}
.close {
   background: transparent;
   border: 0;
   font-size: 1.5rem;
   line-height: 1;
   color: var(--table-head-color);
   cursor: pointer;
   opacity: 0.8;
}
.close:hover { opacity: 1; }
@media (max-width: 576px) {
   .modal-dialog { margin: 0.5rem; max-width: none; }
}

/* ---------- 8. Botões ---------- */
.btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.4rem;
   font-family: inherit;
   font-size: 0.875rem;
   font-weight: 500;
   padding: 0.5rem 1rem;
   border-radius: var(--radius-md);
   border: 1px solid transparent;
   cursor: pointer;
   transition: background-color 0.2s, border-color 0.2s, color 0.2s;
   text-decoration: none;
   line-height: 1.4;
}
.btn:focus { outline: 2px solid var(--primary-soft); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8125rem; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #1a1a1a; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(0.9); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.9); color: #fff; }
.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-warning:hover { filter: brightness(0.9); color: #1a1a1a; }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-success { border-color: var(--success); color: var(--success); background: transparent; }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-light { background: var(--border-color); color: var(--text-main); }
.btn-light:hover { filter: brightness(0.95); }
.rounded-pill { border-radius: 9999px; }

/* ---------- 9. Badges ---------- */
.badge {
   display: inline-block;
   padding: 0.3em 0.6em;
   font-size: 0.75em;
   font-weight: 700;
   line-height: 1;
   border-radius: var(--radius-sm);
   white-space: nowrap;
}
.badge-pill { border-radius: 9999px; padding-right: 0.9em; padding-left: 0.9em; }
.badge-primary { background: var(--primary); color: var(--on-primary); }
.badge-secondary { background: var(--secondary); color: #fff; }
.badge-success { background: var(--success); color: #fff; }
.badge-danger { background: var(--danger); color: #fff; }
.badge-warning { background: var(--warning); color: #1a1a1a; }
.badge-info { background: var(--info); color: #fff; }
.badge-light { background: var(--border-color); color: var(--text-main); }

/* ---------- 10. Cards / KPI ---------- */
.dashboard-card,
.card {
   background: var(--card-bg);
   border: 1px solid var(--border-color);
   border-radius: var(--radius-lg);
   padding: 1.5rem;
   box-shadow: var(--shadow-sm);
   transition: transform var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed);
   display: flex;
   flex-direction: column;
}
.dashboard-card:hover {
   transform: translateY(-2px);
   box-shadow: var(--shadow-md);
}
.card-title {
   font-size: 1.125rem;
   font-weight: 600;
   color: var(--heading-color);
   margin-bottom: 1rem;
}
.border-warning { border-color: var(--warning); }
.kpi-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
   gap: 1.5rem;
   margin-bottom: 2rem;
}
.kpi-card {
   flex-direction: row;
   align-items: center;
   justify-content: space-between;
}
.kpi-content h3 {
   font-size: 0.875rem;
   color: var(--text-muted);
   margin: 0 0 0.5rem 0;
   text-transform: uppercase;
   letter-spacing: 0.05em;
}
.kpi-content .value {
   font-size: 1.75rem;
   font-weight: 700;
   color: var(--text-main);
   margin: 0;
}
.kpi-icon {
   width: 48px;
   height: 48px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 1.5rem;
}
.kpi-icon.primary { background: var(--primary-soft); color: var(--primary); }
.kpi-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.kpi-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.kpi-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ---------- 11. Grids utilitários ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.main-grid {
   display: grid;
   grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
   gap: 1.5rem;
}
.record-grid {
   display: grid;
   grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
   gap: 1.5rem;
   align-items: start;
}
@media (max-width: 1024px) {
   .main-grid, .grid-3, .grid-2, .record-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 12. Tabelas e listas (Pantera Negra + listras da marca) ---------- */
.table, table.striped {
   width: 100%;
   border-collapse: collapse;
}
.table th, .table td, table.striped th, table.striped td {
   padding: 0.65rem 0.75rem;
   text-align: left;
   border-bottom: 1px solid var(--border-color);
}
.table thead th, table.striped thead th {
   background-color: var(--table-head-bg);
   color: var(--table-head-color);
   border-bottom: 2px solid var(--primary);
   font-weight: 600;
   text-transform: uppercase;
   font-size: 0.75rem;
   letter-spacing: 0.05em;
}
.table tbody tr:nth-child(even), table.striped tbody tr:nth-child(even) {
   background-color: var(--brand-stripe);
}
.table-responsive { overflow-x: auto; }
.data-list { list-style: none; padding: 0; margin: 0; }
.data-list li {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0.6rem 0.75rem;
   border-bottom: 1px solid var(--border-color);
   color: var(--text-main);
}
.data-list li:nth-child(even) { background-color: var(--brand-stripe); }
.data-list li:last-child { border-bottom: none; }

/* ---------- 12b. DsTable (componente JS de tabela, ver features/tables/DsTable.js) ---------- */
.ds-table {
   --ds-table-radius: var(--radius-lg);
   --ds-table-gap: 12px;
   --ds-table-bg: var(--card-bg);
   --ds-table-surface: var(--card-bg);
   --ds-table-text: var(--text-main);
   --ds-table-muted: var(--text-muted);
   --ds-table-border: var(--border-color);
   --ds-table-primary: var(--primary);
   --ds-table-hover: var(--brand-stripe);
   --ds-table-selected: var(--primary-soft);
   --ds-table-focus: var(--primary-soft);
   --ds-table-shadow: var(--shadow-sm);

   font-family: inherit;
   color: var(--ds-table-text);
}

.ds-table__toolbar {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: var(--ds-table-gap);
   margin-bottom: var(--ds-table-gap);
   flex-wrap: wrap;
}

.ds-table__search,
.ds-table__pageSize {
   border: 1px solid var(--ds-table-border);
   background: var(--ds-table-surface);
   color: var(--ds-table-text);
   border-radius: 9999px;
   padding: 10px 14px;
   min-height: 42px;
   outline: 0;
}

.ds-table__search {
   flex: 1;
   min-width: 220px;
}

.ds-table__search:focus,
.ds-table__pageSize:focus {
   border-color: var(--ds-table-primary);
   box-shadow: 0 0 0 3px var(--ds-table-focus);
}

.ds-table__container {
   background: var(--ds-table-surface);
   border: 1px solid var(--ds-table-border);
   border-radius: var(--ds-table-radius);
   box-shadow: var(--ds-table-shadow);
   overflow: hidden;
}

/* Permite que o dropdown de ações escape do clipping usado para os cantos arredondados */
.ds-table__container:has(.dropdown-menu.show) {
   overflow: visible;
}

.ds-table__table {
   width: 100%;
   border-collapse: separate;
   border-spacing: 0;
   table-layout: fixed;
}

.ds-table__thead th {
   position: relative;
   font-weight: 700;
   font-size: 0.75rem;
   letter-spacing: 0.06em;
   text-transform: uppercase;
   color: var(--ds-table-muted);
   background: var(--ds-table-bg);
   border-bottom: 1px solid var(--ds-table-border);
   padding: 12px 14px;
   vertical-align: middle;
}

.ds-table__sort {
   appearance: none;
   border: 0;
   background: transparent;
   padding: 0;
   margin: 0;
   width: 100%;
   text-align: inherit;
   display: inline-flex;
   align-items: center;
   justify-content: space-between;
   gap: 10px;
   color: inherit;
   cursor: pointer;
}

.ds-table__cell--center .ds-table__sort { justify-content: center; }
.ds-table__cell--right .ds-table__sort { justify-content: flex-end; }

.ds-table__sort:focus {
   outline: 0;
   box-shadow: 0 0 0 3px var(--ds-table-focus);
   border-radius: 6px;
}

.ds-table__sortIcon {
   width: 10px;
   height: 10px;
   opacity: 0.7;
   position: relative;
}

.ds-table__sort[data-sort-active='1'][data-sort-dir='asc'] .ds-table__sortIcon::before {
   content: '';
   position: absolute;
   left: 0;
   top: 2px;
   border-left: 5px solid transparent;
   border-right: 5px solid transparent;
   border-bottom: 7px solid var(--ds-table-muted);
}

.ds-table__sort[data-sort-active='1'][data-sort-dir='desc'] .ds-table__sortIcon::before {
   content: '';
   position: absolute;
   left: 0;
   top: 1px;
   border-left: 5px solid transparent;
   border-right: 5px solid transparent;
   border-top: 7px solid var(--ds-table-muted);
}

.ds-table__resize {
   position: absolute;
   right: 0;
   top: 0;
   height: 100%;
   width: 10px;
   cursor: col-resize;
   z-index: 2;
}

.ds-table__resize:focus {
   outline: 0;
   box-shadow: inset 0 0 0 3px var(--ds-table-focus);
}

.ds-table__tbody td {
   padding: 12px 14px;
   border-bottom: 1px solid var(--ds-table-border);
   color: var(--ds-table-text);
   background: var(--ds-table-surface);
   vertical-align: middle;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

/* Permite que o dropdown de ações escape do truncamento de texto da célula */
.ds-table__tbody td:has(.dropdown-menu.show) {
   overflow: visible;
}

.ds-table__tbody tr:hover td {
   background: var(--ds-table-hover);
}

.ds-table__cell--right { text-align: right; }
.ds-table__cell--center { text-align: center; }

.ds-table__emptyCell {
   padding: 22px 14px;
   color: var(--ds-table-muted);
   text-align: center;
   background: var(--ds-table-surface);
}

.ds-table__footer {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: var(--ds-table-gap);
   margin-top: var(--ds-table-gap);
   flex-wrap: wrap;
}

.ds-table__info {
   color: var(--ds-table-muted);
   font-size: 0.875rem;
}

.ds-table__pagination {
   display: flex;
   align-items: center;
   gap: 6px;
   flex-wrap: wrap;
}

.ds-table__pageBtn {
   appearance: none;
   border: 1px solid var(--ds-table-border);
   background: var(--ds-table-surface);
   color: var(--ds-table-text);
   border-radius: 9999px;
   padding: 8px 12px;
   min-height: 38px;
   cursor: pointer;
}

.ds-table__pageBtn[aria-current='page'] {
   border-color: var(--ds-table-primary);
   background: var(--ds-table-selected);
}

.ds-table__pageBtn:focus {
   outline: 0;
   box-shadow: 0 0 0 3px var(--ds-table-focus);
}

.ds-table__pageBtn:disabled {
   opacity: 0.55;
   cursor: not-allowed;
}

.ds-table__pageEllipsis {
   color: var(--ds-table-muted);
   padding: 0 4px;
}

.ds-table--loading { opacity: 0.85; }
.ds-table--resizing { user-select: none; }

@media (max-width: 768px) {
   .ds-table__toolbar {
      flex-direction: column;
      align-items: stretch;
   }

   .ds-table__search { min-width: 100%; }

   .ds-table__thead { display: none; }

   .ds-table__table,
   .ds-table__tbody,
   .ds-table__tbody tr,
   .ds-table__tbody td {
      display: block;
      width: 100%;
   }

   .ds-table__tbody tr {
      border-bottom: 0;
      margin-bottom: 12px;
      border: 1px solid var(--ds-table-border);
      border-radius: var(--ds-table-radius);
      overflow: hidden;
      box-shadow: var(--ds-table-shadow);
   }

   .ds-table__tbody td {
      white-space: normal;
      text-overflow: initial;
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 16px;
      border-bottom: 1px solid var(--ds-table-border);
   }

   .ds-table__tbody td::before {
      content: attr(data-label);
      flex: 0 0 40%;
      color: var(--ds-table-muted);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-size: 0.75rem;
   }

   .ds-table__tbody td:last-child {
      border-bottom: 0;
   }
}

@media (prefers-reduced-motion: reduce) {
   .ds-table__search,
   .ds-table__pageSize,
   .ds-table__pageBtn,
   .ds-table__sort {
      transition: none;
   }
}

/* ---------- 13. Progress ---------- */
.progress {
   display: flex;
   height: 10px;
   overflow: hidden;
   background: var(--border-color);
   border-radius: 9999px;
}
.progress-bar {
   display: flex;
   flex-direction: column;
   justify-content: center;
   background-color: var(--primary);
   transition: width 0.6s ease;
}
.progress-bar-striped {
   background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
   background-size: 1rem 1rem;
}
.progress-bar.bg-info { background-color: var(--info); }
.progress-bar.bg-success { background-color: var(--success); }
.progress-bar.bg-warning { background-color: var(--warning); }
.progress-bar.bg-danger { background-color: var(--danger); }

/* ---------- 14. Formulários ---------- */
.form-control {
   display: block;
   width: 100%;
   padding: 0.5rem 0.75rem;
   font-family: inherit;
   font-size: 0.875rem;
   color: var(--text-main);
   background: var(--card-bg);
   border: 1px solid var(--border-color);
   border-radius: var(--radius-md);
   transition: border-color 0.2s;
}
.form-control:focus {
   outline: 0;
   border-color: var(--primary);
   box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-control-sm { padding: 0.3rem 0.6rem; font-size: 0.8125rem; }
select.form-control { appearance: auto; }
.custom-control {
   display: flex;
   align-items: center;
   gap: 0.5rem;
}
.custom-control-input { accent-color: var(--primary); width: 1rem; height: 1rem; }
.custom-control-label { cursor: pointer; }
.form-check {
   position: static;
   display: flex;
   align-items: center;
   gap: 0.5rem;
   padding-left: 0;
}
.form-check-input { position: static; accent-color: var(--primary); width: 1rem; height: 1rem; margin: 0; flex-shrink: 0; }
.form-check-label { cursor: pointer; margin: 0; }
.form-row {
   display: flex;
   flex-wrap: wrap;
   gap: 1rem;
   margin-bottom: 0.25rem;
}
.form-group {
   flex: 1;
   min-width: 220px;
   margin-bottom: 0.75rem;
}
.form-group > label {
   display: block;
   font-weight: 500;
   margin-bottom: 0.35rem;
}
.form-text {
   display: block;
   margin-top: 0.25rem;
   font-size: 0.8125rem;
   color: var(--text-muted);
}
.form-actions {
   display: flex;
   flex-wrap: wrap;
   gap: 0.75rem;
   margin-top: 1rem;
}
.input-group {
   display: flex;
   align-items: stretch;
   width: 100%;
}
.input-group-prepend { display: flex; }
.input-group-text {
   display: flex;
   align-items: center;
   padding: 0.5rem 0.75rem;
   background: var(--table-head-bg);
   color: var(--table-head-color);
   border: 1px solid var(--border-color);
   border-right: 0;
   border-radius: var(--radius-md) 0 0 var(--radius-md);
   font-weight: 600;
}
.input-group > .form-control,
.input-group > div > .form-control {
   border-top-left-radius: 0;
   border-bottom-left-radius: 0;
}

/* Alertas (compatíveis com o Bootstrap JS: .close / data-dismiss="alert") */
.alert {
   position: relative;
   padding: 0.75rem 2.5rem 0.75rem 1rem;
   margin-bottom: 1rem;
   border-radius: var(--radius-md);
   border: 1px solid transparent;
   border-left: 4px solid;
}
.alert .close {
   position: absolute;
   top: 0.4rem;
   right: 0.75rem;
   color: inherit;
}
.alert-success { background: rgba(16, 185, 129, 0.12); border-left-color: var(--success); color: var(--text-main); }
.alert-danger { background: rgba(239, 68, 68, 0.12); border-left-color: var(--danger); color: var(--text-main); }
.alert-warning { background: rgba(245, 158, 11, 0.12); border-left-color: var(--warning); color: var(--text-main); }
.alert-info, .alert-primary { background: var(--primary-soft); border-left-color: var(--primary); color: var(--text-main); }

/* Grade de detalhes (substitui dl.row/col-sm-*) — listras da marca */
.detail-grid {
   display: grid;
   grid-template-columns: minmax(160px, 220px) 1fr;
   margin: 0;
   border: 1px solid var(--border-color);
   border-radius: var(--radius-md);
   overflow: hidden;
}
.detail-grid dt,
.detail-grid dd {
   padding: 0.6rem 0.9rem;
   margin: 0;
   border-bottom: 1px solid var(--border-color);
}
.detail-grid dt {
   background: var(--table-head-bg);
   color: var(--table-head-color);
   font-weight: 600;
   font-size: 0.8125rem;
}
.detail-grid dd:nth-of-type(even) { background: var(--brand-stripe); }
.detail-grid dt:last-of-type,
.detail-grid dd:last-of-type { border-bottom: none; }
@media (max-width: 576px) {
   .detail-grid { grid-template-columns: 1fr; }
   .detail-grid dt { border-bottom: none; }
}

/* Compatibilidade select2 (tema bootstrap4) com o design system */
.select2-container--bootstrap4 .select2-selection {
   background: var(--card-bg) !important;
   border: 1px solid var(--border-color) !important;
   border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
   color: var(--text-main) !important;
   min-height: 38px !important;
}
.select2-container--bootstrap4 .select2-selection__rendered { color: var(--text-main) !important; line-height: 36px !important; }
.select2-container--bootstrap4.select2-container--focus .select2-selection { border-color: var(--primary) !important; box-shadow: 0 0 0 3px var(--primary-soft) !important; }
.select2-dropdown {
   background: var(--card-bg) !important;
   border: 1px solid var(--border-color) !important;
   color: var(--text-main) !important;
}
.select2-search__field {
   background: var(--bg-color) !important;
   color: var(--text-main) !important;
   border: 1px solid var(--border-color) !important;
}
.select2-results__option { color: var(--text-main); }
.select2-results__option--highlighted {
   background: var(--primary) !important;
   color: var(--on-primary) !important;
}

/* ---------- 15. Skeleton / Spinner ---------- */
.skeleton {
   background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-color) 50%, var(--border-color) 75%);
   background-size: 200% 100%;
   animation: loading 1.5s infinite;
   border-radius: 4px;
}
.skeleton-text { height: 1rem; margin-bottom: 0.5rem; width: 100%; }
.skeleton-title { height: 1.5rem; width: 50%; margin-bottom: 1rem; }
.skeleton-chart { height: 300px; width: 100%; border-radius: var(--radius-md); }
@keyframes loading {
   0% { background-position: 200% 0; }
   100% { background-position: -200% 0; }
}
.spinner-border {
   display: inline-block;
   width: 2rem;
   height: 2rem;
   border: 0.25em solid currentColor;
   border-right-color: transparent;
   border-radius: 50%;
   animation: spinner-rotate 0.75s linear infinite;
}
.spinner-border-sm {
   width: 1rem;
   height: 1rem;
   border-width: 0.15em;
}
@keyframes spinner-rotate {
   100% { transform: rotate(360deg); }
}

/* ---------- 16. Utilidades (ponte p/ markup legado e JS injetado) ---------- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-wrap { flex-wrap: wrap !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.gap-2 { gap: 0.5rem !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.float-right { float: right !important; }
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-5 { padding: 3rem !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-white { color: #fff !important; }
.text-dark { color: var(--text-main) !important; }
.text-light { color: var(--border-color) !important; }
.text-decoration-none { text-decoration: none !important; }
.text-uppercase { text-transform: uppercase !important; }
.small, small { font-size: 0.8125rem; }
.font-weight-bold { font-weight: 700 !important; }
.border-bottom { border-bottom: 1px solid var(--border-color) !important; }
.border-top { border-top: 1px solid var(--border-color) !important; }
.border-0 { border: 0 !important; }
.border-bottom-0 { border-bottom: 0 !important; }
.border-top-0 { border-top: 0 !important; }
.bg-light { background-color: var(--bg-color) !important; }
.bg-white { background-color: var(--card-bg) !important; }
.bg-primary { background-color: var(--primary) !important; color: var(--on-primary); }
.bg-success { background-color: var(--success) !important; color: #fff; }
.bg-danger { background-color: var(--danger) !important; color: #fff; }
.bg-warning { background-color: var(--warning) !important; color: #1a1a1a; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.border { border: 1px solid var(--border-color) !important; }
.rounded { border-radius: var(--radius-md) !important; }
.list-unstyled { list-style: none !important; padding-left: 0 !important; }
.h3 { font-size: 1.5rem; font-weight: 600; }

/* ============================================================
   17. Temas de heróis (data-hero no <html>)
   Cada herói troca apenas os tokens de destaque; as superfícies
   claras/escuras continuam controladas por data-theme (light/dark).
   'djantech' (padrão) = sem atributo data-hero.
   ============================================================ */

/* --- Marvel --- */
[data-hero='ironman'] {
   --primary: #c62828;
   --primary-hover: #a31515;
   --primary-soft: rgba(198, 40, 40, 0.12);
   --hero-accent: #ffc107;
   --heading-color: #c62828;
   --sidebar-bg: #200d0d;
   --sidebar-active: #ffc107;
   --table-head-bg: #200d0d;
   --brand-stripe: rgba(198, 40, 40, 0.08);
}
[data-hero='hulk'] {
   --primary: #2e7d32;
   --primary-hover: #1f5c23;
   --primary-soft: rgba(46, 125, 50, 0.12);
   --hero-accent: #7e57c2;
   --heading-color: #2e7d32;
   --sidebar-bg: #0f1a10;
   --sidebar-active: #7e57c2;
   --table-head-bg: #0f1a10;
   --brand-stripe: rgba(46, 125, 50, 0.08);
}
[data-hero='pantera'] {
   --primary: #7c4dff;
   --primary-hover: #6236e0;
   --primary-soft: rgba(124, 77, 255, 0.12);
   --hero-accent: #b388ff;
   --heading-color: #7c4dff;
   --sidebar-bg: #0b0b14;
   --sidebar-active: #b388ff;
   --table-head-bg: #0b0b14;
   --brand-stripe: rgba(124, 77, 255, 0.1);
}

/* --- DC --- */
[data-hero='batman'] {
   --primary: #f5c518;
   --primary-hover: #d4a90f;
   --primary-soft: rgba(245, 197, 24, 0.15);
   --on-primary: #131313;
   --hero-accent: #4a4a4a;
   --heading-color: #a67c00;
   --sidebar-bg: #0a0a0a;
   --sidebar-active: #f5c518;
   --table-head-bg: #0a0a0a;
   --brand-stripe: rgba(245, 197, 24, 0.1);
}
[data-theme='dark'][data-hero='batman'] {
   --heading-color: #f5c518;
}
[data-hero='superman'] {
   --primary: #1565c0;
   --primary-hover: #0d47a1;
   --primary-soft: rgba(21, 101, 192, 0.12);
   --hero-accent: #d32f2f;
   --heading-color: #1565c0;
   --sidebar-bg: #0b1f3a;
   --sidebar-active: #d32f2f;
   --table-head-bg: #0b1f3a;
   --brand-stripe: rgba(21, 101, 192, 0.08);
}
[data-hero='wonder'] {
   --primary: #b71c1c;
   --primary-hover: #8e1414;
   --primary-soft: rgba(183, 28, 28, 0.12);
   --hero-accent: #ffc107;
   --heading-color: #b71c1c;
   --sidebar-bg: #2b0a10;
   --sidebar-active: #ffc107;
   --table-head-bg: #2b0a10;
   --brand-stripe: rgba(183, 28, 28, 0.08);
}

/* No dark, o fundo do cabeçalho de tabela volta ao preto Pantera Negra
   e o texto herda a cor primária do herói ativo */
[data-theme='dark'][data-hero] {
   --table-head-bg: #000000;
}

/* ---------- 18. Seletor de tema de herói (topbar) ---------- */
.theme-picker-menu {
   min-width: 230px;
   padding: 0.5rem 0;
}
.theme-picker-label {
   font-size: 0.6875rem;
   font-weight: 700;
   text-transform: uppercase;
   letter-spacing: 0.08em;
   color: var(--text-muted);
   padding: 0.4rem 1rem 0.15rem;
}
.theme-option {
   cursor: pointer;
   font-size: 0.8438rem;
}
.theme-option .theme-swatch {
   width: 18px;
   height: 18px;
   border-radius: 50%;
   margin-right: 0.6rem;
   border: 2px solid var(--border-color);
   flex-shrink: 0;
}
.theme-option.active::after {
   content: '\f00c'; /* fa-check */
   font-family: 'Font Awesome 6 Free', 'FontAwesome';
   font-weight: 900;
   margin-left: auto;
   color: var(--primary);
}
.swatch-djantech { background: linear-gradient(135deg, #e07b20 50%, #2d2d2d 50%); }
.swatch-ironman { background: linear-gradient(135deg, #c62828 50%, #ffc107 50%); }
.swatch-hulk { background: linear-gradient(135deg, #2e7d32 50%, #7e57c2 50%); }
.swatch-pantera { background: linear-gradient(135deg, #7c4dff 50%, #0b0b14 50%); }
.swatch-batman { background: linear-gradient(135deg, #f5c518 50%, #0a0a0a 50%); }
.swatch-superman { background: linear-gradient(135deg, #1565c0 50%, #d32f2f 50%); }
.swatch-wonder { background: linear-gradient(135deg, #b71c1c 50%, #ffc107 50%); }

/* ============================================================
   19. Módulo Prontuário — componentes específicos
   ============================================================ */

/* --- Badge light (soft) variants --- */
.badge-light-primary { background: var(--primary-soft); color: var(--primary); }
.badge-light-success { background: rgba(16,185,129,0.12); color: var(--success); }
.badge-light-secondary { background: var(--brand-stripe); color: var(--text-muted); }

/* --- Botão ícone (btn-icon) --- */
.btn-icon {
   padding: 0;
   width: 32px;
   height: 32px;
   border-radius: var(--radius-sm);
}

/* --- outline-danger / outline-secondary --- */
.btn-outline-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-outline-secondary { border-color: var(--secondary); color: var(--secondary); background: transparent; }
.btn-outline-secondary:hover { background: var(--secondary); color: #fff; }

/* --- Nav Tabs (prontuário) --- */
.nav-tabs {
   display: flex;
   flex-wrap: nowrap;
   overflow-x: auto;
   -webkit-overflow-scrolling: touch;
   scrollbar-width: none;
   border-bottom: 2px solid var(--border-color);
   list-style: none;
   padding: 0;
   margin: 0;
   gap: 0.25rem;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs .nav-item { list-style: none; white-space: nowrap; }
.nav-tabs .nav-link {
   display: inline-block;
   padding: 0.65rem 1.25rem;
   font-size: 0.875rem;
   font-weight: 500;
   color: var(--text-muted);
   border: none;
   border-bottom: 2px solid transparent;
   background: transparent;
   cursor: pointer;
   text-decoration: none;
   margin-bottom: -2px;
   transition: color 0.2s, border-color 0.2s;
}
.nav-tabs .nav-link:hover { color: var(--primary); border-bottom-color: var(--primary-soft); }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Tab panes */
.tab-content > .tab-pane { display: none; padding-top: 1.25rem; }
.tab-content > .tab-pane.active { display: block; }

/* --- Timeline (prontuário view) --- */
.pr-timeline {
   position: relative;
   padding-left: 2rem;
}
.pr-timeline::before {
   content: '';
   position: absolute;
   left: 0.35rem;
   top: 0;
   bottom: 0;
   width: 2px;
   background: var(--border-color);
   border-radius: 2px;
}
.pr-timeline-item {
   position: relative;
   margin-bottom: 1.5rem;
}
.pr-timeline-dot {
   position: absolute;
   left: -1.72rem;
   top: 1rem;
   width: 0.875rem;
   height: 0.875rem;
   border-radius: 50%;
   background: var(--primary);
   border: 2px solid var(--card-bg);
   box-shadow: 0 0 0 2px var(--primary);
}
.pr-timeline-dot.dot-success {
   background: var(--success);
   box-shadow: 0 0 0 2px var(--success);
}
.pr-timeline-card {
   background: var(--card-bg);
   border: 1px solid var(--border-color);
   border-radius: var(--radius-md);
   padding: 1rem 1.25rem;
   border-left: 4px solid var(--primary);
   transition: box-shadow 0.2s;
}
.pr-timeline-card:hover { box-shadow: var(--shadow-md); }
.pr-timeline-card.card-success { border-left-color: var(--success); }

/* --- Patient Banner (sidebar do view) --- */
.patient-banner {
   display: flex;
   align-items: center;
   gap: 1rem;
   padding: 1rem 0;
}
.patient-avatar {
   width: 56px;
   height: 56px;
   border-radius: 50%;
   background: var(--primary-soft);
   color: var(--primary);
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 1.5rem;
   flex-shrink: 0;
}

/* --- Info list (dados do paciente) --- */
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li {
   display: flex;
   justify-content: space-between;
   align-items: flex-start;
   gap: 0.5rem;
   padding: 0.5rem 0;
   border-bottom: 1px dashed var(--border-color);
   font-size: 0.875rem;
}
.info-list li:last-child { border-bottom: none; }
.info-list .info-label {
   font-size: 0.75rem;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 0.04em;
   color: var(--text-muted);
   flex-shrink: 0;
}
.info-list .info-value {
   color: var(--text-main);
   text-align: right;
   max-width: 60%;
   word-break: break-word;
}

/* --- Quill rich-text content --- */
.quill-content { color: var(--text-main); line-height: 1.6; font-size: 0.9rem; }
.quill-content p { margin-bottom: 0.5rem; }
.quill-content img { max-width: 100%; border-radius: var(--radius-sm); }

/* --- Custom file input (prontuário modais) --- */
.custom-file { position: relative; display: inline-block; width: 100%; height: calc(2rem + 2px); }
.custom-file-input {
   position: relative;
   z-index: 2;
   width: 100%;
   height: 100%;
   margin: 0;
   opacity: 0;
   cursor: pointer;
}
.custom-file-label {
   position: absolute;
   top: 0;
   right: 0;
   left: 0;
   z-index: 1;
   display: flex;
   align-items: center;
   gap: 0.5rem;
   padding: 0.5rem 0.75rem;
   font-size: 0.875rem;
   font-weight: 400;
   color: var(--text-muted);
   background: var(--card-bg);
   border: 1px solid var(--border-color);
   border-radius: var(--radius-md);
   overflow: hidden;
   white-space: nowrap;
   text-overflow: ellipsis;
   transition: border-color 0.2s;
}
.custom-file-label::after {
   content: attr(data-browse);
   position: absolute;
   top: 0;
   right: 0;
   bottom: 0;
   z-index: 3;
   display: flex;
   align-items: center;
   padding: 0 0.75rem;
   color: var(--on-primary);
   background: var(--primary);
   border-radius: 0 var(--radius-md) var(--radius-md) 0;
   font-weight: 500;
   font-size: 0.8125rem;
}

/* Responsive adjustments for timeline on mobile */
@media (max-width: 576px) {
   .pr-timeline { padding-left: 0; }
   .pr-timeline::before { display: none; }
   .pr-timeline-dot { display: none; }
}