/* Tabs */

.monit-tabs {
	display: flex;
	gap: .5rem;
	margin-bottom: 2rem;
	border-bottom: 1px solid #e0e8ef;
	padding-bottom: .5rem;
}
.monit-tab {
	padding: .6rem 1.2rem;
	border-radius: 20rem;
	font-size: .9rem;
	font-weight: bold;
	color: #2e85c5;
	background: none;
	border: none;
	cursor: pointer;
	transition: all 250ms cubic-bezier(0.215, 0.61, 0.355, 1);
}
.monit-tab:hover {
	background: rgba(46, 133, 197, .08);
}
.monit-tab.active {
	background: #2e85c5;
	color: #fff;
}



/* Panels */

.monit-panel {
	display: none;
}
.monit-panel.active {
	display: block;
}



/* KPI Cards */

.monit-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.2rem;
	margin-bottom: 3rem;
}
.monit-card {
	background: #fff;
	border-radius: .8rem;
	padding: 1.5rem;
	box-shadow: 0 .5rem 1.5rem rgba(186, 205, 214, .35);
	cursor: pointer;
	transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
}
.monit-card:hover {
	box-shadow: 0 .5rem 1.5rem rgba(97, 145, 167, .45);
	transform: translateY(-.15rem);
}
.monit-card-head {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-bottom: 1rem;
}
.monit-card-dot {
	width: .6rem; height: .6rem;
	border-radius: 50%;
}
.monit-card-dot.http    { background: #2e85c5; }
.monit-card-dot.errors  { background: #e74c3c; }
.monit-card-dot.servers { background: #4caf50; }
.monit-card-dot.ia      { background: #9b59b6; }
.monit-card-dot.notifs  { background: #ff9800; }
.monit-card-dot.crons   { background: #009688; }
.monit-card-title {
	font-size: .85rem;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #8a9bb5;
}
.monit-card-kpis {
	display: flex;
	gap: 1.5rem;
}
.monit-kpi {
	display: flex;
	flex-direction: column;
}
.monit-kpi b {
	font-size: 1.5rem;
	font-weight: 700;
	color: #003974;
	line-height: 1.2;
}
.monit-kpi span {
	font-size: .75rem;
	color: #8a9bb5;
	margin-top: .15rem;
}



/* Histogram */

.monit-histo {
	display: flex;
	align-items: stretch;
	height: 10rem;
	gap: 2px;
	padding: .5rem 0 1.5rem;
	position: relative;
	border-bottom: 1px solid #e0e8ef;
	margin-bottom: 2rem;
}
.monit-histo-bar {
	flex: 1;
	height: 100%;
	position: relative;
	cursor: default;
	display: flex;
	align-items: flex-end;
}
.monit-histo-bar::after {
	content: '';
	display: block;
	width: 100%;
	height: var(--h, 0%);
	min-height: 1px;
	background: var(--c);
	border-radius: 2px 2px 0 0;
	transition: height 400ms cubic-bezier(0.215, 0.61, 0.355, 1);
}
.monit-histo-bar:hover {
	z-index: 10;
}
.monit-histo-bar:hover::after {
	opacity: .8;
}
.monit-histo-bar.clickable {
	cursor: pointer;
}
.monit-histo-bar.dimmed::after {
	opacity: .3;
}
.monit-histo-bar.selected::after {
	opacity: 1;
	box-shadow: 0 0 0 2px #003974;
}
.monit-histo-bar.empty::after {
	min-height: 2px;
	opacity: .25;
}
.monit-histo-bar .tip {
	display: none;
	position: absolute;
	bottom: var(--h, 0%);
	left: 50%;
	transform: translateX(-50%);
	background: #003974;
	color: #fff;
	padding: .25rem .5rem;
	border-radius: .25rem;
	font-size: .7rem;
	white-space: nowrap;
	margin-bottom: .3rem;
	pointer-events: none;
	z-index: 11;
}
.monit-histo-bar:hover .tip {
	display: block;
}
.monit-histo-label {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	display: flex;
	justify-content: space-between;
	font-size: .65rem;
	color: #8a9bb5;
}
.monit-histo-empty {
	width: 100%;
	text-align: center;
	color: #8a9bb5;
	font-size: .85rem;
	padding: 3rem 0;
}



/* Search */

.monit-search {
	display: flex;
	gap: .75rem;
	margin-bottom: 1.5rem;
}
.monit-search input {
	flex: 1;
	font-size: .9rem;
	padding: .6rem .75rem;
	border: 1px solid #d0dbe5;
	border-radius: .4rem;
	color: #003974;
	background: #fff;
}
.monit-search input:focus {
	border-color: #2e85c5;
	outline: none;
}
.monit-search .btn {
	white-space: nowrap;
}



/* Category filter */

.monit-cat-filter {
	display: flex;
	gap: .4rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}
.monit-cat-block {
	padding: .3rem .65rem;
	border: 1px solid #d0dbe5;
	border-radius: .3rem;
	font-size: .78rem;
	color: #5a7896;
	background: #fff;
	cursor: pointer;
	white-space: nowrap;
	transition: all 120ms ease;
}
.monit-cat-block:hover {
	border-color: #e74c3c;
	color: #003974;
}
.monit-cat-block.active {
	border-color: #e74c3c;
	background: #e74c3c;
	color: #fff;
	font-weight: bold;
}

/* Date pickers */

.monit-dates {
	display: flex;
	align-items: center;
	gap: .3rem;
}
.monit-date {
	font-size: .8rem;
	padding: .3rem .5rem;
	border: 1px solid #d0dbe5;
	border-radius: .3rem;
	color: #003974;
	background: #fff;
	cursor: pointer;
}
.monit-date:focus {
	border-color: #2e85c5;
	outline: none;
}
.monit-date-sep {
	font-size: .75rem;
	color: #8a9bb5;
}

/* Toolbar */

.monit-toolbar {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}
.monit-total {
	font-size: .9rem;
	color: #003974;
	font-weight: bold;
	margin: 0;
}
.monit-intervals {
	display: flex;
	gap: .25rem;
}
.monit-intervals button {
	padding: .3rem .7rem;
	border: 1px solid #d0dbe5;
	border-radius: .3rem;
	font-size: .75rem;
	font-weight: bold;
	color: #8a9bb5;
	background: #fff;
	cursor: pointer;
	transition: all 200ms ease;
}
.monit-intervals button:hover {
	border-color: #2e85c5;
	color: #2e85c5;
}
.monit-intervals button.active {
	background: #2e85c5;
	border-color: #2e85c5;
	color: #fff;
}
.monit-regroups {
	display: flex;
	gap: .25rem;
	margin-left: auto;
}
.monit-regroups button {
	padding: .3rem .7rem;
	border: 1px solid #d0dbe5;
	border-radius: .3rem;
	font-size: .75rem;
	color: #8a9bb5;
	background: #fff;
	cursor: pointer;
	transition: all 200ms ease;
}
.monit-regroups button:hover {
	border-color: #2e85c5;
	color: #2e85c5;
}
.monit-regroups button.active {
	background: #003974;
	border-color: #003974;
	color: #fff;
}



/* Table */

.monit-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .85rem;
	margin-bottom: 1.5rem;
}
.monit-table thead th {
	text-align: left;
	padding: .6rem .5rem;
	font-weight: bold;
	color: #8a9bb5;
	font-size: .75rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	border-bottom: 2px solid #e0e8ef;
	white-space: nowrap;
	cursor: pointer;
}
.monit-table thead th:hover {
	color: #2e85c5;
}
.monit-table thead th.sorted {
	color: #003974;
}
.monit-table thead th.sorted:after {
	content: ' \25BE';
}
.monit-table thead th.sorted.asc:after {
	content: ' \25B4';
}
.monit-table tbody td {
	padding: .5rem;
	border-bottom: 1px solid #f0f3f6;
	color: #003974;
	max-width: 18rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.monit-table tbody tr:hover td {
	background: rgba(46, 133, 197, .04);
}
.monit-table .tag {
	display: inline-block;
	padding: .1rem .4rem;
	border-radius: .2rem;
	font-size: .75rem;
	font-weight: bold;
}
.monit-table .tag.get     { background: #e3f2fd; color: #1565c0; }
.monit-table .tag.post    { background: #e8f5e9; color: #2e7d32; }
.monit-table .tag.put     { background: #fff3e0; color: #e65100; }
.monit-table .tag.delete  { background: #fce4ec; color: #c62828; }
.monit-table .tag.patch   { background: #f3e5f5; color: #6a1b9a; }
.monit-table .tag.success { background: #e8f5e9; color: #2e7d32; }
.monit-table .tag.error   { background: #fce4ec; color: #c62828; }
.monit-table .tag.pending { background: #fff3e0; color: #e65100; }
.monit-table .mono {
	font-family: monospace;
	font-size: .8rem;
}
.monit-table .err {
	color: #e74c3c;
}
.monit-table .num {
	font-variant-numeric: tabular-nums;
	text-align: right;
}
.monit-table .monit-empty td {
	text-align: center;
	color: #8a9bb5;
	padding: 2rem;
}
.monit-table tbody tr {
	cursor: pointer;
}
.monit-table tbody tr.selected td {
	background: rgba(46, 133, 197, .1);
	border-bottom-color: rgba(46, 133, 197, .2);
}

/* JSON preview */

.monit-json {
	display: none;
	background: #1e2a3a;
	color: #e0ecf8;
	padding: 1rem 1.25rem;
	border-radius: .5rem;
	font-size: .78rem;
	line-height: 1.5;
	max-height: 24rem;
	overflow: auto;
	white-space: pre-wrap;
	word-break: break-all;
	margin: 0 0 1rem;
}
.monit-json.visible {
	display: block;
}



/* Pagination */

.monit-pager {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: .75rem;
}
.monit-page-info {
	font-size: .85rem;
	color: #8a9bb5;
}



/* Regroup results */

.monit-table .regroup-row td {
	background: #f8fafc;
	font-weight: bold;
}
.monit-table .regroup-row .regroup-count {
	font-size: .75rem;
	color: #8a9bb5;
	font-weight: normal;
	margin-left: .5rem;
}



/* Servers panel */

.monit-srv-bar {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 2rem;
}
.monit-srv-filter {
	display: flex;
	gap: .4rem;
	flex-wrap: wrap;
}
.monit-srv-block {
	padding: .35rem .75rem;
	border: 1px solid #d0dbe5;
	border-radius: .4rem;
	font-size: .8rem;
	color: #5a7896;
	background: #fff;
	cursor: pointer;
	white-space: nowrap;
	transition: all 120ms ease;
}
.monit-srv-block:hover {
	border-color: #2e85c5;
	color: #003974;
}
.monit-srv-block.active {
	border-color: #2e85c5;
	background: #2e85c5;
	color: #fff;
	font-weight: bold;
}
.monit-srv-intervals {
	display: flex;
	gap: .25rem;
}
.monit-srv-intervals button {
	padding: .4rem .9rem;
	border: 1px solid #d0dbe5;
	border-radius: .3rem;
	font-size: .8rem;
	font-weight: bold;
	color: #8a9bb5;
	background: #fff;
	cursor: pointer;
	transition: all 200ms ease;
}
.monit-srv-intervals button:hover {
	border-color: #4caf50;
	color: #4caf50;
}
.monit-srv-intervals button.active {
	background: #4caf50;
	border-color: #4caf50;
	color: #fff;
}
.monit-srv-charts {
	display: flex;
	flex-direction: column;
	gap: .5rem;
}
.monit-srv-chart {
	background: #fff;
	border-radius: .6rem;
	padding: 1.2rem 1.5rem;
	box-shadow: 0 .3rem 1rem rgba(186, 205, 214, .25);
}
.monit-srv-chart h3 {
	font-size: .95rem;
	font-weight: bold;
	color: #003974;
	margin: 0 0 .5rem;
}
.monit-srv-chart h3 q {
	font-size: .75em;
	color: #8a9bb5;
	font-weight: normal;
}
.monit-srv-chart .monit-histo {
	height: 8rem;
	margin-bottom: .5rem;
	border-bottom: none;
}
.monit-srv-row {
	display: flex;
	gap: .5rem;
}
.monit-srv-chart.half {
	flex: 1;
}



/* Loading state */

.monit-card.loading .monit-kpi b {
	color: #d0dbe5;
	animation: monit-pulse 1.5s ease infinite;
}
@keyframes monit-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .4; }
}



/* Responsive */

@media only screen and (max-width: 780px) {
	.monit-cards {
		grid-template-columns: repeat(2, 1fr);
	}
	.monit-search {
		flex-direction: column;
	}
	.monit-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}
	.monit-regroups {
		margin-left: 0;
		flex-wrap: wrap;
	}
	.monit-table {
		font-size: .75rem;
	}
	.monit-srv-row {
		flex-direction: column;
	}
}
