/* =========================================================
   CHALAZA PORTAL (JSF/PrimeFaces)
   ========================================================= */
/* 1. Instead of using a fixed pixel size (24px) that's too large, configure the font-size as :root.
Use the rem system for smooth scaling when the user zooms (1rem = 16px by default in the browser) */
:root {
	--font-xs: 0.75rem;
	/* 12px */
	--font-sm: 0.875rem;
	/* 14px */
	--font-base: 1rem;
	/* 16px */
	--font-md: 1.125rem;
	/* 18px */
	--font-lg: 1.25rem;
	/* 20px */
	--font-xl: 1.5rem;
	/* 24px */
	--font-xxl: 1.75rem;
	/* 28px */
}

/* Base body */
html, body {
	font-size: var(--font-base);
}

/* ===== Utility: Layout ===== */
.nlogin-screen-name {
	text-align: center;
}

.layout-main {
	flex: 1;
	padding-top: 0px !important;
}

.pt-0 {
	padding-top: 0px !important;
}

.content-panel {
	width: calc(100% - 14px);
	background: white;
	display: flex;
	justify-content: center;
}

.d-flex {
	display: flex;
}

.mgr-5px {
	margin-right: 5px !important;
}

.mgr-10px {
	margin-right: 10px !important;
}

.widtd-max-content {
	width: max-content !important;
}

.ui-outputpanel {
	padding-top: 17px;
}

.ui-button.detail-button {
	width: auto;
}

.contract-table {
	table-layout: fixed;
}

.section {
	margin-bottom: 20px;
}

.None-padding {
	padding: 0px !important;
}

.align-center {
	text-align: center;
}

.align-right {
	text-align: right;
}

.align-content-center {
	align-content: center;
}

/* icon loading */
.icon-loading {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* icon */
.connection-info-icon, .contract-info-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 25px;
	height: 25px;
	border-radius: 50%;
	background: #5B9BD5;
	color: #fff !important;
	font-size: var(--font-md) !important;
	font-weight: bold;
	cursor: pointer;
}

/* =========================================================
   BADGE STYLES
   ========================================================= */
.ui-badge {
	width: 12rem !important;
}

.ui-badge.ui-widget.ui-badge-success {
	background: #83f383;
	color: #000;
}

.ui-badge.ui-widget.ui-badge-warning {
	background: #ffcc31;
	color: #000;
}

.ui-badge.ui-widget.ui-badge-danger {
	background: #ff7280;
	color: #000;
}

/* =========================================================
   MESSAGE LINK (CommandLink in DataTable)
   ========================================================= */
.ui-datatable .ui-state-highlight .cp-message-link {
	color: #ffffff;
	text-decoration: none;
}

.ui-datatable .cp-message-link.ui-button-flat {
	text-decoration: none;
}

/* =========================================================
   CZ-OVERLAY PANEL
   ========================================================= */
.cz-overlay {
	width: 520px;
}

.cz-overlay .ui-overlaypanel-content {
	padding: 0;
}

.cz-overlay-title {
	display: block;
	padding: 8px;
	font-weight: bold;
	font-size: var(--font-md);
	color: #d32f2f;
	border-bottom: 1px solid #ddd;
}

.cz-overlay-detail-box {
	max-height: 220px;
	height: auto;
	overflow-y: auto;
	padding: 8px;
	font-size: var(--font-sm);
	line-height: 1.6;
}

.cz-overlay-line {
	display: flex;
	align-items: flex-start;
	margin-bottom: 6px;
}

/* =========================================================
   SELECT ONE MENU
   ========================================================= */
div.ui-selectonemenu-items-wrapper {
	max-height: 220px !important;
}

/* =========================================================
   DATAVIEW CARD LAYOUT  (.dv-*)
   ========================================================= */
/* link wrapper */
.card-link {
	text-decoration: none !important;
	color: inherit;
	display: flex;
	width: 100%;
}

/* card */
.dv-card {
	flex: 1;
	height: auto;
	display: flex;
	flex-direction: column;
	padding: 16px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
}

.dv-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	border: 1px solid #1E88E5;
}

/* diagram */
.dv-card-image {
	text-align: center;
}

.dv-card-image img {
	width: 100%;
}

.dv-model-title {
	color: #000;
	font-weight: bold;
	margin-top: 8px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: var(--font-xl);
}

.dv-model-desc {
	margin-top: 6px;
	color: #555;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: var(--font-lg);
}

/* =========================================================
   STAT GRID  (Activity / Error stat area)
   ========================================================= */
.stat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px 8px;
	margin-top: 6px;
	padding: 6px 8px;
	background: #f8f9fa;
	border-radius: 6px;
}

.stat-item {
	text-align: center;
}

.stat-item .stat-label {
	display: block;
	font-size: var(--font-xs);
	color: #888;
}

