/* ================== GLOBAL STYLE ================== */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

h1, h6.card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

h6.card-title {
    font-size: 0.95rem;
}

/* ================== CARD ================== */
.card {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.compact-card {
    max-height: 320px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.compact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-header {
    background: #0369A1;
    color: white;
    border-radius: 8px 8px 0 0 !important;
    padding: 6px 12px;
}

.card-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ================== STATUS BUTTONS ================== */
.status-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.status-btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
    flex: 1;
    transition: 0.2s;
    border: none;
}

.status-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ================== PROGRESS VERTICAL ================== */
.progress-vertical-sm {
    width: 28px;
    height: 120px;
    background-color: #e5e7eb;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.progress-bar-vertical {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(180deg, #0ea5e9, #0369a1);
    transition: height 0.5s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    color: white;
    font-size: 10px;
    padding-bottom: 2px;
}

/* ================== CCTV IMAGE ================== */
.cctv-container {
    width: 100%;
    aspect-ratio: 16/9;      /* biar proporsional */
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cctv-image {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* biar gambar penuh tanpa gepeng */
    transition: 0.3s ease;
}

.cctv-image:hover {
    transform: scale(1.03);
}

.zoom-btn {
    margin-top: 6px;
    width: 100%;
    font-size: 0.8rem;
    font-weight: 500;
}


/* ================== TABLE ================== */
.table-sm td, .table-sm th {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.table thead {
    background: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ================== CHART & TABS ================== */
.nav-sm .nav-link {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

#dataChart {
    height: 220px !important;
}

/* ================== GATE BUTTONS ================== */
.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.gate-btn {
    padding: 3px 6px;
    font-size: 11px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: 0.2s;
}

.gate-btn:hover {
    background: #e2e8f0;
}

/* ================== MODE INDICATOR ================== */
.mode-indicator {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 4px;
    text-align: center;
    font-size: 11px;
    border: 1px solid #e5e7eb;
}

/* ================== RESPONSIVE ================== */
@media (max-width: 991px) {
    .progress-vertical-sm {
        height: 90px;
    }
    .cctv-container {
        height: 120px;
    }
    #dataChart {
        height: 180px !important;
    }
}

/* CSS untuk komponen yang sudah ada sebelumnya */
.compact-card {
    font-size: 0.85rem;
}

.compact-card .card-header {
    padding: 0.5rem 0.75rem;
}

.compact-card .card-body {
    padding: 0.5rem 0.75rem;
}

.status-buttons {
    display: flex;
    gap: 0.25rem;
}

.status-btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.gate-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}

.mode-indicator button {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Progress Bar Vertikal Kecil */
.progress-vertical-sm {
    height: 120px;
    width: 40px;
    background-color: #e9ecef;
    border-radius: 0.375rem;
    position: relative;
    overflow: hidden;
}

.progress-bar-vertical {
    width: 100%;
    background-color: #0d6efd;
    position: absolute;
    bottom: 0;
    transition: height 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.progress-value {
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* CCTV Styles */
.cctv-container {
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 0.375rem;
}

.cctv-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zoom-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

/* Tab Styles */
.nav-sm .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* Loading spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Memastikan tab content memiliki height yang konsisten */
.tab-content {
    min-height: 350px;
}

/* Style untuk date inputs */
.form-control-sm {
    font-size: 0.875rem;
}