:root {
	--unicamp-red: #b91c1c;
	--primary-blue: #1e40af;
	--sidebar-bg: #0f172a;
	--main-bg: #f8fafc;
	--text-slate: #334155;
}

body, h1, h2, h3, h4, h5, h6, a, button, p, span {
	font-family: "Roboto", "Raleway", sans-serif !important;
	-webkit-font-smoothing: antialiased;
}

body {
	background-color: var(--main-bg);
	color: var(--text-slate);
	font-size: 14px;
}

/* Estrutura Lateral e Principal */
.dashboard-sidebar {
	width: 260px;
	background-color: var(--sidebar-bg);
	color: #f8fafc;
	position: fixed;
	height: 100%;
	z-index: 10;
	transition: 0.3s ease;
}

.dashboard-main {
	margin-left: 260px;
	min-height: 100vh;
	transition: 0.3s ease;
}

/* Componentes de Tabela Moderna (SaaS) */
.table-container {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	overflow: hidden; /* Mantém as bordas arredondadas limpas */
}

.modern-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
}

.modern-table th {
	background-color: #f8fafc;
	padding: 6px 10px;
	font-size: 13px;
	font-weight: 700;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 1px solid #e2e8f0;
}

.modern-table td {
	padding: 6px 10px;
	border-bottom: 1px solid #f1f5f9;
	color: #475569;
	vertical-align: middle;
	font-size: 13px;
}

.modern-table tbody tr {
	transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
	background-color: #f8fafc;
}

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

