/* ==========================================================================
   DocFarma · Design System
   Mesmo layout do design system do BuscaPix (pix-design-system.css), porém
   mantendo a paleta ORIGINAL do DocFarma. Nenhuma cor nova foi introduzida:
     - azul-marinho #103057 (base escura) e #0b416c (hover)
     - whitesmoke (fundo), branco (superfícies), #808080 (secundário)
     - cores de status das linhas (.bloqueio, .Pendente, ...) e vermelho do obrigatório
     - alertas/sucesso/erro: valores padrão do Bootstrap 5, que o DocFarma já usava
   Carregado SOMENTE pelo _Layout.cshtml. As views PDF (Rotativa/wkhtmltopdf) continuam
   usando site.css, que não deve receber flex/grid/variáveis CSS.
   Fontes (Google Fonts) carregadas no <head> do _Layout:
     Space Grotesk (títulos) · Inter (texto) · JetBrains Mono (números/códigos)
   ========================================================================== */

:root {
	--df-ink: #103057;
	--df-ink-hover: #0b416c;
	--df-canvas: whitesmoke;
	--df-paper: #ffffff;
	--df-line: #dee2e6;
	--df-muted: #6c757d;
	--df-text: #212529;
	--df-secondary: #808080;
	--df-required: red;

	--df-success: #198754;
	--df-success-bg: #d1e7dd;
	--df-success-text: #0f5132;
	--df-pending: #ffc107;
	--df-pending-bg: #fff3cd;
	--df-pending-text: #664d03;
	--df-danger: #dc3545;
	--df-danger-bg: #f8d7da;
	--df-danger-text: #842029;
	--df-info-bg: #cff4fc;
	--df-info-text: #055160;

	/* realces sobre fundo escuro (navy): branco translúcido, sem matiz novo */
	--df-on-ink: #ffffff;
	--df-on-ink-soft: rgba(255, 255, 255, 0.72);
	--df-glass: rgba(255, 255, 255, 0.07);
	--df-glass-line: rgba(255, 255, 255, 0.14);

	--df-focus-ring: 0 0 0 3px rgba(16, 48, 87, 0.18);

	--df-radius: 14px;

	--df-font-display: 'Space Grotesk', system-ui, sans-serif;
	--df-font-body: 'Inter', system-ui, sans-serif;
	--df-font-mono: 'JetBrains Mono', ui-monospace, monospace;

	/* escala padrão da aplicação: equivale a navegar com 80% de zoom (padrão único de todas as telas) */
	--df-zoom: 0.8;
}

html { font-size: 16px; position: relative; min-height: 100%; }

body { zoom: var(--df-zoom); background: var(--df-canvas); font-family: var(--df-font-body); color: var(--df-text); margin: 0; }

/* fundos escuros do Bootstrap usam 100vw/100vh: compensar a escala para cobrirem a tela toda */
.modal-backdrop,
.offcanvas-backdrop {
	width: calc(100vw / var(--df-zoom));
	height: calc(100vh / var(--df-zoom));
}

/* ---------- shell / hero ---------- */

.df-shell {
	background: var(--df-canvas);
	border-radius: 20px;
	overflow: hidden;
	font-family: var(--df-font-body);
	color: var(--df-text);
	margin-bottom: 2rem;
}

.df-hero {
	background: linear-gradient(120deg, var(--df-ink) 0%, var(--df-ink-hover) 100%);
	padding: 1.75rem 1.75rem 1.5rem;
	color: var(--df-on-ink);
	position: relative;
}
.df-hero::after {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(420px 180px at 88% -10%, rgba(255, 255, 255, 0.16), transparent 70%);
	pointer-events: none;
}
.df-hero-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	position: relative;
	z-index: 1;
}
.df-eyebrow {
	font-family: var(--df-font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--df-on-ink-soft);
	margin: 0 0 0.35rem;
}
.df-title {
	font-family: var(--df-font-display);
	font-weight: 600;
	font-size: 1.65rem;
	margin: 0;
	letter-spacing: -0.01em;
}
.df-subtitle {
	font-family: var(--df-font-mono);
	font-size: 0.85rem;
	color: var(--df-on-ink-soft);
	margin: 0.3rem 0 0;
}

/* ---------- cartões de estatística no hero (Home) ---------- */

