/* public/css/custom.css — Mirrors the custom_css from app.R */

/* 1. Header & Navbar */
.navbar, .navbar-static-top {
    background: linear-gradient(135deg, #00509e 0%, #003366 100%) !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.navbar-brand, .navbar-brand:hover { color: white !important; font-weight: bold; }
.navbar-text { color: rgba(255,255,255,.85) !important; }

/* 2. Optimasi Tabel — squeezed row (same as R app) */
table.dataTable tbody td {
    padding: 4px 8px !important;
    vertical-align: middle !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    font-size: 0.9rem;
}
table.dataTable thead th {
    padding: 8px 8px !important;
    font-size: 0.9rem;
    background-color: #f8f9fa;
}
table.dataTable tbody td:hover {
    white-space: normal;
    overflow: visible;
    background-color: #ffffd9 !important;
    z-index: 10;
    position: relative;
}

/* 3. Sidebar active item */
.sidebar-menu .nav-link.active {
    background-color: #3498db;
    color: white !important;
    border-radius: 5px;
}
.sidebar-menu .nav-link {
    color: #495057;
    padding: 8px 12px;
}
.sidebar-menu .nav-link:hover {
    background-color: #e9ecef;
    border-radius: 5px;
}

/* 4. Sticky Toolbar */
.sticky-toolbar {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 100;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 15px;
}

/* 5. Samakan warna tombol aksi umum */
.btn-info,
.btn-success,
.btn-secondary,
.btn-outline-info,
.btn-outline-secondary,
.btn-outline-primary {
    background-color: #00509e !important;
    border-color: #00509e !important;
    color: #ffffff !important;
}

.btn-info:hover,
.btn-success:hover,
.btn-secondary:hover,
.btn-outline-info:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-info:focus,
.btn-success:focus,
.btn-secondary:focus,
.btn-outline-info:focus,
.btn-outline-secondary:focus,
.btn-outline-primary:focus {
    background-color: #003f7d !important;
    border-color: #003f7d !important;
    color: #ffffff !important;
}

/* 5. Login page centering */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f4f8;
}
.login-card {
    width: 400px;
}

/* 6. General spacing */
.page-content {
    padding: 20px;
}

/* 7. Table status cell colors (matched to R's formatStyle) */
td.status-hadir     { background-color: #d4edda !important; }
td.status-tidak     { background-color: #f8d7da !important; }
td.status-libur     { background-color: #e2e3e5 !important; }
td.status-diterima  { background-color: #d4edda !important; font-weight: bold; }
td.status-ditolak   { background-color: #f8d7da !important; font-weight: bold; }
td.status-menunggu  { background-color: #fff3cd !important; font-weight: bold; }
td.status-belum     { background-color: #f8f9fa !important; font-weight: bold; }
td.status-ditawarkan{ background-color: #d4edda !important; }
td.status-ditutup   { background-color: #f8d7da !important; }

/* Lock icon color */
.lock-icon { color: #dc3545; }

/* Audit log row colors */
tr.log-login       td { background-color: #d1ecf1 !important; }
tr.log-login-fail  td { background-color: #f8d7da !important; }
tr.log-insert      td { background-color: #d4edda !important; }
tr.log-delete      td { background-color: #f5c6cb !important; }

/* Kunci status cells */
td.kunci-terkunci { background-color: #dc3545 !important; color: white !important; font-weight: bold; }
td.kunci-terbuka  { background-color: #ffc107 !important; color: black !important; font-weight: bold; }

/* Certificate number highlight */
td.cert-no { font-weight: bold; color: #00509e; }

/* Searchable select (Select2) compact style */
.searchable-select + .select2 .select2-selection--single {
    height: calc(1.5em + .5rem + 2px);
    padding: .25rem .5rem;
    font-size: .875rem;
}
.searchable-select + .select2 .select2-selection__rendered {
    line-height: 1.5;
    padding-left: 0;
}
.searchable-select + .select2 .select2-selection__arrow {
    height: calc(1.5em + .5rem + 2px);
}
