/* =========================================================
   1. RESET CSS
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    overflow: hidden;
}

@font-face {
    font-family: 'Roboto';
    src: url('/css/fonts/Roboto-VariableFont.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
    background: #ffffff;
    overflow: hidden;
}

/* =========================================================
   2. HEADER
   ========================================================= */
.header {
	flex: 0 0 auto;
	width: 100%;
	min-width: 0;
	flex-shrink: 0;
}

.top-box {
	width: 100%;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: clamp(4px, 0.5vw, 10px);
	padding: clamp(4px, 0.6vw, 12px);
	background: #32556e;
	color: #fff;
}

.logo-left, .logo-right {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.logo-left {
	justify-content: flex-start;
}

.logo-right {
	justify-content: flex-end;
	gap: clamp(2px, 0.3vw, 6px);
}

.logo1 {
    width: clamp(110px, 12cqw, 260px);
    height: clamp(85px, 9cqh, 140px);
    object-fit: contain;
    flex-shrink: 0;
   
}

.logo2, .logo3 {
	width: clamp(35px, 5vw, 80px);
	height: clamp(35px, 5vw, 80px);
	object-fit: contain;
}

.header-title {
	min-width: 0;
	text-align: center;
}

.header-title h1 {
    margin: 0;
    font-size: clamp(32px, 3.5vw, 80px);
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.header-title h2 {
    margin: 8px 0 0;
    font-size: clamp(24px, 2.2vw, 50px);
    font-weight: 600;
    line-height: 1;
    color: #fff;
}

/* =========================================================
   3. AREA UTAMA VIDEOTRON
   ========================================================= */
.videotron {
	position: relative;
	flex: 1 1 0;
	width: 100%;
	min-width: 0;
	min-height: 0;
	height: auto;
	margin: 0;
	padding: 0;
	overflow: hidden;
	/* Container query untuk responsive berdasarkan area videotron */
	container-type: size;
	isolation: isolate;
}

#contentForm {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	position: relative;
	overflow: hidden;
}

/* =========================================================
   4. DEFAULT VIDEOTRON
   ========================================================= */
.default-videotron {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	padding: clamp(15px, 5vw, 100px);
	text-align: center;
	font-size: clamp(24px, 4vw, 80px);
	font-weight: 700;
	color: #32556e;
}

.default-videotron h1 {
	margin: 0;
	width: 100%;
	text-align: center;
}

/* =========================================================
   5. SLIDE
   Digunakan jika nantinya menggunakan sistem class slide.
   ========================================================= */
.slide {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	display: flex;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .7s ease, visibility .7s ease;
}

.slide.active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 1;
}

/* =========================================================
   6. SECTION KONTEN
   ========================================================= */
#section-VIDEO, #section-DASHBOARD_STATISTIK {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	padding: 0px;
}

#section-DASHBOARD_WORKING_HOURS {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

#section-DASHBOARD_WORKING_HOURS .container-fluid {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2px;
    overflow: hidden;
}

#section-DASHBOARD_WORKING_HOURS .row {
    flex: 0 0 auto;
    margin-bottom: 4px !important;
}

#section-DASHBOARD_WORKING_HOURS .table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    margin: 0;
}


/* =========================================================
   7. DASHBOARD KPI
   ========================================================= */
.dashboard {
	display: grid;
	grid-template-rows: minmax(0, 1fr);
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	gap: 0;
	overflow: hidden;
}

.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-rows: repeat(2, minmax(0, 1fr));
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: clamp(2px, 0.3vw, 6px);
	gap: clamp(2px, 0.3vw, 6px);
	overflow: hidden;
}

/* =========================================================
   8. KOLOM KPI
   ========================================================= */
.dashboard>.col {
	width: 100%;
	min-width: 0;
	min-height: 0;
	padding: 0;
}

.dashboard-grid .col {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	padding: 0;
}

/* =========================================================
   9. KARTU KPI
   ========================================================= */
.stat-box {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	padding: 0;
	overflow: hidden;
	text-align: center;
	box-sizing: border-box;
	box-shadow: 0 .5rem 1rem rgba(59, 130, 246, .2);
}

/* Observation */
.stat-box.obs {
	background-color: rgba(52, 199, 89, .2);
}

/* Near Miss */
.stat-box.nr {
	background-color: rgba(255, 193, 7, .2);
}

/* Recordable / LTI */
.stat-box.rcd {
	background-color: rgba(255, 56, 60, .15);
}

/* First Aid */
.stat-box.fa {
	background-color: rgba(0, 136, 255, .2);
}

/* Frequency Rate */
.stat-box.fr {
	background-color: rgba(97, 85, 245, .2);
}

/* Severity Rate */
.stat-box.sr {
	background-color: rgba(203, 48, 224, .2);
}