.stat-item .stat-value {
	display: block;
	font-size: var(--font-base);
	font-weight: 600;
	color: #333;
}

/* =========================================================
   DATAVIEW RESPONSIVE GRID
   ========================================================= */
/* Desktop: 4 cards / row */
.ui-dataview .ui-dataview-column {
	width: 50%;
	padding-right: 13px;
	box-sizing: border-box;
	display: flex;
}

/* Tablet: 2 cards / row */
@media ( max-width : 992px) {
	.ui-dataview .ui-dataview-column {
		width: 50%;
	}
}

/* Mobile: 1 card / row */
@media ( max-width : 576px) {
	.ui-dataview .ui-dataview-column {
		width: 100%;
	}
}

/* Activity / Error DataView: wider cards (2 per row) */
.activity-dataview .ui-dataview-column, .error-dataview .ui-dataview-column
	{
	width: 50%;
}

@media ( max-width : 768px) {
	.activity-dataview .ui-dataview-column, .error-dataview .ui-dataview-column
		{
		width: 100%;
	}
}

@media ( max-height : 700px) {
	.notifications-scroll {
		height: calc(100vh - 180px) !important;
	}
}

.no-header-dataview .ui-dataview-header {
	display: none !important;
}

/* =========================================================
   FLOATING CONTACT BUTTON  (.floating-contact-btn)
   ========================================================= */
.floating-contact-btn {
	position: fixed !important;
	right: 32px !important;
	bottom: 32px !important;
	z-index: 99999 !important;
}

.floating-contact-btn:hover {
	background: #1d4ed8;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.floating-contact-btn .pi-envelope {
	font-size: var(--font-lg);
}

@media ( max-width : 576px) {
	.floating-contact-btn {
		padding: 10px 16px;
		font-size: var(--font-sm);
		gap: 8px;
	}
}

/* =========================================================
   DASHBOARD GRID & STAT CARDS
   (Refactored for 200% Zoom Responsive)
   ========================================================= */
.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
	gap: 20px;
	margin: 20px;
}

@media ( max-width : 1280px) {
	.dashboard-grid {
		grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	}
}

.ui-message.ui-message-info {
	background: #4a95e3 !important;
}

.ui-message-info-detail {
	font-size: var(--font-xl);
	line-height: 1.4;
	color: #fff;
}

.ui-message.ui-message-info .ui-message-info-icon {
	display: none !important;
}

.stat-card {
	display: flex;
	align-items: center;
	padding: 18px 22px;
	border-radius: 10px;
	border: 1px solid;
	background: #ffffff;
	transition: all 0.2s ease;
	min-width: 0;
	box-sizing: border-box;
}

.stat-card img {
	width: 65px;
	height: 65px;
	margin-right: 10px;
}

.stat-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-content {
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex: 1;
	gap: 10px;
}

.stat-title {
	font-size: var(--font-xl);
	line-height: 1.4;
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.stat-value {
	font-size: var(--font-xxl);
	font-weight: 700;
	margin-top: 4px;
	line-height: 1.2;
}

/* =========================================================
   COLOR SYSTEM  (.blue / .green / .red / .yellow)
   ========================================================= */
.blue {
	border-color: #90caf9;
	background: #e3f2fd;
}

.blue .icon-circle {
	background: #1e88e5;
	color: white;
}

.blue .stat-value {
	color: #1565c0;
}

.green {
	border-color: #a5d6a7;
	background: #e8f5e9;
}

.green .icon-circle {
	background: #43a047;
	color: white;
}

.green .stat-value {
	color: #2e7d32;
}

.red {
	border-color: #ef9a9a;
	background: #ffebee;
}

.red .icon-circle {
	background: #e53935;
	color: white;
}

.red .stat-value {
	color: #c62828;
}

.yellow {
	border-color: #ffe082;
	background: #fff8e1;
}

.yellow .icon-circle {
	background: #fbc02d;
	color: white;
}

.yellow .stat-value {
	color: #f9a825;
}

/* =========================================================
   PANEL HEADER FLEX
   ========================================================= */
.panel-header-flex {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 5px 20px;
	font-size: var(--font-xl);
}

.panel-header-flex .detail-link {
	font-size: var(--font-xl) !important;
}

.panel-title {
	font-weight: 600;
}

.detail-button {
	white-space: nowrap;
}

.panel-header-flex .ui-button {
	width: auto !important;
	display: inline-flex !important;
}

.panel-header-flex .ui-button.ui-state-disabled {
	display: inline-flex !important;
	opacity: 0.6;
}

.layout-breadcrumb {
	width: 100%;
	position: fixed;
	top: 75px;
	z-index: 99;
}

.ui-panel.linear-gradient-panel1 .ui-panel-content {
	border: none !important;
	padding: 0 !important;
}

/* =========================================================
   LOGIN & NOTIFICATION STYLES
   ========================================================= */
.stmButton {
	background: #1E88E5;
	color: #ffffff;
	border: 1px solid #1E88E5;
	margin: 0;
	outline: 0 none;
	border-radius: 8px;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s,
		box-shadow 0.15s;
	width: 150px;
	height: 45px;
	cursor: pointer;
	font-size: var(--font-lg);
}

body .ui-messages .ui-messages-close {
	top: 0px !important;
}

.loading-icon {
	font-size: var(--font-lg);
	color: var(--primary-color);
}

.pi-spinner:before {
	font-size: var(--font-lg);
}

.layout-footer {
	height: 85px;
}

.p-password-toggle-right .p-password-toggle-mask {
	right: 0.75rem !important;
	left: auto !important;
}

/* Modern Notification Card Styles */
.clean-dataview.ui-dataview {
	border: none !important;
}

.clean-dataview .ui-dataview-content {
	border: none !important;
	background: transparent !important;
	padding: 0 !important;
}

.clean-dataview .ui-dataview-header {
	display: none !important;
}

.notification-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 12px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px
		rgba(0, 0, 0, 0.06);
	transition: transform 0.2s, box-shadow 0.2s;
	cursor: pointer;
}

