/* =========================================================================
   1. PENGATURAN UMUM KHUSUS TABEL SURAT MASUK (.table-modern)
   ========================================================================= */
/* Menggunakan class spesifik agar tidak merusak tabel lain */
table.table-modern {
  width: 100%;
  table-layout: fixed; 
  border-collapse: collapse;
}

table.table-modern #headMasuk th,
table.table-modern #bodyMasuk td {
  vertical-align: middle;
  padding: 12px 10px; 
  word-wrap: break-word; /* Mencegah teks menabrak batas kolom */
}
table.table-modern .col-aksi,
table.table-modern .td-aksi {
  width: 130px !important;
  min-width: 130px !important;
  max-width: 130px !important;
  text-align: center;
}
table.table-modern .text-center {
  text-align: center !important;
}

table.table-modern .cell-tgl {
  line-height: 1.4;
  text-align: left;
  font-size: 13px;
  color: #334155; 
}

table.table-modern td.table-loading {
  text-align: center;
  padding: 30px;
  color: #888;
  font-weight: 500;
}

table.table-modern td.table-empty {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
}

table.table-modern .table-empty-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

/* =========================================================================
   3. TRICK MAGIC: PEMBATAS BARIS TEKS (LINE CLAMP)
   ========================================================================= */
/* Cukup pakai class ini di <span> atau <td> agar teks dibatasi 3 baris */
.text-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

/* =========================================================================
   4. ELEMENT AKSESORIS (TOMBOL, DROPDOWN, INPUT, TOOLTIP)
   ========================================================================= */
table.table-modern .td-aksi {
  text-align: center !important;
  vertical-align: middle !important;
  overflow: visible !important;
}

.icon-sm {
  font-size: 14px;
}