.df-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0.75rem;
	margin-top: 1.25rem;
	position: relative;
	z-index: 1;
}
.df-stat {
	background: var(--df-glass);
	border: 1px solid var(--df-glass-line);
	border-radius: 12px;
	padding: 0.75rem 0.9rem;
}
.df-stat-icon {
	width: 30px; height: 30px;
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.14);
	color: var(--df-on-ink);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.55rem;
	font-size: 0.9rem;
}
.df-stat-label { font-size: 0.72rem; color: var(--df-on-ink-soft); margin: 0 0 0.2rem; }
.df-stat-value { font-family: var(--df-font-display); font-size: 1.3rem; font-weight: 600; margin: 0; }
.df-stat-clickable { cursor: pointer; transition: transform 0.15s ease, background 0.15s ease; }
.df-stat-clickable:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.12); }

/* ---------- corpo / toolbar ---------- */

.df-body { padding: 1.25rem 1.5rem 1.75rem; }

.df-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
/* grupo de filtros da barra: ocupa uma linha inteira e divide o espaço entre os campos lado a lado */
.df-toolbar-filtros { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.df-toolbar-filtros .df-select,
.df-toolbar-filtros .df-input { width: auto; flex: 1 1 160px; min-width: 0; }
.df-toolbar-filtros .df-check { flex: 0 0 auto; }

.df-search {
	flex: 1 1 220px;
	display: flex;
	align-items: center;
	background: var(--df-paper);
	border: 1px solid var(--df-line);
	border-radius: 10px;
	padding: 0 0.2rem 0 0.75rem;
	height: 42px;
	max-width: 420px;
}
.df-search i { color: var(--df-muted); font-size: 1rem; }
.df-search input {
	border: none;
	outline: none;
	flex: 1;
	padding: 0 0.6rem;
	font-family: var(--df-font-body);
	font-size: 0.9rem;
	background: transparent;
	color: var(--df-text);
	min-width: 0;
}
.df-search button {
	border: none;
	background: var(--df-ink);
	color: var(--df-on-ink);
	font-size: 0.85rem;
	font-weight: 500;
	padding: 0 0.9rem;
	height: 32px;
	border-radius: 8px;
	margin: 5px;
	cursor: pointer;
}
.df-search button:hover { background: var(--df-ink-hover); }

.df-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-family: var(--df-font-body);
	font-size: 0.85rem;
	font-weight: 500;
	border-radius: 10px;
	padding: 0 0.9rem;
	height: 42px;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	white-space: nowrap;
}
.df-btn i { font-size: 1rem; }
.df-btn-primary { background: var(--df-ink); color: var(--df-on-ink); }
.df-btn-primary:hover { background: var(--df-ink-hover); color: var(--df-on-ink); }
.df-btn-outline { background: var(--df-paper); color: var(--df-text); border-color: var(--df-line); }
.df-btn-outline:hover { border-color: var(--df-ink); color: var(--df-ink); }
.df-btn-sm { height: 28px; padding: 0 0.6rem; font-size: 0.72rem; border-radius: 8px; }
.df-btn.disabled { pointer-events: none; opacity: 0.55; }
.df-btn[type="submit"] { border: none; }

/* ---------- alertas / avisos ---------- */

.df-alert {
	border-radius: 12px;
	padding: 0.8rem 1rem;
	margin-bottom: 1rem;
	font-size: 0.9rem;
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.df-alert-success { background: var(--df-success-bg); color: var(--df-success-text); }
.df-alert-danger { background: var(--df-danger-bg); color: var(--df-danger-text); }
.df-alert-warning { background: var(--df-pending-bg); color: var(--df-pending-text); }
.df-alert-info { background: var(--df-info-bg); color: var(--df-info-text); }
.df-alert-secondary { background: #e2e3e5; color: #41464b; }
.df-alert a { color: inherit; font-weight: 500; text-decoration: underline; }

.df-validation-summary {
	background: var(--df-danger-bg);
	color: var(--df-danger-text);
	border-radius: 12px;
	padding: 0.8rem 1rem;
	font-size: 0.88rem;
}
.df-validation-summary ul { margin: 0; padding-left: 1.1rem; }
.df-validation-summary:empty { display: none; }

/* ---------- tabela ---------- */

.df-table-wrap { background: var(--df-paper); border: 1px solid var(--df-line); border-radius: var(--df-radius); overflow: auto; }
.df-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 520px; margin: 0; }
.df-table thead th {
	position: sticky;
	top: 0;
	background: var(--df-canvas);
	text-align: left;
	font-family: var(--df-font-body);
	font-weight: 600;
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--df-muted);
	padding: 0.7rem 0.9rem;
	border-bottom: 1px solid var(--df-line);
	white-space: nowrap;
}
.df-table tbody td { font-size: inherit; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--df-line); vertical-align: middle; }
.df-table tbody tr:last-child td { border-bottom: none; }
.df-table tbody tr:hover { background: var(--df-canvas); }