/* Gravity Rate */
.stat-box.gr {
	background-color: rgba(9, 92, 60, .2);
}

/* =========================================================
   10. JUDUL KARTU KPI
   ========================================================= */
.stat-box .header-1, .stat-box .header-2, .stat-box .header-3, .stat-box .header-4,
	.stat-box .header-5, .stat-box .header-6, .stat-box .header-7 {
	width: 100%;
	padding: clamp(4px, .5vw, 10px);
	text-align: center;
	font-weight: 700;
	text-transform: uppercase;
	box-shadow: 0 5px 12px rgba(0, 0, 0, .25);
	border-bottom: 1px solid rgba(255, 255, 255, .2);
	font-size: clamp(20px, 2cqw, 26px);
	white-space: nowrap;
}

.stat-box .header-1 {
	background-color: #34C759;
}

.stat-box .header-2 {
	background-color: #FF8D28;
}

.stat-box .header-3 {
	background-color: #FF383C;
}

.stat-box .header-4 {
	background-color: #0088FF;
}

.stat-box .header-5 {
	background-color: #6155F5;
}

.stat-box .header-6 {
	background-color: #CB30E0;
}

.stat-box .header-7 {
	background-color: #095C3C;
}

/* =========================================================
   11. KONTEN KARTU KPI
   ========================================================= */
.stat-box .card-content {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 0;
	text-align: center;
	background: rgba(52, 199, 89, .2);
}

.stat-box .card-content p {
    position: absolute;
    top: 12px;
    left: 12px;
    margin: 0;
    text-align: left;
    font-size: clamp(18px, 1.5cqw, 32px);
}

.stat-box .target {
    position: absolute;
    top: 12px;
    left: 12px;
    margin: 0;
    font-size: clamp(18px, 1.5cqw, 32px);
    font-weight: 700;
    text-transform: uppercase;
}

.stat-box .actual-label {
	margin-top: 2px;
	font-size: clamp(18px, 1.5cqw, 32px);
	font-weight: 700;
	letter-spacing: .08em;
	color: #FF8D28;
}

.stat-box .icon {
	display: inline-block;
	margin-bottom: .3rem;
	font-size: clamp(20px, 3cqw, 50px);
	line-height: 1.2;
}

.stat-box .value {
	max-width: 100%;
	font-size: clamp(20px, 4cqw, 100px);
	font-weight: 900;
	line-height: 1.1;
	overflow-wrap: anywhere;
}

.stat-box .label {
	position: static;
	max-width: 100%;
	margin-top: .5rem;
	font-size: clamp(18px, 1.5cqw, 32px);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .03em;
	text-transform: capitalize;
	text-align: center;
	overflow-wrap: anywhere;
}

.stat-box .last-update {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	text-align: center;
	font-size: clamp(9px, 1vw, 20px);
	font-weight: 500;
	font-style: italic;
	opacity: .8;
}

/* =========================================================
   12. BANNER
   ========================================================= */
/* =========================================================
   12. BANNER / GAMBAR (Disamakan persis dengan struktur Video)
   ========================================================= */
/* =========================================================
   BANNER / GAMBAR (Dengan Aspek Rasio & Full tanpa spasi)
   ========================================================= */
/* 2. Pembungkus utama layar penuh */
/* SECTION BANNER */
#section-BANNER {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
    background: #000;
}

#bannerContainer {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.banner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.banner img {
     width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}


/* =========================================================
   VIDEO (Disamakan strukturnya)
   ========================================================= */
#videoContainer, .video-wrap {
	width: 100%;
	height: 100%;
	max-width: 100vw;
	max-height: 100vh;
	margin: auto;
	padding: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: #000;
	overflow: hidden;
}

.video-wrap video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	/* Memastikan video full memenuhi layar tanpa spasi */
}

/* =====================================================
   15. CARD TABLE STATISTIK
   ===================================================== */
.table-responsive {
	width: 100%;
	max-width: 100%;
	padding: clamp(8px, 0.8cqw, 14px);
	overflow-x: auto;
	background: #32556e;
	border: 1px solid #1c3547;
	border-radius: 10px;
	
}

/* =====================================================
   TABLE
   ===================================================== */
.table-statistik {
	width: 100%;
	table-layout: fixed;
	border-collapse: separate;
	border-spacing: 0 6px;
	font-size: clamp(18px, 1.5cqw, 28px);
	margin-bottom: 0;
}

/* =====================================================
   HEADER KOLOM
   ===================================================== */
.table-statistik thead th {
	background: #1c3547;
	color: #ffffff;
	font-size: clamp(18px, 1.3cqw, 26px);
	font-weight: 800;
	text-align: center;
	padding: clamp(10px, 0.9cqh, 16px);
	border: 2px solid #ffffff;
}