.notification-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px
		rgba(0, 0, 0, 0.05);
}

.card-top-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.notification-date {
	color: #718096;
	font-size: var(--font-sm);
	font-weight: 600;
}

.notification-tag {
	padding: 2px 12px;
	border-radius: 6px;
	font-size: var(--font-xs);
	font-weight: 700;
	color: white;
	text-align: center;
	display: inline-block;
	border: 1px solid transparent;
}

.badge-important {
	background-color: #fee2e2;
	color: #ef4444;
	border-color: #f87171;
}

.badge-new {
	background-color: #e0f2fe;
	color: #0284c7;
	border-color: #38bdf8;
}

.badge-info {
	background-color: #ffedd5;
	color: #f97316;
	border-color: #fb923c;
}

.badge-default {
	background-color: #f3f4f6;
	color: #4b5563;
	border-color: #9ca3af;
}

.notification-title {
	font-weight: 600;
	font-size: var(--font-md);
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.notification-summary {
	color: #4a5568;
	font-size: var(--font-sm);
	line-height: 1.5;
	max-width: 30ch;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.notification-detail-dialog {
	border-radius: 16px !important;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px
		rgba(0, 0, 0, 0.04) !important;
	border: 1px solid #e2e8f0 !important;
	padding: 0 !important;
}

.notification-detail-dialog .ui-overlaypanel-content {
	padding: 32px !important;
}

.dialog-close {
	position: absolute;
	top: 19px;
	right: 6px;
	font-size: var(--font-lg);
	cursor: pointer;
	color: #6b7280;
}

.dialog-close:hover {
	color: #111827;
}

.notifications-scroll {
	height: calc(100vh - 210px);
	overflow-y: auto;
	padding-right: 8px;
	padding-top: 4px;
}

.detail-header-top {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.detail-title {
	font-size: var(--font-lg);
	font-weight: 700;
	color: #1a202c;
	margin: 0;
}

.detail-info-row {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-left: 50px;
	margin-bottom: 18px;
}

.detail-date-label {
	color: #4a5568;
	font-weight: 600;
}

.detail-body {
	line-height: 1.7;
	color: #2d3748;
	white-space: pre-line;
	font-size: var(--font-base);
}

.ui-dataview-row {
	border: none !important;
}

#crumbs {
	text-align: center;
}

#crumbs ul {
	padding: 0;
	list-style: none;
	display: inline-table;
}

#crumbs ul li {
	display: inline;
	display: block;
	float: left;
	height: 20px;
	background: #2176CA;
	text-align: center;
	padding: 0 100px 0 100px;
	position: relative;
	margin: 0 7px 0 0;
	font-size: 10px;
	text-decoration: none;
	color: #fff;
}

#crumbs ul li:after {
	content: "";
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 10px solid #2176CA;
	position: absolute;
	right: -10px;
	top: 0;
	z-index: 1;
}

#crumbs ul li:before {
	content: "";
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 10px solid white;
	position: absolute;
	left: 0;
	top: 0;
}

.active0 {
	background: grey !important;
}

.active0:after {
	border-left-color: grey !important;
}

.active1 {
	background: #DCEDFB !important;
}

.active1:after {
	border-left-color: #DCEDFB !important;
}

.active2 {
	background: #B3DCFB !important;
}

.active2:after {
	border-left-color: #B3DCFB !important;
}

.active3 {
	background: #8FCCFC !important;
}

.active3:after {
	border-left-color: #8FCCFC !important;
}

.active4 {
	background: #6FBEFC !important;
}