/* Estilização de Badges e Perfis */
.avatar-circle {
	width: 36px; height: 36px;
	border-radius: 50%;
	background: linear-gradient(135deg, #3b82f6, #1d4ed8);
	color: white;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
	margin-right: 12px;
}

.role-badge {
	padding: 4px 10px;
	border-radius: 9999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.role-admin { background-color: #fee2e2; color: #b91c1c; }
.role-user { background-color: #e0f2fe; color: #0369a1; }
.role-external { background-color: #fef3c7; color: #b45309; }

/* Botões de Ação da Tabela */
.action-btn {
	width: 32px; height: 32px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	transition: all 0.2s ease;
	background: transparent;
	cursor: pointer;
	color: #64748b;
}

.action-btn:hover { border-color: #cbd5e1; background: #ffffff; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.btn-view:hover { color: #0ea5e9; }
.btn-edit:hover { color: #f59e0b; }
.btn-delete:hover { color: #ef4444; border-color: #fca5a5; background: #fef2f2; }

/* Customização da Paginação do Laravel */
.pagination-wrapper {
	padding: 16px 20px;
	background-color: #ffffff;
	border-top: 1px solid #e2e8f0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

/* Força o design dos links de paginação nativos do Laravel para casar com a UI */
.pagination-wrapper nav { width: 100%; display: flex; justify-content: flex-end; }
.pagination-wrapper p { margin: 0; font-size: 13px; color: #64748b; }

.services-row-flex {
	display: flex;
	flex-wrap: wrap;
	margin-left: -8px;
	margin-right: -8px;
}

.category-card-wrapper {
	display: flex;
	flex-direction: column;
}

.service-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px !important;
	transition: all 0.3s ease;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
}

.service-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08) !important;
	border-color: #cbd5e1;
}

/* Limitador de Altura Máxima Dinâmico (4 Linhas Visíveis Antes do Scroll) */
.card-links-container {
	max-height: 180px; 
	overflow-y: auto;
	flex-grow: 1;
	scrollbar-width: auto;
	scrollbar-color: #cbd5e1 #f8fafc;
}

.card-links-container::-webkit-scrollbar { width: 6px; }
.card-links-container::-webkit-scrollbar-track { background: #f8fafc; }
.card-links-container::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 20px; }

/* Estilização Base de cada Linha/Link */
.service-link {
	font-size: 14px !important;
	padding: 12px 18px !important;
	display: flex;
	align-items: center;
	border-bottom: 1px solid #f1f5f9;
	color: #475569 !important;
	text-decoration: none;
	transition: all 0.2s ease;
	height: 45px;
	box-sizing: border-box;
}

.service-link:hover {
	background-color: #f1f5f9 !important;
	color: var(--primary-blue) !important;
	padding-left: 22px !important;
}

.service-link i:first-child {
	width: 20px;
	font-size: 14px;
	text-align: center;
	margin-right: 12px;
	color: #94a3b8;
}

/* Submenus Colapsáveis (Estilo Accordion) */
.submenu-trigger { cursor: pointer; user-select: none; }
.submenu-trigger .chevron-icon { margin-left: auto; transition: transform 0.2s ease; font-size: 11px; color: #94a3b8; }
.submenu-active .chevron-icon { transform: rotate(180deg); color: var(--primary-blue); }
.submenu-content { display: none; background-color: #fafbfd; border-left: 3px solid #cbd5e1; }
.submenu-link { padding-left: 36px !important; font-size: 13.5px !important; background-color: #fafbfd !important; }

/* Controle de Acesso Restrito (Contas Externas) */
.service-link-disabled { opacity: 0.45 !important; cursor: not-allowed !important; pointer-events: none !important; background-color: #f8fafc !important; }
.lock-badge { margin-left: auto; font-size: 10px; color: #b91c1c; background-color: #fee2e2; padding: 2px 8px; border-radius: 9999px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* Container Premium do Formulário */
.form-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

.form-label {
	display: block;
	font-weight: 700;
	font-size: 13.5px;
	color: #475569;
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.form-control-custom {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background-color: #ffffff;
	color: #1e293b;
	font-size: 15px;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.form-control-custom:focus {
	border-color: var(--primary-blue);
	outline: none;
	box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.form-control-readonly {
	background-color: #f1f5f9 !important;
	color: #64748b !important;
	cursor: not-allowed;
}

/* Customização dos checkboxes de Papéis */
.role-selection-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
	margin-top: 8px;
}

.role-checkbox-card {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	cursor: pointer;
	transition: all 0.2s ease;
	background-color: #ffffff;
}

.role-checkbox-card:hover {
	border-color: #cbd5e1;
	background-color: #f8fafc;
}

.role-checkbox-card input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin-right: 12px;
	cursor: pointer;
}

/* Info Banner */
.info-banner-ad {
	background-color: #eff6ff;
	border-left: 4px solid #3b82f6;
	color: #1e3a8a;
}

.info-banner-local {
	background-color: #fffbeb;
	border-left: 4px solid #f59e0b;
	color: #78350f;
}

/* Grid Flexível de Cards */
.logos-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 24px;
	margin-top: 24px;
}
.logo-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

/* Área de Preview do Logo */
.logo-preview-box {
	height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	position: relative;
	background-color: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}

/* Tabuleiro/Grid de transparência para logos coloridos/pretos */
.bg-transparency-grid {
	background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
	background-size: 16px 16px;
}

/* Fundo escuro premium para destacar logos brancos */
.bg-dark-logo {
	background-color: #0f172a !important;
	background-image: radial-gradient(#1e293b 1px, transparent 1px);
	background-size: 16px 16px;
}

.logo-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	transition: transform 0.3s ease;
}

.logo-card:hover .logo-img {
	transform: scale(1.05);
}

/* Badges de Metadados do Logo */
.badge-lang {
	position: absolute;
	top: 12px;
	left: 12px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 9999px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Botões de Download do Card */
.download-btn-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
	gap: 8px;
	padding: 16px;
	background-color: #ffffff;
}

.download-pill {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 8px 4px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	color: #475569;
	font-weight: 700;
	font-size: 12px;
	text-decoration: none;
	transition: all 0.2s ease;
	background-color: #f8fafc;
}

.download-pill:hover {
	border-color: var(--primary-blue);
	color: var(--primary-blue);
	background-color: #eff6ff;
}

.download-pill i {
	font-size: 14px;
	margin-bottom: 4px;
	color: #94a3b8;
}

.download-pill:hover i {
	color: var(--primary-blue);
}

/* Grid Flexível de Cards */
.docs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	margin-top: 24px;
}

/* Card Premium do Documento */
.doc-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	height: 100%;
}

.doc-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
	border-color: #cbd5e1;
}

/* Ícone de Formato do Documento */
.doc-icon-wrapper {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	margin-bottom: 16px;
}

.icon-pdf {
	background-color: #fee2e2;
	color: #ef4444;
}

.icon-png {
	background-color: #e0f2fe;
	color: #0284c7;
}

/* Tag de Categoria */
.doc-tag {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 9999px;
	display: inline-block;
	margin-bottom: 12px;
}

.tag-planejamento { background-color: #f0fdf4; color: #16a34a; }
.tag-estrutura { background-color: #eff6ff; color: #1d4ed8; }
.tag-regimento { background-color: #fffbeb; color: #d97706; }

/* Botão de Download */
.btn-download-doc {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 13.5px;
	color: #ffffff;
	background-color: var(--primary-blue);
	text-decoration: none;
	transition: background-color 0.2s ease;
	margin-top: 16px;
}

.btn-download-doc:hover {
	background-color: #1d4ed8;
}

.comissao-list-item {
	transition: all 0.2s ease;
	border-left: 3px solid transparent;
}

.comissao-list-item.active {
	background-color: #eff6ff;
	border-left-color: var(--primary-blue);
}

/* Filtro de Busca */
.search-wrapper { position: relative; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.search-input { padding-left: 44px !important; border-radius: 12px !important; border: 1px solid #cbd5e1; transition: 0.2s ease; height: 48px; }
.search-input:focus { border-color: var(--primary-blue); box-shadow: 0 4px 12px rgba(30, 64, 175, 0.05); }

/* Responsividade */
@media (max-width: 1080px) {
	.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 992px) {
	.dashboard-sidebar { margin-left: -260px; }
	.dashboard-sidebar.open { margin-left: 0; }
	.dashboard-main { margin-left: 0; }
	.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.pagination-wrapper { flex-direction: column; align-items: flex-start; }
}
