/* --- GLOBAL STYLE --- */
body { 
    font-family: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif; 
    background-color: #f4f6f9; 
    margin: 0; 
    min-height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: flex-start; 
    padding: 30px 20px; 
    color: #333; 
}

.container { 
    width: 100%; 
    max-width: 1100px; 
    background: #ffffff; 
    padding: 0; 
    border: 1px solid #dce0e4; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); 
    box-sizing: border-box; 
    min-height: 85vh; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

/* --- LOGIN PAGE --- */
#page-login { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 80vh; flex-direction: column; padding: 20px; }
.login-card { background: #ffffff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid #e1e4e8; width: 100%; max-width: 380px; text-align: center; animation: fadeIn 0.6s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.login-logo { width: 60px; height: 60px; background: #f0f2f5; border-radius: 12px; margin: 0 auto 20px auto; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #007bff; }
.login-title { font-size: 20px; font-weight: 800; color: #2c3e50; margin-bottom: 5px; letter-spacing: 0.5px; }
.login-subtitle { font-size: 13px; color: #6c757d; margin-bottom: 30px; }

/* INPUTS */
.input-group { position: relative; margin-bottom: 20px; text-align: left; }
.input-group label { font-size: 13px; font-weight: 600; color: #444; margin-bottom: 8px; display: block; }
.input-wrapper { position: relative; width: 100%; }
.input-wrapper input { width: 100%; padding: 10px 40px; background-color: #fff; border: 1px solid #ced4da; border-radius: 6px; font-size: 14px; transition: all 0.2s; box-sizing: border-box; color: #333; height: 42px; }
.input-wrapper input:focus { border-color: #80bdff; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15); outline: none; }
.input-icon-left { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); width: 18px; height: 18px; color: #adb5bd; pointer-events: none; }
.input-icon-right { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); width: 18px; height: 18px; color: #adb5bd; cursor: pointer; }

/* BUTTONS */
.btn-login-full { width: 100%; padding: 12px; background-color: #007bff; color: white; border: none; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; margin-top: 10px; box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2); }
.btn-login-full:hover { background-color: #0056b3; transform: translateY(-1px); }
.divider { display: flex; align-items: center; text-align: center; color: #aaa; margin: 25px 0; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid #eee; }
.google-btn-container { display: flex; justify-content: center; width: 100%; margin-top: 10px; }

/* --- HEADER DASHBOARD --- */
.hero-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Grouping Judul & Subjudul */
.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-title {
    font-size: 22px;
    font-weight: 800;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.2;
}

/* Subtitle Abu-abu (BARU) */
.hero-subtitle {
    font-size: 14px;
    color: #6c757d; /* Warna abu sama dgn login */
    font-weight: 600;
    margin-top: 4px;
}

/* Profil User */
.profile-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: right;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 700;
    font-size: 14px;
    color: #333;
}

.profile-nip {
    font-size: 12px;
    color: #666;
}

.profile-icon {
    width: 40px;
    height: 40px;
    background-color: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007bff;
    font-size: 18px;
}

/* Tombol Logout Header */
.btn-logout-header {
    background-color: #fff5f5;
    color: #dc3545;
    border: 1px solid #ffc9c9;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    margin-left: 15px;
}

.btn-logout-header:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

/* Kotak Google Link */
.google-link-box {
    background-color: #fff3cd; 
    border: 1px solid #ffeeba;
    color: #856404;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    display: block; 
    font-size: 13px;
    text-align: center;
    margin-top: 5px;
}
.google-link-text { display: flex; align-items: center; justify-content: center; gap: 5px; font-weight: 600; margin-bottom: 5px; }

/* --- DASHBOARD CONTENT --- */
.hidden { display: none !important; }
.dashboard-content { padding: 30px; }
.form-group-dash { margin-bottom: 15px; }
.form-group-dash label { display: block; margin-bottom: 5px; font-weight: 600; color: #555; font-size: 13px; }
.form-group-dash input, .form-group-dash textarea, .form-group-dash select { width: 100%; padding: 8px 12px; border: 1px solid #ced4da; border-radius: 6px; box-sizing: border-box; font-size: 14px; height: 42px; }
.form-group-dash textarea { height: auto; }
input[readonly] { background-color: #e9ecef; }

/* SELECT2 FIX */
.select2-container { width: 100% !important; }
.select2-container .select2-selection--single { height: 42px !important; border: 1px solid #ced4da !important; border-radius: 6px !important; padding: 6px 0 0 0 !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px !important; right: 10px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 28px !important; padding-left: 12px !important; color: #333 !important; font-size: 14px; }

/* TABLE & SEARCH */
.header-history { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 15px; margin-top: 10px; border-top: 1px solid #eee; padding-top: 20px; }
.search-container { display: flex; align-items: center; background-color: #fff; border: 1px solid #ccc; border-radius: 50px; padding: 4px 8px; max-width: 450px; width: 100%; }
.search-icon-box { padding: 0 10px; color: #aaa; font-size: 13px; }
#search-input { border: none; outline: none; padding: 8px 5px; font-size: 13px; width: 100%; color: #444; background: transparent; }
.search-divider { width: 1px; height: 18px; background-color: #e0e0e0; margin: 0 10px; }
#limit-select { border: none; outline: none; background-color: transparent; font-size: 13px; color: #555; font-weight: 500; cursor: pointer; }

/* ACTION BUTTONS */
button { border: none; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; }
button:hover { filter: brightness(95%); }
.btn-blue { background-color: #007bff; color: white; padding: 8px 16px; }
.btn-green { background-color: #28a745; color: white; padding: 8px 16px; }
.btn-orange { background-color: #fd7e14; color: white; padding: 8px 16px; }
.btn-red { background-color: #dc3545; color: white; padding: 8px 16px; }
.btn-outline { background: transparent; border: 1px solid #6c757d; color: #6c757d; padding: 8px 16px; }
.btn-sm { padding: 4px 10px; font-size: 12px; min-width: 50px; margin: 0 2px; }
button:disabled { background-color: #e9ecef !important; color: #adb5bd !important; cursor: not-allowed; border: 1px solid #dee2e6 !important; }

/* MODAL & OTHERS */
.modal-box { background: #fff; border: 1px solid #ddd; padding: 25px; border-radius: 8px; margin-top: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.modal-header { margin: -25px -25px 20px -25px; padding: 15px; border-radius: 8px 8px 0 0; color: white; text-align: center; font-size: 16px; font-weight: 600; }
.bg-header-green { background-color: #28a745; }
.bg-header-orange { background-color: #fd7e14; }
.bg-header-blue { background-color: #007bff; }

.btn-center-group { display: flex; justify-content: center; gap: 15px; margin: 10px 0 25px 0; flex-wrap: wrap; }
.btn-right-group { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; border-top: 1px solid #eee; padding-top: 15px; }
.btn-main-menu { min-width: 220px; padding: 12px 20px; font-size: 14px; border-radius: 50px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); font-weight: 600; }

.table-responsive { overflow-x: auto; border: 1px solid #e1e4e8; border-radius: 6px; margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; margin-top: 0; font-size: 13px; min-width: 1000px; }
th, td { border-bottom: 1px solid #eee; padding: 10px 15px; text-align: left; vertical-align: middle; }
th { background-color: #f8f9fa; font-weight: 600; color: #495057; border-bottom: 2px solid #e9ecef; }
th.header-blue { color: #007bff; } 
th.header-green { color: #28a745; } 
.col-deskripsi { white-space: normal !important; word-wrap: break-word; max-width: 250px; min-width: 150px; color: #555; }
.col-nowrap { white-space: nowrap; }
.col-nosurat { text-align: center; font-weight: 600; width: 100px; background: #fff5f8; color: #d63384; } 
.col-status { text-align: center; width: 50px; }
.col-tgl { white-space: nowrap; font-weight: 600; color: #28a745; }
.col-aksi { text-align: center; width: 140px; white-space: nowrap; }
.icon-surat { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }
.fill-kuning { fill: #ffc107; stroke: #d39e00; stroke-width: 1px;}
.fill-hijau { fill: #28a745; stroke: #1e7e34; stroke-width: 1px;}
.fill-merah { fill: #dc3545; stroke: #bd2130; stroke-width: 1px;}

.pagination-box { display: flex; justify-content: space-between; align-items: center; padding: 15px 0 0 0; font-size: 13px; color: #666; }
.page-btn { padding: 6px 12px; background: white; border: 1px solid #dee2e6; color: #333; border-radius: 4px; font-weight: normal; width: 100px; justify-content: center; display: flex; align-items: center; }
.page-btn:hover:not(:disabled) { background: #f8f9fa; }

@media screen and (max-width: 768px) {
    body { padding: 0; align-items: flex-start; background: #fff; }
    .container { padding: 0; width: 100%; border-radius: 0; box-shadow: none; min-height: 100vh; border: none; }
    .hero-header { padding: 15px; }
    .header-content { flex-direction: column; text-align: center; gap: 15px; } 
    .header-left { align-items: center; } /* Judul di tengah kalo di HP */
    .profile-wrapper { text-align: center; justify-content: center; }
    .profile-info { align-items: center; }
    .dashboard-content { padding: 15px; }
    .btn-center-group { flex-direction: column; gap: 10px; }
    .btn-main-menu { width: 100%; min-width: auto; }
    .header-history { flex-direction: column; align-items: stretch; gap: 10px; }
    .search-container { max-width: 100%; }
    .btn-right-group { flex-direction: column-reverse; gap: 10px; }
    .btn-right-group button { width: 100%; }
    .pagination-box { flex-direction: column; gap: 10px; }
    
    .btn-logout-header { margin-left: 0; margin-top: 10px; width: 100%; justify-content: center; }
}
/* --- STYLE TAMBAHAN UNTUK DROPDOWN PENGATURAN --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000; /* Agar di atas elemen lain */
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid #f1f1f1;
    text-align: left;
}

.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover { background-color: #f1f1f1; color: #007bff; }
.dropdown:hover .dropdown-content { display: block; }
.dropdown:hover .btn-blue { background-color: #0056b3; }

/* Style Tabel di dalam Modal Pengaturan */
.table-settings { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.table-settings th { background: #f8f9fa; padding: 10px; border: 1px solid #ddd; text-align: left; }
.table-settings td { padding: 8px 10px; border: 1px solid #ddd; }
.input-sm { padding: 5px; border: 1px solid #ccc; border-radius: 4px; width: 100%; box-sizing: border-box; }
.form-section { background: #eef2f7; padding: 15px; border-radius: 6px; margin-bottom: 15px; border: 1px solid #dce4ec; }

/* ================================================= */
/* CSS KHUSUS TABEL PENGATURAN (MODAL SETTINGS)      */
/* Dipisah agar tidak merusak tabel utama dashboard  */
/* ================================================= */

/* Wrapper agar tabel bisa di-scroll jika data banyak */
.table-responsive-settings {
    max-height: 400px;       /* Batasi tinggi */
    overflow-y: auto;        /* Scroll jika lebih */
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-top: 15px;
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

/* Tabel Settings - Font lebih kecil & padat */
.table-settings {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px; /* Font compact */
}

/* Header Tabel Settings */
.table-settings th {
    background-color: #f1f3f5; /* Abu terang */
    color: #495057;
    font-weight: 700;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    position: sticky; /* Header nempel di atas saat scroll */
    top: 0;
    z-index: 5;
    text-transform: uppercase;
    font-size: 11px;
}

/* Baris Data Settings */
.table-settings td {
    padding: 8px 12px; /* Padding rapat */
    border-bottom: 1px solid #f1f1f1;
    color: #333;
    vertical-align: middle;
}

/* Zebra Striping (Warna selang-seling) */
.table-settings tr:nth-child(even) {
    background-color: #fcfcfc;
}

/* Efek Sorot (Hover) */
.table-settings tr:hover {
    background-color: #e2e6ea;
}

/* Helper: Rata Tengah untuk kolom Aksi */
.text-center {
    text-align: center !important;
}

/* Tombol kecil khusus tabel ini */
.table-settings .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    margin: 0 2px;
}