/* colunas só de ícone (editar/excluir/PDF) ocupam o mínimo */
.df-table th.df-col-acao,
.df-table td.df-col-acao { width: 1%; padding-left: 0.25rem; padding-right: 0.25rem; text-align: center; }
/* tabelas com muitas colunas: títulos podem quebrar linha */
.df-table-titulo-quebra thead th { white-space: normal; }

.df-mono { font-family: var(--df-font-mono); font-size: 0.85rem; color: var(--df-text); }
.df-doc { font-family: var(--df-font-mono); color: var(--df-muted); letter-spacing: 0.03em; }
.df-valor { font-family: var(--df-font-mono); font-weight: 500; text-align: right; display: block; }

/* cores de status da linha (as mesmas do DocFarma antigo, vindas do site.css) */
.bloqueio { background-color: #F08080; }
.cobraemTela { background-color: #FFE4B5; }
.Estornado { background-color: #F5DEB3; }
.Excluido { background-color: #5F9EA0; }
.Pendente { background-color: #FFFACD; }
.Autorizado { background-color: #ADD8E6; }
/* o hover da linha não pode apagar a cor de status */
.df-table tbody tr.bloqueio:hover,
.df-table tbody tr.cobraemTela:hover,
.df-table tbody tr.Estornado:hover,
.df-table tbody tr.Excluido:hover,
.df-table tbody tr.Pendente:hover,
.df-table tbody tr.Autorizado:hover { filter: brightness(0.96); }

/* ---------- botões de ícone (ações de linha) ---------- */

.df-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px; height: 32px;
	border-radius: 8px;
	color: var(--df-muted);
	text-decoration: none;
	cursor: pointer;
}
.df-icon-btn:hover { background: var(--df-canvas); color: var(--df-ink); }
.df-icon-btn-danger:hover { background: var(--df-danger-bg); color: var(--df-danger); }
.df-icon-btn.disabled { pointer-events: none; opacity: 0.4; }

/* ---------- estado vazio ---------- */

.df-empty { text-align: center; padding: 3rem 1.5rem; color: var(--df-muted); }
.df-empty i { font-size: 2.2rem; color: var(--df-ink); margin-bottom: 0.6rem; display: block; }
.df-empty p { margin: 0.2rem 0 0; }

/* ---------- paginação (X.PagedList) ---------- */

.df-pager-wrap { margin-top: 1.25rem; }
.df-pager-wrap .pagination { justify-content: center; gap: 0.25rem; }
.df-pager-wrap .page-link {
	border: 1px solid var(--df-line);
	border-radius: 8px !important;
	color: var(--df-text);
	font-family: var(--df-font-mono);
	font-size: 0.82rem;
	margin: 0 !important;
}
.df-pager-wrap .page-item.active .page-link { background: var(--df-ink); border-color: var(--df-ink); color: var(--df-on-ink); }
.df-pager-wrap .page-link:hover { background: var(--df-canvas); }
.df-pager-wrap .page-item.disabled .page-link { color: var(--df-muted); }
.pagination-numbers { font-size: 0.82rem; }

/* ---------- selos (badges) ---------- */

.df-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-family: var(--df-font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.03em;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	white-space: nowrap;
}
.df-badge-success { color: var(--df-success-text); background: var(--df-success-bg); }
.df-badge-pending { color: var(--df-pending-text); background: var(--df-pending-bg); }
.df-badge-danger { color: var(--df-danger-text); background: var(--df-danger-bg); }
.df-badge-info { color: var(--df-info-text); background: var(--df-info-bg); }
.df-badge-muted { color: var(--df-muted); background: var(--df-canvas); }

/* ---------- responsivo ---------- */

@media (max-width: 640px) {
	.df-hero { padding: 1.4rem 1.1rem; }
	.df-body { padding: 1rem; }
	.df-title { font-size: 1.3rem; }
}

/* ==========================================================================
   Formulários (telas de cadastro/edição)
   ========================================================================== */

.df-form { display: flex; flex-direction: column; gap: 1.5rem; }

.df-section {
	background: var(--df-paper);
	border: 1px solid var(--df-line);
	border-radius: var(--df-radius);
	padding: 1.25rem 1.4rem 1.4rem;
}
.df-section-head { margin-bottom: 1.1rem; }
.df-section-title { font-family: var(--df-font-display); font-weight: 600; font-size: 1.02rem; margin: 0; color: var(--df-ink); }
.df-section-desc { font-size: 0.82rem; color: var(--df-muted); margin: 0.2rem 0 0; }

/* subdivisão leve dentro de uma mesma seção */
.df-subsection { padding-top: 1.1rem; margin-top: 1.1rem; border-top: 1px dashed var(--df-line); }
.df-subsection:first-child { padding-top: 0; margin-top: 0; border-top: none; }
.df-subsection-title { font-family: var(--df-font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--df-muted); margin: 0 0 0.75rem; }

.df-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.df-form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 880px) {
	.df-form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.df-form-grid,
	.df-form-grid-3 { grid-template-columns: 1fr; }
}

.df-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.df-field-wide { grid-column: 1 / -1; }

.df-label { font-size: 0.8rem; font-weight: 500; color: var(--df-text); display: flex; align-items: center; gap: 0.3rem; margin: 0; }
.df-required,
.obg { color: var(--df-required); font-size: 0.8rem; line-height: 1; }
.obg { margin-inline-end: 4px; }

.df-input, .df-select {
	width: 100%;
	height: 42px;
	border: 1px solid var(--df-line);
	border-radius: 10px;
	padding: 0 0.75rem;
	font-family: var(--df-font-body);
	font-size: 0.9rem;
	color: var(--df-text);
	background: var(--df-paper);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.df-input { height: auto; padding: 0.6rem 0.75rem; }
.df-input:focus, .df-select:focus {
	outline: none;
	border-color: var(--df-ink);
	box-shadow: var(--df-focus-ring);
}
.df-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c757d' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.8rem center;
	padding-right: 2rem;
}
/* campos somente leitura (disabled) não podem parecer editáveis */
.df-input:disabled, .df-select:disabled, .df-input[readonly] {
	background-color: var(--df-canvas);
	color: var(--df-muted);
	cursor: not-allowed;
	opacity: 1;
}

.df-hint { font-size: 0.76rem; color: var(--df-muted); margin: 0; }
.df-form .text-danger,
.df-field .text-danger { font-size: 0.78rem; color: var(--df-danger); }
.text-danger { font-size: 0.78rem; }

.df-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; color: var(--df-text); margin: 0; }
.df-check input[type="checkbox"],
.df-check input[type="radio"] { width: 17px; height: 17px; accent-color: var(--df-ink); cursor: pointer; margin: 0; }

/* barra de ações: ancorada como rodapé de card */
.df-form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	background: var(--df-paper);
	border: 1px solid var(--df-line);
	border-radius: var(--df-radius);
	padding: 1rem 1.4rem;
}

/* upload de arquivo */
.df-file {
	border: 1px dashed var(--df-line);
	border-radius: 10px;
	padding: 0.9rem 1rem;
	display: flex;
	align-items: center;
	gap: 0.7rem;
	background: var(--df-canvas);
}
.df-file i { color: var(--df-ink); font-size: 1.2rem; }
.df-file input[type="file"] { font-family: var(--df-font-body); font-size: 0.83rem; color: var(--df-muted); flex: 1; min-width: 0; }

/* campo de senha com botão de mostrar/ocultar */
.df-password-wrap { position: relative; }
.df-password-wrap .df-input { padding-right: 2.7rem; }
.df-password-toggle {
	position: absolute;
	right: 5px;
	top: 5px;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	border-radius: 8px;
	color: var(--df-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.df-password-toggle:hover { background: var(--df-canvas); color: var(--df-ink); }

/* input com botão anexado (ex.: Contra Senha + dropdown "Receber") */
.df-attach-group { display: flex; }
.df-attach-group .df-input { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; min-width: 0; }
.df-attach-btn {
	height: 42px;
	padding: 0 0.85rem;
	border: 1px solid var(--df-line);
	border-left: none;
	border-top-right-radius: 10px;
	border-bottom-right-radius: 10px;
	background: var(--df-paper);
	font-family: var(--df-font-body);
	font-size: 0.82rem;
	color: var(--df-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	white-space: nowrap;
}
.df-attach-btn:hover { background: var(--df-canvas); }
/* o login do site.js troca o display do botão para "block": mantém o texto centralizado */
.df-attach-btn { line-height: 40px; }

/* ---------- cabeçalho leve para telas de criação/edição (sem hero) ---------- */

.df-page-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.df-page-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px; height: 38px;
	border-radius: 10px;
	border: 1px solid var(--df-line);
	background: var(--df-paper);
	color: var(--df-text);
	text-decoration: none;
	flex-shrink: 0;
	cursor: pointer;
}
.df-page-back:hover { border-color: var(--df-ink); color: var(--df-ink); }
.df-page-title { font-family: var(--df-font-display); font-weight: 600; font-size: 1.35rem; margin: 0; color: var(--df-ink); }
.df-page-subtitle { font-family: var(--df-font-mono); font-size: 0.82rem; color: var(--df-muted); margin: 0.15rem 0 0; }

/* ==========================================================================
   Login
   ========================================================================== */

.df-login-page {
	position: fixed;
	inset: 0;
	z-index: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: stretch;
	font-family: var(--df-font-body);
	background: var(--df-canvas);
	overflow-y: auto;
}
body.df-login-body { margin: 0; overflow: hidden; }

.df-login-formside {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}
.df-login-card { width: 100%; max-width: 380px; }
.df-login-logo { max-width: 100%; height: 60px; width: auto; margin-bottom: 1.25rem; }
.df-login-tagline {
	font-family: var(--df-font-display);
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 0.75rem;
	max-width: 380px;
	position: relative;
	z-index: 1;
}
.df-login-subtagline { font-size: 0.92rem; color: var(--df-on-ink-soft); max-width: 360px; margin: 0; position: relative; z-index: 1; }
.df-cnpj-list:empty { display: none; }
.df-login-heading { font-family: var(--df-font-display); font-size: 1.3rem; font-weight: 600; color: var(--df-ink); margin: 0 0 0.25rem; }
.df-login-subheading { font-size: 0.85rem; color: var(--df-muted); margin: 0 0 1.1rem; }
.df-login-form { display: flex; flex-direction: column; gap: 0.85rem; }
.df-forgot-link { font-size: 0.78rem; color: var(--df-ink); text-decoration: none; margin-top: 0.35rem; display: inline-block; }
.df-forgot-link:hover { text-decoration: underline; }
.df-login-submit { width: 100%; height: 44px; justify-content: center; }

.df-login-brand {
	background: linear-gradient(150deg, var(--df-ink) 0%, var(--df-ink-hover) 100%);
	color: var(--df-on-ink);
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 3rem;
	position: relative;
	overflow: hidden;
}
.df-login-brand::after {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(520px 260px at 85% 15%, rgba(255, 255, 255, 0.16), transparent 70%);
	pointer-events: none;
}
/* área da imagem do painel direito: dimensionada por porcentagem, centralizada, sem distorcer */
.df-login-visual { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; width: 100%; padding: 2rem; box-sizing: border-box; z-index: 1; }
.df-login-image { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 18px; }

/* lista de CNPJs da seleção de empresa no login */
.df-cnpj-list { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.df-cnpj-item { display: flex; align-items: center; gap: 0.5rem; }
.df-cnpj-item input[type="radio"] { accent-color: var(--df-ink); flex-shrink: 0; margin: 0; }
.df-cnpj-item label { font-size: 0.82rem; color: var(--df-text); margin: 0; }

@media (max-width: 880px) {
	.df-login-page { grid-template-columns: 1fr; overflow-y: auto; }
	/* celular/tela estreita: só o formulário aparece */
	.df-login-brand { display: none; }
}

/* login sem navbar/sidebar: o próprio Login.cshtml já cobre a viewport via position:fixed */
.login { min-height: calc(100vh / var(--df-zoom)); }

/* ==========================================================================
   Shell da aplicação (_Layout): navbar superior, sidebar, rodapé
   ========================================================================== */

.df-app-navbar {
	position: fixed;
	top: 0; left: 0; right: 0;
	height: 60px;
	background: var(--df-paper);
	border-bottom: 1px solid var(--df-line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.25rem;
	z-index: 1030;
}
.df-app-logo { height: 46px; width: auto; cursor: pointer; }
.df-app-company { font-family: var(--df-font-body); font-weight: 500; font-size: 0.88rem; color: var(--df-text); text-decoration: none; }

.df-notif-toggle {
	border: none;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px; height: 40px;
	border-radius: 10px;
	cursor: pointer;
}
.df-notif-toggle:hover { background: var(--df-canvas); }
.df-notif-toggle img { height: 24px; width: auto; }
.dropdown-toggle-no-caret::after { display: none !important; }

/* com o zoom do body, 100vh ocuparia só 90% da tela: divide pela escala para cobrir a altura toda */
.df-app-body { display: flex; padding-top: 60px; min-height: calc(100vh / var(--df-zoom)); }

.df-app-sidebar {
	width: 232px;
	flex-shrink: 0;
	background: linear-gradient(180deg, var(--df-ink) 0%, var(--df-ink-hover) 100%);
	border-right: 1px solid var(--df-glass-line);
	padding: 1.1rem 0.85rem 1rem;
	position: fixed;
	top: 60px; bottom: 0; left: 0;
	overflow-y: auto;
	z-index: 1020;
}

.df-sidebar-profile {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.5rem 0.6rem;
	margin-bottom: 0.6rem;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--df-on-ink);
	text-decoration: none;
	border-radius: 10px;
}
.df-sidebar-avatar {
	width: 28px; height: 28px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid var(--df-glass-line);
	color: var(--df-on-ink);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--df-font-display);
	font-size: 0.7rem;
	font-weight: 600;
	flex-shrink: 0;
}
.df-nav-divider { border: none; border-top: 1px solid var(--df-glass-line); margin: 0.55rem 0; opacity: 1; }

.df-nav-list { list-style: none; margin: 0; padding: 0 0 40px; display: flex; flex-direction: column; gap: 0.15rem; }
.df-nav-link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 0.65rem;
	border-radius: 10px;
	color: var(--df-on-ink);
	font-size: 0.85rem;
	text-decoration: none;
	cursor: pointer;
}
.df-nav-link:hover { background: rgba(255, 255, 255, 0.1); color: var(--df-on-ink); }
.df-nav-link i { font-size: 0.95rem; color: var(--df-on-ink-soft); width: 16px; text-align: center; }
.df-nav-link:hover i { color: var(--df-on-ink); }
/* a classe .nav-link é mantida nos itens com submenu só porque o site.js seleciona .nav-link[id^=toggleSubMenu] */
.df-nav-list .nav-link { padding: 0.55rem 0.65rem; font-size: 0.85rem; color: var(--df-on-ink); }
.df-nav-caret { margin-left: auto; font-size: 0.7rem !important; width: auto !important; }

.df-nav-submenu { list-style: none; padding-left: 1.85rem; margin: 0.1rem 0 0.25rem; display: flex; flex-direction: column; gap: 0.1rem; }
.df-nav-submenu .df-nav-link { font-size: 0.81rem; padding: 0.4rem 0.6rem; color: var(--df-on-ink-soft); }
.df-nav-submenu .df-nav-link:hover { color: var(--df-on-ink); }

/* min-width: 0 impede que tabelas largas estiquem o container (a rolagem fica dentro de .df-table-wrap) */
.df-app-main { margin-left: 232px; padding: 1.75rem; padding-bottom: 3.25rem; width: 100%; min-width: 0; }
.df-app-main-full { margin-left: 0; padding: 1.5rem; padding-bottom: 3.25rem; width: 100%; min-width: 0; }

.df-app-footer {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	height: 34px;
	background: var(--df-ink);
	color: var(--df-on-ink-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	font-family: var(--df-font-mono);
	z-index: 1030;
	text-align: center;
	padding: 0 1rem;
}
.df-app-footer p { margin: 0; }

/* nome da empresa numa linha acima do conteúdo em telas pequenas (classe d-md-none esconde a partir de 768px) */
#mobile-menu-toggle {
	display: block;
	margin-bottom: 0.75rem;
	font-size: 0.78rem;
	color: var(--df-muted);
	text-align: center;
	text-decoration: none;
}
/* celular: conteúdo com a largura toda */
.df-app-body-mobile { flex-direction: column; }
.df-app-body-mobile .df-app-main-full { padding-left: 0.75rem; padding-right: 0.75rem; padding-top: 0.75rem; }

/* em telas estreitas a sidebar fica oculta; o logo (mnumobile) a exibe sobre o conteúdo */
@media (max-width: 880px) {
	.df-app-sidebar { display: none; }
	.df-app-main { margin-left: 0; }
}

/* ==========================================================================
   Restilização global do Bootstrap (dropdowns, botões, modais)
   Aplicada por classe já existente no HTML: nenhum id/atributo funcional é alterado.
   ========================================================================== */

.dropdown-menu {
	font-family: var(--df-font-body);
	border: 1px solid var(--df-line);
	border-radius: 12px;
	box-shadow: 0 20px 45px rgba(16, 48, 87, 0.18);
	padding: 0.4rem;
}
.dropdown-item { border-radius: 8px; font-size: 0.85rem; padding: 0.5rem 0.7rem; color: var(--df-text); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--df-canvas); color: var(--df-ink); }
.dropdown-divider { border-top: 1px solid var(--df-line); margin: 0.35rem 0; }

.btn {
	border-radius: 10px;
	font-family: var(--df-font-body);
	font-weight: 500;
	font-size: 0.85rem;
	padding: 0.5rem 1.1rem;
}
/* o DocFarma sempre usou o mesmo azul-marinho em primário e salvar */
.btn-primary, .btn-success { background-color: var(--df-ink); border-color: var(--df-ink); color: var(--df-on-ink); }
.btn-primary:hover, .btn-success:hover,
.btn-primary:focus, .btn-success:focus { background-color: var(--df-ink-hover); border-color: var(--df-ink-hover); color: var(--df-on-ink); }
.btn-secondary { background-color: var(--df-secondary); border-color: var(--df-secondary); color: var(--df-on-ink); }
.btn-secondary:hover { background-color: var(--df-muted); border-color: var(--df-muted); color: var(--df-on-ink); }

.modal-content { border-radius: var(--df-radius); border: none; box-shadow: 0 30px 70px rgba(16, 48, 87, 0.25); font-family: var(--df-font-body); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--df-line); padding: 1rem 1.25rem; }
.modal-title { font-family: var(--df-font-display); font-weight: 600; font-size: 1.05rem; color: var(--df-ink); }
.modal-footer { border-top: 1px solid var(--df-line); padding: 0.9rem 1.25rem; }
.modal-body { padding: 1.1rem 1.25rem; font-size: 0.88rem; }
.modal-body label { font-size: 0.88rem; }

.df-modal-close {
	border: none;
	background: transparent;
	width: 30px; height: 30px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--df-muted);
	cursor: pointer;
	margin-left: auto;
}
.df-modal-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--df-ink); }