.btn-pdf-link {
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-file-hidden {
  display: none;
}

.tooltip-block {
  display: block;
}

.tooltip-block-center {
  display: block;
  text-align: center;
}

/* =========================================================================
   5. BADGE STATUS
   ========================================================================= */
.badge-status {
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  display: inline-block;
  white-space: normal; /* Mengizinkan teks turun ke bawah */
  word-break: break-word; /* Memotong kata jika terlalu panjang */
}

.badge-status-bold {
  font-weight: 600;
}

.badge-disposisi { background: #fef3c7; color: #d97706; }
.badge-disposisi-lanjut { background: #e0f2fe; color: #0284c7; }
.badge-diproses { background: #cff4fc; color: #055160; }
.badge-verifikasi { background: #f3e8ff; color: #7e22ce; }
.badge-revisi { background: #ffe4e6; color: #e11d48; }
.badge-selesai { background: #dcfce7; color: #15803d; }
.badge-default { background: #f1f5f9; color: #64748b; }

/* =========================================================
   STYLE GLOBAL TOMBOL SIMAS DKP (Kadis, Kabid, Kasi, Operator)
   ========================================================= */
/* Default: Semua tombol tanpa shadow */
.btn-premium, 
.simas-dropdown-menu button,
.btn-aksi-trigger,
.btn-detail-monitoring {
  box-shadow: none !important;
  transition: all 0.2s ease-in-out !important;
}

/* HOVER: Shadow halus & efek terangkat 1px saat kursor di atas tombol */
.btn-premium:hover, 
.simas-dropdown-menu button:hover,
.btn-aksi-trigger:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-1px);
}

/* Style Khusus Tombol Lihat Detail */
.btn-detail-monitoring {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-detail-monitoring:hover {
  background: #dbeafe;
  color: #0369a1;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.22) !important;
  transform: translateY(-1px);
}
.btn-detail-monitoring .material-icons {
  font-size: 16px;
  color: #0284c7;
}
/* =========================================================
   BUKA AKSI KHUSUS PC
   ========================================================= */
@media screen and (min-width: 769px) {
.wadah-aksi-pc {
  display: inline-block !important;
}

.wadah-aksi-mobile {
  display: none !important;
}

.simas-dropdown {
  position: relative;
}

/* --- TOMBOL TRIGGER (SUDAH DISESUAIKAN AGAR UKURAN MATI & PRESISI) --- */
.btn-aksi-trigger {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 105px;
  min-height: 37px;
  gap: 4px;
  white-space: nowrap;
  box-sizing: border-box;
}

.simas-dropdown-menu {
  display: none;
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background-color: #ffffff;
  padding: 6px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  z-index: 9999 !important;
  gap: 6px;
  white-space: nowrap;
}

/* --- TAMBAHAN KODE HANYA UNTUK PANAH DI KANAN --- */
.simas-dropdown-menu::after, 
.simas-dropdown-menu::before {
  content: "";
  position: absolute;
  left: 100%; /* Menempel pas di tepi kanan kotak */
  top: 50%;
  border: solid transparent;
  pointer-events: none;
}

/* 1. Panah dalam (Warna putih sesuai background kotak) */
.simas-dropdown-menu::after {
  border-left-color: #ffffff;
  border-width: 6px;
  margin-top: -6px; /* Mengunci tepat di tengah */
}

/* 2. Panah luar (Warna abu-abu sesuai border kotak) */
.simas-dropdown-menu::before {
  border-left-color: #e2e8f0;
  border-width: 7px;
  margin-top: -7px; /* Sedikit lebih besar untuk membentuk garis tepi */
}

.simas-dropdown-menu.show-menu {
  display: flex !important;
}

/* CSS Buka Akasi */
/* --- IKON ANIMASI 3 GARIS (☰) MENJADI X --- */
.icon-toggle-x {
  width: 15px;
  height: 12px;
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.icon-toggle-x span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background-color: currentColor; /* Mengikuti warna teks tombol */
  border-radius: 2px;
  opacity: 1;
  left: 0;
  /* Transisi halus 0.25 detik */
  transition: all 0.25s ease-in-out;
}

/* Position 3 Garis (Tampilan Buka Aksi) */
.icon-toggle-x span:nth-child(1) { top: 1px; }
.icon-toggle-x span:nth-child(2) { top: 5px; }
.icon-toggle-x span:nth-child(3) { top: 9px; }

/* --- EFEK KETIKA DIKLIK (TUTUP AKSI -> MENJADI X) --- */
.btn-aksi-trigger.is-active .icon-toggle-x span:nth-child(1) {
  top: 5px;
  transform: rotate(45deg);
}

.btn-aksi-trigger.is-active .icon-toggle-x span:nth-child(2) {
  opacity: 0;
  transform: scale(0); /* Garis tengah menghilang */
}

.btn-aksi-trigger.is-active .icon-toggle-x span:nth-child(3) {
  top: 5px;
  transform: rotate(-45deg);
}
/*Tutup CSS Buka Aksi*/

/*Buka CSS Tabel Surat Masuk*/
/* =========================================================================
   TABEL MODERN (SURAT MASUK) - FULL KODE (GARIS 1PX RAPI & TIDAK GESER)
   ========================================================================= */

/* 1. WADAH & UTAMA TABEL */
#masuk .table-modern,
.table-modern {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important; /* Mengunci kolom agar tidak bergeser antar-tab */
  border-collapse: collapse !important; /* Menyatukan border bertumpuk jadi 1px tunggal */
  text-align: left;
  font-size: 13.5px;
  background: #ffffff;
  border: 1px solid #cbd5e1 !important; /* Garis bingkai luar */
  box-sizing: border-box !important;
}

/* 2. DESAIN HEADER TABEL (TH) */
#masuk .table-modern th,
.table-modern th {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  font-weight: 600;
  padding: 12px 10px !important;
  border: 1px solid #cbd5e1 !important; /* Garis 1px utuh di semua sisi (Atas, Bawah, Kiri, Kanan) */
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-align: center;
  vertical-align: middle;
  white-space: normal !important;
  word-break: break-word !important;
  box-sizing: border-box !important;
}

/* 3. DESAIN SEL ISI TABEL (TD) */
#masuk .table-modern td,
.table-modern td {
  padding: 12px 10px !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important; /* Garis 1px utuh di semua sisi (Atas, Bawah, Kiri, Kanan) */
  vertical-align: middle;
  line-height: 1.5;
  white-space: normal !important;
  word-break: break-word !important;
  box-sizing: border-box !important;
}

/* 4. EFEK BARIS SAAT DI-HOVER MOUSE */
#masuk .table-modern tbody tr:hover td,
.table-modern tbody tr:hover td {
  background-color: #f1f5f9 !important;
}

/*TUTUP CSS TABEL SURAT MASUK*/

/*STYLE BARU TAB GABUNG DENGAN TABEL SURAT MASUK*/
/* Container Utama */
.tab-menu {
    display: flex; 
    flex-direction: row !important;
    gap: 12px; 
    margin-bottom: 25px;
    padding: 5px 0;
    flex-wrap: wrap; 
}

.tab-menu[style*="display: block"] {
    display: flex !important;
}
/*TUTUP STYLE BARU TAB GABUNG DENGAN TABEL SURAT MASUK*/

#menu-operator, #menu-kadis{
    margin-bottom:30px;
}

/* ==================================================================
   1. KONTAINER UTAMA
   ================================================================== */
.main-card-container {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-top: 0px !important;
  display: flex;
  flex-direction: column;
  
  /* Perbesar angka pemotongan ke 140px. 
     Jika masih ada scroll di luar, naikkan angka ini (misal 150px/160px) */
  height: calc(100vh - 105px) !important; 
  overflow: hidden; 
}

/* ==================================================================
   2. HEADER STRIP TAB (Background Abu-abu Khas Chrome)
   ================================================================== */
.tab-menu {
  display: flex;
  width: 100%;
  background: #e2e8f0 !important;
  padding: 8px 8px 0 8px !important;
  box-sizing: border-box;
  gap: 0 !important;
  border-bottom: none !important;
  margin: 0 !important;
  flex-wrap: nowrap !important; 
  overflow: hidden !important; 
  border-radius: 12px 12px 0 0 !important;
}

/* ==================================================================
   3. TAB INAKTIF
   ================================================================== */
.tab-sub-btn {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  
  height: 40px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  box-sizing: border-box;

  background: transparent !important;
  color: #5f6368 !important;
  border: none !important;
  border-radius: 10px 10px 0 0 !important;
  
  box-shadow: none !important;
  transform: none !important;
  transition: none !important; 
  
  font-size: 13px !important;
  font-weight: 500 !important;
  
  cursor: pointer;
  position: relative;
  min-width: 0 !important; 
}

.tab-sub-btn span,
.tab-sub-btn .material-icons {
  position: relative;
  z-index: 1;
}

.tab-sub-btn .material-icons {
  font-size: 16px !important;
  color: #5f6368 !important;
}

.tab-sub-btn span:not(.material-icons) {
  white-space: nowrap !important; 
  overflow: hidden !important;    
  text-overflow: ellipsis !important; 
  display: block; 
}

.tab-sub-btn:not(.active):not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: #aeb4b9;
}

.tab-sub-btn.active + .tab-sub-btn::before {
  display: none !important;
}

.tab-sub-btn:hover:not(.active) {
  background: transparent !important; 
  transform: none !important; 
  box-shadow: none !important; 
  top: 0 !important; 
}

.tab-sub-btn:not(.active)::after {
  content: "";
  position: absolute;
  top: 5px;        
  bottom: 5px;    
  left: 4px;      
  right: 4px;     
  border-radius: 8px; 
  background: transparent;
  z-index: 0;
  transition: background-color 0.2s ease;
  pointer-events: none;
}

.tab-sub-btn:hover:not(.active)::after {
  background: rgba(0, 0, 0, 0.06) !important; 
}

.tab-sub-btn:hover:not(.active)::before {
  display: none !important;
}

.tab-sub-btn:hover + .tab-sub-btn:not(.active)::before {
  display: none !important;
}

/* ==================================================================
   4. TAB AKTIF
   ================================================================== */
.tab-sub-btn.active {
  background: #ffffff !important;
  color: #1a73e8 !important; 
  font-weight: 600 !important;
  z-index: 2;
  transform: none !important;
  box-shadow: none !important;
}

.tab-sub-btn.active .material-icons {
  color: #1a73e8 !important;
}

.tab-sub-btn.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -10px;
  width: 10px;
  height: 10px;
  background: transparent;
  border-bottom-right-radius: 10px;
  box-shadow: 4px 4px 0 4px #ffffff;
  pointer-events: none;
}

.tab-sub-btn.active::after {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  bottom: 0 !important;
  right: -10px !important;
  top: auto !important; 
  width: 10px !important;
  height: 10px !important;
  background: transparent !important;
  border-bottom-left-radius: 10px !important;
  box-shadow: -4px 4px 0 4px #ffffff !important;
  pointer-events: none !important;
}

/* ==================================================================
   5. AREA KONTEN DATA & FILTER
   ================================================================== */
.main-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; 
  
  /* Hapus padding dari pembungkus luar agar scroll tidak terhalang area kosong */
  padding: 0; 
  
  background: #ffffff;
  position: relative;
  z-index: 1;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

/* Berikan padding khusus di dalam filter */
.filter-cari-tambah-surat {
  flex-shrink: 0;
  padding: 20px 20px 0 20px; 
}

/* ==================================================================
   6. AREA TABEL & SCROLLBAR
   ================================================================== */
.render-surat-masuk {
  height: 780px !important; /* Mengunci tinggi wadah agar stabil */
  overflow: hidden !important; /* Menghilangkan scroll internal */
  padding: 0 20px 15px 20px; 
}

/* Beri border di anak elemennya agar border tidak mepet tepi layar */
.render-surat-masuk > div {
  border: 1px solid #e2e8f0;
  height: 100%;
}

.render-surat-masuk table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 2;
  box-shadow: 0 1px 0 #e2e8f0; 
}

/* ==================================================================
   7. FOOTER PAGINATION
   ================================================================== */
.pagination-container {
  flex-shrink: 0; 
  margin-top: auto !important; 
  
  /* Sesuaikan padding kiri-kanan agar sejajar dengan isi tabel */
  padding: 15px 20px; 
  
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

#btntambahsurat .material-icons {
  font-size: 18px !important;
  line-height: 0 !important;
  display: inline-block !important;
  transform: translateY(3.5px) !important; /* Menurunkan posisi ikon secara presisi */
}

/* Class khusus untuk memotong teks di dalam cell tabel tanpa merusak struktur */
.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal; 
  word-break: break-word;
  /* Jika butuh, Anda bisa tambahkan max-height di sini sesuai ukuran font Anda, misalnya max-height: 40px; */
}

} /*Penutup media screen min width 789 (Style khusus untuk pc)