.table-statistik thead th:first-child {
	border-radius: 8px 0 0 8px;
}

.table-statistik thead th:last-child {
	border-radius: 0 8px 8px 0;
}

/* =====================================================
   ISI TABEL
   ===================================================== */
.table-statistik tbody td {
	background: #f3f6f9;
	color: #222222;
	font-size: clamp(20px, 1.6cqw, 30px);
	font-weight: 800;
	text-align: center;
	padding: clamp(10px, 0.8cqh, 15px);
	border: 2px solid #32556e;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
}

/* =====================================================
   HEADER KATEGORI
   ===================================================== */
.table-statistik tbody th {
	background: #32556e;
	color: #ffffff;
	font-size: clamp(18px, 1.5cqw, 28px);
	font-weight: 800;
	text-align: left;
	padding: clamp(10px, 0.8cqh, 15px);
	border: 2px solid #ffffff;
	border-radius: 8px 0 0 8px;
	white-space: normal;
	overflow-wrap: break-word;
}

/* =====================================================
   UJUNG KANAN
   ===================================================== */
.table-statistik tbody td:last-child {
	border-radius: 0 8px 8px 0;
}

/* =====================================================
   UKURAN KOLOM KATEGORI
   ===================================================== */
.thkat {
	width: 200px;
}

/* =====================================================
   RESPONSIVE PORTRAIT
   ===================================================== */
@media ( orientation : portrait) {
	.table-responsive {
		padding: 5px;
		border-radius: 8px;
		box-shadow: 4px 4px 0 #1c3547;
	}
	.table-statistik {
		font-size: clamp(14px, 2.2cqw, 22px);
		border-spacing: 0 4px;
	}
	.table-statistik thead th {
		font-size: clamp(13px, 2cqw, 21px);
		padding: 7px 3px;
	}
	.table-statistik tbody th {
		font-size: clamp(13px, 2cqw, 21px);
		padding: 7px 5px;
	}
	.table-statistik tbody td {
		font-size: clamp(15px, 2.3cqw, 23px);
		padding: 7px 3px;
	}
	.thkat {
		width: 120px;
	}
}

/* =========================================================
   15. FOOTER DAN RUNNING TEXT
   ========================================================= */
footer {
	flex: 0 0 clamp(40px, 6vh, 80px);
	width: 100%;
	min-width: 0;
	height: clamp(40px, 6vh, 80px);
	display: block;
	align-items: center;
	padding: 4px 20px;
	background: #32556e;
	color: #fff;
	overflow: hidden;
	position: relative;
	z-index: 10;
	flex-shrink: 0;
}

footer marquee {
	display: block;
	width: 100%;
	overflow: hidden;
}

footer .running-text {
	margin: 0;
	padding: 0;
	color: #fff;
	font-size: clamp(16px, 2.2vw, 32px);
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

/* =========================================================
   16. RESPONSIVE BERDASARKAN ORIENTASI CONTAINER
   ========================================================= */

/* Portrait: area videotron lebih tinggi daripada lebar */
@container (orientation: portrait) { .dashboard-grid {
	grid-template-columns:repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(4, minmax(0, 1fr));
	gap: clamp(2px, .3cqw, 5px);
}


.stat-box .value {
	font-size: clamp(18px, 5cqw, 55px);
}

.stat-box .label {
	font-size: clamp(9px, 1.8cqw, 18px);
}

.stat-box .target, .stat-box .card-content p {
	font-size: clamp(8px, 1.2cqw, 15px);
	top: 5px;
	left: 5px;
}

.stat-box .last-update {
	font-size: clamp(8px, 1cqw, 14px);
}

}

/* =========================================================
   17. RESPONSIVE LAYAR KECIL
   ========================================================= */
@media ( max-width : 600px) {
	.top-box {
		gap: 3px;
		padding: 4px;
	}
	.logo1 {
		width: 45px;
		height: 40px;
	}
	.logo2, .logo3 {
		width: 25px;
		height: 25px;
	}
	.header-title h1 {
		font-size: clamp(12px, 3vw, 18px);
	}
	.header-title h2 {
		margin-top: 3px;
		font-size: 10px;
	}
	footer {
		flex-basis: 35px;
		height: 35px;
		padding: 3px 8px;
	}
	footer .running-text {
		font-size: 15px;
	}
	.table-statistik th, .table-statistik td {
		padding: 4px;
		font-size: 11px;
	}
	.thkat {
		width: 100px;
	}
}

/* =========================================================
   18. AKSESIBILITAS
   ========================================================= */
@media ( prefers-reduced-motion : reduce) {
	.slide {
		transition: none;
	}
}