.active4:after {
	border-left-color: #6FBEFC !important;
}

.active5 {
	background: #4EAFFB !important;
}

.active5:after {
	border-left-color: #4EAFFB !important;
}

.active6 {
	background: #2CA1FD !important;
}

.active6:after {
	border-left-color: #2CA1FD !important;
}

.active7 {
	background: #028FFD !important;
}

.active7:after {
	border-left-color: #028FFD !important;
}

/* Logo Topbar */
.layout-wrapper.layout-horizontal .layout-topbar .layout-topbar-wrapper .layout-topbar-left .layout-topbar-logo-wrapper .layout-topbar-logo img
	{
	height: 80px !important;
	width: 80px !important;
	border: 0 none;
}

.layout-footer .logo-text img {
	height: 80px;
	width: 80px;
}

.adapterProgressItem {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 14%
}

.adapterProgressItem p {
	margin: 0px !important;
}

.adapterProgressItem img {
	width: 105%;
	height: 120%;
}

.adapterProgressText {
	position: absolute;
}

.colorTextERROR {
	color: red;
}

.borderTree .ui-treenode-content {
	margin-top: 5px !important;
	margin-bottom: 5px !important;
	background-color: #eceff4 !important;
	height: 40px !important;
	border-radius: 8px !important;
}

.borderTree .ui-treenode-content:hover {
	background-color: #eceff4 !important;
	cursor: pointer;
}

.borderTree span.ui-treenode-label {
	width: 100%;
}

.borderTree button {
	width: 100%;
	text-align: left;
	color: #212529 !important;
}

.borderTree button:hover {
	background-color: #eceff4 !important;
}

/* wrapper full screen */
.layout-wrapper.layout-horizontal {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* STATUS BADGES */
.status-badge {
	display: inline-flex;	
	font-size: var(--font-base) !important;
	align-items: center;
	align-content: center;
	width: 12rem !important;
	height: 2.2rem !important;
	border-radius: 999px;
}

.status-warning {
	background: #f0b323;
}

.status-success {
	background: #7edc8b;
}

.ui-badge {
	margin: 0 34px;
}

/* TIME BADGES */
.time-badge {
	display: inline-flex;
	font-size: var(--font-base) !important;
	align-items: center;
	justify-content: center;
	width: 12rem !important;
	height: 2.1rem !important;
	border-radius: 6px;
	
}

.time-success {
	background: #bffb88;
	border: 1px solid #3db93d;
}

.time-error {
	background: #ff6b6bad;
	border: 1px solid #f12f2f;
}

.time-warning {
	background: #fdff85;
	border: 1px solid #e6a700;
}

.time-running {
	background: #9fdaf1;
	border: 1px solid #1a4fa3;
}

.time-blank {
	border: 1px solid #1a4fa3;
}

/* LARGE ICON BUTTON */
.large-icon-button.ui-button .ui-button-icon-left {
	font-size: 20px !important;
}

/* HEADER COMMON CONTENT */
.link-header {
	display: flex;
	align-items: center;
	border: 1px solid #ddd;
	margin: 18px;
	padding: 12px 16px;
}

.header-back {
	margin-right: 20px;
}

.header-content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.header-top {
	display: flex;
	align-items: center;
}

.card-flow {
	display: flex;
	align-items: center;
}

.card-flow img {
	max-width: 100%;
	height: auto;
}

.link-info {
	margin-left: 50px;
	display: flex;
	font-size: var(--font-lg);
	flex:1 1 auto;
	min-width:0;
}

.info-group {
	padding-left: 6px;
	display: flex;
	gap: 8px;
	min-width: 0;
	width: 100%;
	/* max-width: 720px; */
	flex-wrap: nowrap; 
	box-sizing: border-box;
}

.info-group span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1 1 0%;
	min-width: 0;
}

@media (max-width:1280px){
  .header-top{
  	flex-wrap:wrap;
  	align-items: flex-start;
  	}   /* cho phép rớt dòng ở cấp header */
  .link-info{
    margin-left:6px;               /* bỏ lề khi xuống hàng */
    flex-basis:100%;             /* chiếm trọn hàng 2 */
    min-width:0;                 /* giữ cho ellipsis chạy */
    flex: 0 1 100%;
	}
  .info-group {
	max-width: 100% !important;
	}
}

.link-info .info-group:last-child {
	margin-left: 0px;
}

.label-bold {
	color: #212529;
	font-weight: 600;
	flex-shrink: 0;
	flex: 0 0 auto;
	white-space:nowrap;
}

.header-desc {
	padding-left: 6px;
	font-size: var(--font-md);
	color: #666;
}

@media screen and (max-width: 1400px) {
	.link-info {
		margin-left: 0;
	}
	.info-group {
		display: flex;
		min-width: 0;
		max-width: 600px;
	}
}