/* variantes de cor do cabeçalho do modal: as cores que o DocFarma já usava inline no _Layout */
.df-modal-header-ink { background: linear-gradient(120deg, var(--df-ink), var(--df-ink-hover)); color: var(--df-on-ink); }
.df-modal-header-ink .modal-title { color: var(--df-on-ink); }
.df-modal-header-ink .df-modal-close { color: var(--df-on-ink); }
.df-modal-header-ink .df-modal-close:hover { background: rgba(255, 255, 255, 0.14); color: var(--df-on-ink); }
.df-modal-header-lightblue { background: LightBlue; }
.df-modal-header-green { background: #8FBC8F; }
.df-modal-header-warning { background: var(--df-pending-bg); }
.df-modal-header-warning .modal-title { color: var(--df-pending-text); }
.df-modal-header-danger { background: var(--df-danger-bg); }
.df-modal-header-danger .modal-title { color: var(--df-danger-text); }

/* tipografia do conteúdo dentro dos modais (ex.: Termo de Adesão) */
.modal-body h4 { font-family: var(--df-font-display); font-weight: 600; font-size: 1.02rem; color: var(--df-ink); margin: 1.25rem 0 0.5rem; }
.modal-body h4:first-child { margin-top: 0; }
.modal-body h5 { font-family: var(--df-font-display); font-weight: 600; font-size: 0.92rem; color: var(--df-ink); margin: 1rem 0 0.5rem; }
.modal-body p { font-size: 0.87rem; line-height: 1.65; color: var(--df-text); margin: 0 0 0.7rem; }
.modal-body ul, .modal-body ol { font-size: 0.87rem; line-height: 1.65; color: var(--df-text); padding-left: 1.35rem; margin: 0 0 0.7rem; }
.modal-body table { font-size: 0.82rem; width: 100%; }
.modal-body table td { vertical-align: top; }
.modal-body em { color: var(--df-muted); }

/* spinner de carregamento global */
.overlay {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}
.overlay .spinner-border { width: 4rem; height: 4rem; }

/* mensagem do timeout de sessão */
.timeout-message {
	display: none;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: var(--df-paper);
	padding: 20px;
	border: 1px solid var(--df-line);
	border-radius: var(--df-radius);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
	z-index: 9999;
}
.message-content { text-align: center; }

/* autocomplete do jQuery UI */
.ui-menu-item { font-size: 0.82rem; }

/* ---------- alertify (msgInfo/alert usados pelo site.js) ---------- */
.ajs-modal { border-radius: var(--df-radius) !important; }
.ajs-modal .ajs-header { font-family: var(--df-font-display); font-size: 1.05rem !important; font-weight: 600 !important; color: var(--df-ink); }
.ajs-modal .ajs-content { padding: 15px !important; }
.ajs-modal .ajs-footer .ajs-button.ajs-ok {
	background-color: var(--df-secondary);
	border-color: var(--df-secondary);
	color: var(--df-on-ink) !important;
	font-weight: normal !important;
	font-size: 0.85rem !important;
	border-radius: 10px;
}

/* gráficos do dashboard */
.grafico { background-color: var(--df-canvas); align-items: center; width: 700px; height: 500px; border: none; }
.grafico .bar { transition: all 0.4s ease; }

/* ---------- complementos usados pelas listas/formulários ---------- */

/* aviso em destaque (ex.: mensagem de bloqueio/cobrança da lista de documentos) */
.df-notice {
	color: var(--df-danger-text);
	font-family: var(--df-font-body);
	font-weight: 500;
	font-size: 0.92rem;
	background: var(--df-danger-bg);
	border-radius: 10px;
	padding: 0.7rem 1rem;
	margin-bottom: 1rem;
}

/* filtros soltos (fora da .df-toolbar) */
.df-toolbar-filtros { margin-bottom: 1rem; }
.df-toolbar-filtros .df-select { flex: 1 1 120px; }

/* tabelas com muitas colunas (Documentos) */
.df-table-dense { min-width: 1180px; font-size: 0.82rem; }
.df-table-dense tbody td { padding: 0.5rem 0.6rem; }
.df-table-dense thead th { padding: 0.6rem 0.6rem; }
.df-table input[type="checkbox"] { accent-color: var(--df-ink); cursor: pointer; width: 16px; height: 16px; }
.df-table .bi-paperclip { color: var(--df-text); font-size: 1rem; }

/* filtros de Documentos: largura mínima que não corta os placeholders */
.df-toolbar-filtros .df-input { flex: 1 1 190px; }
.df-table-dense .df-mono { font-size: 0.78rem; }

/* tabela densa (Documentos): compacta colunas para caber sem rolagem horizontal em telas de notebook */
.df-table-dense { min-width: 0; font-size: 0.8rem; }
.df-table-dense thead th { padding: 0.55rem 0.35rem; letter-spacing: 0.02em; white-space: normal; line-height: 1.15; }
.df-table-dense tbody td { padding: 0.4rem 0.35rem; }
.df-table-dense th.df-col-acao,
.df-table-dense td.df-col-acao { padding-left: 0.05rem; padding-right: 0.05rem; }
.df-table-dense .df-icon-btn { width: 26px; height: 28px; }
.df-table-dense .df-mono { font-size: 0.76rem; }
/* números longos (autorização, CPF) quebram linha só quando falta espaço, evitando rolagem horizontal */
.df-table-dense td.df-mono { white-space: nowrap; }
.df-table-dense td.df-wrap { white-space: normal; overflow-wrap: anywhere; }

/* ---------- gráfico de evolução (Home) ---------- */
.df-chart-card { margin-bottom: 1.25rem; }
/* O Chart.js calcula a posição do mouse em px CSS; com o zoom global do body (--df-zoom) o hover fica deslocado.
   Por isso o zoom é neutralizado só neste container (zoom efetivo = 1) e a altura é escalada pela mesma variável. */
.df-chart { position: relative; height: calc(320px * var(--df-zoom)); width: 100%; zoom: calc(1 / var(--df-zoom)); }
@media (max-width: 640px) {
	.df-chart { height: calc(260px * var(--df-zoom)); }
}
