/* Shared CRUD styles extracted from repeated view-level CSS blocks */
/* add.php */
:root {
  --red:        #D72638;
  --red-dark:   #b01e2d;
  --red-faint:  #fff0f1;
  --white:      #ffffff;
  --bg:         #f5f6fa;
  --border:     #e8eaf0;
  --text:       #1a1d2e;
  --text-mid:   #4a5068;
  --text-muted: #9097b4;
  --radius:     14px;
  --shadow-sm:  0 2px 12px rgba(30,35,70,.07);
  --shadow-md:  0 6px 32px rgba(30,35,70,.11);
  --shadow-red: 0 8px 32px rgba(215,38,56,.28);
}

.content-wrapper { background: var(--bg) !important; }

/* ════ PAGE HEADER ════ */
.pg-header {
  background: linear-gradient(130deg, var(--red-dark) 0%, var(--red) 55%, #f0404f 100%);
  border-radius: var(--radius);
  padding: 26px 32px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-red);
}
.pg-header::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.pg-header::after {
  content: '';
  position: absolute; right: -70px; top: -70px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.pg-header-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.pg-eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.65); margin-bottom: 5px;
}
.pg-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 24px;
  color: #fff; margin: 0; line-height: 1.15;
}
.pg-breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: rgba(255,255,255,.6); margin-top: 7px;
}
.pg-breadcrumb a { color: rgba(255,255,255,.8); text-decoration: none; }

/* ════ BUTTONS IN HEADER ════ */
.btn-pg-back {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,.3);
  color: #fff !important; border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s;
}
.btn-pg-back:hover { background: rgba(255,255,255,.25); color: #fff !important; }

.btn-pg-save {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: none;
  color: var(--red) !important; border-radius: 8px; padding: 8px 22px;
  font-size: 13px; font-weight: 800;
  text-decoration: none !important; transition: all .2s; cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.btn-pg-save:hover {
  background: var(--red-faint); color: var(--red-dark) !important;
  transform: translateY(-1px); box-shadow: 0 4px 18px rgba(215,38,56,.2);
}

/* ════ FORM CARD ════ */
.pg-form-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: pgIn .4s .1s ease both;
}
.pg-form-card-header {
  background: linear-gradient(90deg, var(--red) 0%, #e8404e 100%);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 10px;
}
.pg-form-card-header .pg-section-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}
.pg-form-card-header h5 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 14px; color: #fff; margin: 0;
  letter-spacing: .03em;
}
.pg-form-card-header small {
  font-size: 11px; color: rgba(255,255,255,.65); display: block; margin-top: 1px;
}
.pg-form-body {
  padding: 28px 28px 20px;
}

/* ════ FORM GRID ════ */
.pg-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ════ FORM GROUP ════ */
.pg-field {
  display: flex; flex-direction: column; gap: 6px;
}
.pg-field.pg-field-full {
  grid-column: 1 / -1;
}
.pg-label {
  font-size: 12px; font-weight: 700;
  color: var(--text-mid); text-transform: uppercase;
  letter-spacing: .1em;
  display: flex; align-items: center; gap: 6px;
}
.pg-label .pg-label-req {
  color: var(--red); font-size: 14px; line-height: 1;
}
.pg-label .pg-label-icon {
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--red-faint);
  display: flex; align-items: center; justify-content: center;
  color: var(--red); font-size: 9px;
}

/* ════ INPUTS ════ */
.pg-input,
.pg-select-field,
.pg-textarea {
  width: 100%;
  background: var(--bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 9px !important;
  color: var(--text) !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  transition: all .2s !important;
  outline: none !important;
  box-shadow: none !important;
}
.pg-input:focus,
.pg-select-field:focus,
.pg-textarea:focus {
  border-color: var(--red) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(215,38,56,.1) !important;
}
.pg-input::placeholder { color: var(--text-muted) !important; }
.pg-input[readonly] {
  background: #f0f1f7 !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
}

.pg-select-field {
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239097b4' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 36px !important;
}

.pg-textarea {
  min-height: 100px !important;
  resize: vertical !important;
}

/* ════ FILE UPLOAD ════ */
.pg-file-wrap {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.pg-file-wrap:hover {
  border-color: var(--red);
  background: var(--red-faint);
}
.pg-file-preview {
  width: 72px; height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--border);
  margin: 0 auto 10px;
  display: block;
  transition: all .2s;
}
.pg-file-wrap:hover .pg-file-preview {
  border-color: var(--red);
}
.pg-file-label {
  font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 8px;
}
.pg-file-label strong { color: var(--red); }
.pg-file-input {
  width: 100%; font-size: 12px;
  color: var(--text-mid);
  cursor: pointer;
}

/* ════ READONLY BADGE ════ */
.pg-readonly-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f0f1f7; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 9px 14px;
  font-size: 13px; color: var(--text-mid); width: 100%;
}
.pg-readonly-badge i { color: var(--text-muted); font-size: 12px; }

/* ════ FORM FOOTER ════ */
.pg-form-footer {
  padding: 16px 28px 24px;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  border-top: 1.5px solid var(--border);
  background: #fafbff;
}
.btn-cancel {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-mid) !important; border-radius: 8px; padding: 9px 20px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s;
}
.btn-cancel:hover { border-color: var(--text-mid); color: var(--text) !important; }

.btn-submit {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); border: none;
  color: #fff !important; border-radius: 8px; padding: 10px 28px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  text-decoration: none !important; transition: all .2s;
  box-shadow: 0 4px 16px rgba(215,38,56,.3);
  letter-spacing: .03em;
}
.btn-submit:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(215,38,56,.4);
  color: #fff !important;
}

/* ════ SELECT2 OVERRIDE ════ */
.select2-container--bootstrap4 .select2-selection {
  background: var(--bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 9px !important;
  min-height: 42px !important;
  font-size: 13px !important;
  transition: all .2s !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
  color: var(--text) !important;
  line-height: 40px !important;
  padding-left: 14px !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
  color: var(--text-muted) !important;
}
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection {
  border-color: var(--red) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(215,38,56,.1) !important;
}
.select2-dropdown {
  border: 1.5px solid var(--border) !important;
  border-radius: 9px !important;
  box-shadow: var(--shadow-md) !important;
  font-size: 13px !important;
}
.select2-results__option--highlighted {
  background: var(--red) !important;
  color: #fff !important;
}
.select2-search__field {
  border: 1.5px solid var(--border) !important;
  border-radius: 7px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  outline: none !important;
}
.select2-search__field:focus { border-color: var(--red) !important; }

/* ════ SUMMERNOTE OVERRIDE ════ */
.note-editor.note-frame {
  border: 1.5px solid var(--border) !important;
  border-radius: 9px !important;
  overflow: hidden;
}
.note-editor.note-frame:focus-within {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(215,38,56,.1) !important;
}
.note-toolbar { background: #fafbff !important; border-bottom: 1.5px solid var(--border) !important; }

/* ════ DATEPICKER / TIMEPICKER ════ */
.daterangepicker .btn-primary,
.bootstrap-datetimepicker-widget .btn-primary {
  background: var(--red) !important; border-color: var(--red) !important;
}

/* ════ ANIMATIONS ════ */
@keyframes pgIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.pg-header     { animation: pgIn .4s ease both; }
.pg-form-card  { animation: pgIn .4s .1s ease both; }

.pg-field { animation: pgIn .3s ease both; }
<?php
$i = 0;
foreach($this->db->query("SHOW FULL COLUMNS from `data_$modul` WHERE FIELD !='id_$modul'")->result() as $c):
  echo ".pg-field:nth-child({$i}) { animation-delay: " . ($i * 0.04) . "s }\n";
  $i++;
endforeach;
?>

::-webkit-scrollbar { height:5px; width:5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius:99px; }

/* edit.php */
:root {
  --red:        #D72638;
  --red-dark:   #b01e2d;
  --red-faint:  #fff0f1;
  --white:      #ffffff;
  --bg:         #f5f6fa;
  --border:     #e8eaf0;
  --text:       #1a1d2e;
  --text-mid:   #4a5068;
  --text-muted: #9097b4;
  --green:      #1a8a40;
  --green-faint:#e8f8ee;
  --radius:     14px;
  --shadow-sm:  0 2px 12px rgba(30,35,70,.07);
  --shadow-md:  0 6px 32px rgba(30,35,70,.11);
  --shadow-red: 0 8px 32px rgba(215,38,56,.28);
}

.content-wrapper { background: var(--bg) !important; }

/* ════ PAGE HEADER ════ */
.pg-header {
  background: linear-gradient(130deg, #7a1020 0%, var(--red-dark) 40%, var(--red) 100%);
  border-radius: var(--radius);
  padding: 26px 32px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-red);
}
.pg-header::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.pg-header::after {
  content: '';
  position: absolute; right: -70px; top: -70px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
/* second deco circle */
.pg-header .deco2 {
  position: absolute; left: -40px; bottom: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.pg-header-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.pg-eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.6); margin-bottom: 5px;
}
.pg-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 24px;
  color: #fff; margin: 0; line-height: 1.15;
}
.pg-breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: rgba(255,255,255,.6); margin-top: 7px;
}
.pg-breadcrumb a { color: rgba(255,255,255,.8); text-decoration: none; }

/* Edit ID badge in header */
.pg-id-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px; padding: 5px 14px 5px 8px;
  font-size: 12px; color: rgba(255,255,255,.85);
  font-weight: 600; margin-top: 10px;
}
.pg-id-badge span {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff;
}

/* ════ HEADER BUTTONS ════ */
.btn-pg-back {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,.3);
  color: #fff !important; border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s;
}
.btn-pg-back:hover { background: rgba(255,255,255,.25); color: #fff !important; }

.btn-pg-save {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: none;
  color: var(--red) !important; border-radius: 8px; padding: 8px 22px;
  font-size: 13px; font-weight: 800;
  text-decoration: none !important; transition: all .2s; cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.btn-pg-save:hover {
  background: var(--red-faint); color: var(--red-dark) !important;
  transform: translateY(-1px); box-shadow: 0 4px 18px rgba(215,38,56,.2);
}

/* ════ FORM CARD ════ */
.pg-form-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Card section headers */
.pg-section-bar {
  padding: 13px 22px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1.5px solid var(--border);
  background: #fafbff;
}
.pg-section-bar.red-bar {
  background: linear-gradient(90deg, var(--red) 0%, #e8404e 100%);
  border-bottom: none;
}
.pg-section-bar .sec-icon {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.red-bar .sec-icon { background: rgba(255,255,255,.2); color: #fff; }
.pg-section-bar:not(.red-bar) .sec-icon { background: var(--red-faint); color: var(--red); }
.pg-section-bar h5 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 13px; margin: 0;
}
.red-bar h5 { color: #fff; }
.pg-section-bar:not(.red-bar) h5 { color: var(--text); }
.pg-section-bar small { font-size: 11px; display: block; margin-top: 1px; }
.red-bar small { color: rgba(255,255,255,.65); }
.pg-section-bar:not(.red-bar) small { color: var(--text-muted); }

/* ════ FORM BODY ════ */
.pg-form-body { padding: 24px 24px 16px; }

.pg-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ════ FORM FIELDS ════ */
.pg-field { display: flex; flex-direction: column; gap: 6px; }
.pg-field.pg-field-full { grid-column: 1 / -1; }

.pg-label {
  font-size: 12px; font-weight: 700;
  color: var(--text-mid); text-transform: uppercase;
  letter-spacing: .1em;
  display: flex; align-items: center; gap: 6px;
}
.pg-label-icon {
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--red-faint);
  display: flex; align-items: center; justify-content: center;
  color: var(--red); font-size: 9px;
}
.pg-label-req { color: var(--red); font-size: 14px; line-height: 1; }

.pg-input, .pg-select-field, .pg-textarea {
  width: 100%;
  background: var(--bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 9px !important;
  color: var(--text) !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  transition: all .2s !important;
  outline: none !important;
  box-shadow: none !important;
}
.pg-input:focus, .pg-select-field:focus, .pg-textarea:focus {
  border-color: var(--red) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(215,38,56,.1) !important;
}
.pg-input::placeholder { color: var(--text-muted) !important; }
.pg-input[readonly] {
  background: #f0f1f7 !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
}

/* Highlight: input yang ada nilai existing */
.pg-input.has-value,
.pg-select-field.has-value {
  border-color: rgba(215,38,56,.3) !important;
  background: #fff !important;
}

.pg-select-field {
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239097b4' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 36px !important;
}

/* ════ READONLY BADGE ════ */
.pg-readonly-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f0f1f7; border: 1.5px solid var(--border);
  border-radius: 9px; padding: 10px 14px;
  font-size: 13px; color: var(--text-mid); width: 100%;
}
.pg-readonly-badge i { color: var(--text-muted); font-size: 12px; }

/* ════ FILE UPLOAD ════ */
.pg-file-wrap {
  border: 2px dashed var(--border);
  border-radius: 10px; padding: 16px;
  background: var(--bg); cursor: pointer;
  transition: all .2s; position: relative;
  display: flex; align-items: center; gap: 16px;
}
.pg-file-wrap:hover { border-color: var(--red); background: var(--red-faint); }
.pg-file-preview {
  width: 70px; height: 70px; border-radius: 10px;
  object-fit: cover; border: 2px solid var(--border);
  flex-shrink: 0; transition: border-color .2s;
}
.pg-file-wrap:hover .pg-file-preview { border-color: var(--red); }
.pg-file-info { flex: 1; }
.pg-file-info .pg-file-name {
  font-size: 12px; font-weight: 600; color: var(--text-mid); margin-bottom: 4px;
}
.pg-file-info .pg-file-hint {
  font-size: 11px; color: var(--text-muted);
  line-height: 1.5;
}
.pg-file-info .pg-file-hint strong { color: var(--red); }
.pg-file-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 7px; padding: 6px 12px;
  font-size: 11px; font-weight: 700; color: var(--text-mid);
  cursor: pointer; transition: all .15s; margin-top: 8px;
}
.pg-file-wrap:hover .pg-file-btn { border-color: var(--red); color: var(--red); background: var(--red-faint); }

/* ════ PASSWORD FIELD ════ */
.pg-password-wrap { position: relative; }
.pg-password-hint {
  font-size: 11px; color: var(--text-muted); margin-top: 5px;
  display: flex; align-items: center; gap: 5px;
}
.pg-password-hint i { color: var(--red); }

/* ════ CHANGED INDICATOR ════ */
.pg-field-changed .pg-label::after {
  content: 'diubah';
  font-size: 9px; font-weight: 700;
  background: #fff8e8; border: 1px solid #fad88a;
  color: #b07800; border-radius: 4px; padding: 1px 6px;
  text-transform: uppercase; letter-spacing: .08em;
}

/* ════ FORM FOOTER ════ */
.pg-form-footer {
  padding: 16px 24px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1.5px solid var(--border);
  background: #fafbff;
  flex-wrap: wrap;
}
.pg-footer-info {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.pg-footer-info i { color: var(--red); }
.pg-footer-actions { display: flex; align-items: center; gap: 10px; }
.btn-cancel {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-mid) !important; border-radius: 8px; padding: 9px 20px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s;
}
.btn-cancel:hover { border-color: var(--text-mid); color: var(--text) !important; }

.btn-submit {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); border: none;
  color: #fff !important; border-radius: 8px; padding: 10px 28px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 16px rgba(215,38,56,.3);
  letter-spacing: .03em;
}
.btn-submit:hover {
  background: var(--red-dark); transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(215,38,56,.4);
  color: #fff !important;
}

/* ════ SELECT2 ════ */
.select2-container--bootstrap4 .select2-selection {
  background: var(--bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 9px !important;
  min-height: 42px !important;
  font-size: 13px !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
  color: var(--text) !important; line-height: 40px !important; padding-left: 14px !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
  color: var(--text-muted) !important;
}
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection {
  border-color: var(--red) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(215,38,56,.1) !important;
}
.select2-dropdown {
  border: 1.5px solid var(--border) !important;
  border-radius: 9px !important;
  box-shadow: var(--shadow-md) !important;
  font-size: 13px !important;
}
.select2-results__option--highlighted { background: var(--red) !important; color: #fff !important; }
.select2-search__field {
  border: 1.5px solid var(--border) !important;
  border-radius: 7px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  outline: none !important;
}
.select2-search__field:focus { border-color: var(--red) !important; }

/* ════ SUMMERNOTE ════ */
.note-editor.note-frame {
  border: 1.5px solid var(--border) !important;
  border-radius: 9px !important;
  overflow: hidden;
}
.note-editor.note-frame:focus-within {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(215,38,56,.1) !important;
}
.note-toolbar { background: #fafbff !important; border-bottom: 1.5px solid var(--border) !important; }

/* ════ ANIMATIONS ════ */
@keyframes pgIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.pg-header    { animation: pgIn .4s ease both; }
.pg-form-card { animation: pgIn .4s .1s ease both; }
.pg-field     { animation: pgIn .3s ease both; }

::-webkit-scrollbar { height:5px; width:5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius:99px; }

/* view.php */
:root {
  --red:        #D72638;
  --red-dark:   #b01e2d;
  --red-faint:  #fff0f1;
  --white:      #ffffff;
  --bg:         #f5f6fa;
  --border:     #e8eaf0;
  --text:       #1a1d2e;
  --text-mid:   #4a5068;
  --text-muted: #9097b4;
  --radius:     14px;
  --shadow-sm:  0 2px 12px rgba(30,35,70,.07);
  --shadow-md:  0 6px 32px rgba(30,35,70,.11);
  --shadow-red: 0 8px 32px rgba(215,38,56,.28);
}

.content-wrapper { background: var(--bg) !important; }

/* ════ PAGE HEADER ════ */
.pg-header {
  background: linear-gradient(130deg, #1a1d2e 0%, #2d1a1e 45%, var(--red-dark) 100%);
  border-radius: var(--radius);
  padding: 26px 32px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(20,20,40,.35);
}
.pg-header::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.pg-header::after {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(215,38,56,.12); pointer-events: none;
}
.pg-header .deco2 {
  position: absolute; left: -40px; bottom: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.03); pointer-events: none;
}
.pg-header-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.pg-eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-bottom: 5px;
}
.pg-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 24px;
  color: #fff; margin: 0; line-height: 1.15;
}
.pg-breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: rgba(255,255,255,.5); margin-top: 7px;
}
.pg-breadcrumb a { color: rgba(255,255,255,.75); text-decoration: none; }
.pg-id-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(215,38,56,.2);
  border: 1px solid rgba(215,38,56,.35);
  border-radius: 100px; padding: 5px 14px 5px 8px;
  font-size: 12px; color: rgba(255,255,255,.85); font-weight: 600; margin-top: 10px;
}
.pg-id-badge span {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff;
}

/* ════ HEADER BUTTONS ════ */
.btn-pg-back {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.2);
  color: #fff !important; border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s;
}
.btn-pg-back:hover { background: rgba(255,255,255,.2); color: #fff !important; }

.btn-pg-edit {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--red); border: none;
  color: #fff !important; border-radius: 8px; padding: 8px 20px;
  font-size: 13px; font-weight: 800;
  text-decoration: none !important; transition: all .2s;
  box-shadow: 0 3px 14px rgba(215,38,56,.4);
}
.btn-pg-edit:hover {
  background: #b01e2d; color: #fff !important;
  transform: translateY(-1px); box-shadow: 0 5px 20px rgba(215,38,56,.5);
}

/* ════ DETAIL CARD ════ */
.pg-detail-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Top bar */
.pg-detail-topbar {
  background: linear-gradient(90deg, var(--red) 0%, #e8404e 100%);
  padding: 13px 22px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.pg-detail-topbar-left {
  display: flex; align-items: center; gap: 10px;
}
.pg-detail-topbar .sec-icon {
  width: 30px; height: 30px; border-radius: 7px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px;
}
.pg-detail-topbar h5 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 13px; color: #fff; margin: 0;
}
.pg-detail-topbar small { font-size: 11px; color: rgba(255,255,255,.65); display: block; margin-top: 1px; }
.pg-record-count {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px; padding: 4px 14px; color: #fff;
}

/* ════ FIELDS GRID ════ */
.pg-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0;
}

/* Individual field item */
.pg-field-item {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  transition: background .15s;
  position: relative;
}
.pg-field-item:hover { background: #fafbff; }
.pg-field-item.pg-field-full {
  grid-column: 1 / -1;
  border-right: none;
}

/* Field label */
.pg-field-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.pg-field-label .lbl-icon {
  width: 18px; height: 18px; border-radius: 4px;
  background: var(--red-faint);
  display: flex; align-items: center; justify-content: center;
  color: var(--red); font-size: 8px; flex-shrink: 0;
}

/* Field value */
.pg-field-value {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.5; word-break: break-word;
}
.pg-field-value.empty {
  font-size: 12px; font-weight: 400;
  color: var(--text-muted); font-style: italic;
}

/* Accent line on hover */
.pg-field-item::before {
  content: '';
  position: absolute; left: 0; top: 0;
  width: 3px; height: 0;
  background: var(--red);
  border-radius: 0 3px 3px 0;
  transition: height .2s;
}
.pg-field-item:hover::before { height: 100%; }

/* ════ IMAGE FIELD ════ */
.pg-img-wrap {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
}
.pg-img-thumb {
  width: 100px; height: 100px; object-fit: cover;
  border-radius: 10px; border: 2px solid var(--border);
  transition: all .2s; cursor: pointer;
}
.pg-img-thumb:hover {
  border-color: var(--red);
  box-shadow: 0 4px 16px rgba(215,38,56,.2);
  transform: scale(1.03);
}
.pg-img-actions { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.pg-img-link {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--red-faint); border: 1.5px solid rgba(215,38,56,.2);
  color: var(--red) !important; border-radius: 7px; padding: 6px 12px;
  font-size: 11px; font-weight: 700; text-decoration: none !important;
  transition: all .15s;
}
.pg-img-link:hover { background: #ffd6d9; border-color: var(--red); }

/* ════ CURRENCY / NUMBER ════ */
.pg-currency {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red-faint); border: 1.5px solid rgba(215,38,56,.15);
  border-radius: 8px; padding: 6px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px; font-weight: 800; color: var(--red);
}
.pg-currency .cur-prefix { font-size: 10px; font-weight: 700; opacity: .7; margin-right: 2px; }

/* ════ FK BADGE ════ */
.pg-fk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f0f1f7; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-mid);
}
.pg-fk-badge i { color: var(--text-muted); font-size: 11px; }

/* ════ CARD FOOTER ════ */
.pg-detail-footer {
  padding: 14px 22px;
  background: #fafbff;
  border-top: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.pg-footer-meta {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.pg-footer-meta i { color: var(--red); }
.pg-footer-actions { display: flex; gap: 8px; }

.btn-footer-edit {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red); border: none;
  color: #fff !important; border-radius: 8px; padding: 8px 20px;
  font-size: 13px; font-weight: 700;
  text-decoration: none !important; transition: all .2s;
  box-shadow: 0 3px 12px rgba(215,38,56,.3);
}
.btn-footer-edit:hover { background: var(--red-dark); color: #fff !important; transform: translateY(-1px); }

.btn-footer-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-mid) !important; border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s;
}
.btn-footer-back:hover { border-color: var(--text-mid); color: var(--text) !important; }

/* ════ ANIMATIONS ════ */
@keyframes pgIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.pg-header      { animation: pgIn .4s ease both; }
.pg-detail-card { animation: pgIn .4s .1s ease both; }
.pg-field-item  { animation: pgIn .3s ease both; }

<?php
$i = 1;
foreach($this->db->query("SHOW FULL COLUMNS from `data_$modul` WHERE FIELD NOT IN('id_$modul','password')")->result() as $c):
  echo ".pg-field-item:nth-child({$i}) { animation-delay: " . ($i * 0.04) . "s }\n";
  $i++;
endforeach;
?>

::-webkit-scrollbar { height:5px; width:5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius:99px; }

/* data.php */
:root {
  --red:        #D72638;
  --red-dark:   #b01e2d;
  --red-light:  #ff4d5e;
  --red-faint:  #fff0f1;
  --red-soft:   rgba(215,38,56,.1);
  --white:      #ffffff;
  --bg:         #f5f6fa;
  --card:       #ffffff;
  --border:     #e8eaf0;
  --text:       #1a1d2e;
  --text-mid:   #4a5068;
  --text-muted: #9097b4;
  --radius:     14px;
  --shadow-sm:  0 2px 12px rgba(30,35,70,.07);
  --shadow-md:  0 6px 32px rgba(30,35,70,.11);
  --shadow-red: 0 8px 32px rgba(215,38,56,.28);
}

.content-wrapper { background: var(--bg) !important; }

/* ════ PAGE HEADER ════ */
.pg-header {
  background: linear-gradient(130deg, var(--red-dark) 0%, var(--red) 55%, #f0404f 100%);
  border-radius: var(--radius);
  padding: 26px 32px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-red);
}
.pg-header::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.pg-header::after {
  content: '';
  position: absolute; right: -70px; top: -70px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.pg-header-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.pg-eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.65); margin-bottom: 5px;
}
.pg-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 24px;
  color: #fff; margin: 0; line-height: 1.15;
}
.pg-breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: rgba(255,255,255,.6); margin-top: 7px;
}
.pg-breadcrumb a { color: rgba(255,255,255,.8); text-decoration: none; }

/* ════ STAT CARDS ════ */
.pg-stats {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px;
}
.pg-stat {
  flex: 1; min-width: 120px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.pg-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pg-stat-accent {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--red);
  border-radius: var(--radius) var(--radius) 0 0;
}
.pg-stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--red-faint);
  display: flex; align-items: center; justify-content: center;
  color: var(--red); font-size: 15px; margin-bottom: 10px;
}
.pg-stat-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .15em; color: var(--text-muted); margin-bottom: 4px;
}
.pg-stat-val {
  font-family: 'Montserrat', sans-serif;
  font-size: 26px; font-weight: 800; color: var(--text); line-height: 1;
}

/* ════ MAIN CARD ════ */
.pg-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.pg-card-header {
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
  background: #fafbff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.pg-card-body { padding: 18px; }

/* ════ TOOLBAR ════ */
.pg-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.pg-search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 300px; }
.pg-search-wrap i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-size: 12px;
}
.pg-search-input {
  width: 100% !important;
  background: var(--bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  padding: 8px 12px 8px 34px !important;
  font-size: 13px !important;
  transition: all .2s !important;
  outline: none !important;
}
.pg-search-input:focus {
  border-color: var(--red) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(215,38,56,.1) !important;
}
.pg-search-input::placeholder { color: var(--text-muted); }
.pg-select {
  background: var(--bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  min-width: 150px; cursor: pointer;
  transition: border-color .2s !important;
  outline: none !important;
}
.pg-select:focus {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(215,38,56,.1) !important;
}

/* ════ BUTTONS ════ */
.btn-pg-back {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,.3);
  color: #fff !important; border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s;
}
.btn-pg-back:hover { background: rgba(255,255,255,.25); color: #fff !important; }

.btn-pg-add {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: none;
  color: var(--red) !important; border-radius: 8px; padding: 8px 20px;
  font-size: 13px; font-weight: 800;
  text-decoration: none !important; transition: all .2s;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.btn-pg-add:hover {
  background: var(--red-faint); color: var(--red-dark) !important;
  transform: translateY(-1px); box-shadow: 0 4px 18px rgba(215,38,56,.18);
}

.btn-pg-print {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-mid) !important; border-radius: 8px; padding: 7px 16px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s; box-shadow: var(--shadow-sm);
}
.btn-pg-print:hover { border-color: var(--red); color: var(--red) !important; background: var(--red-faint); }

/* ════ TABLE ════ */
table.tabza { border-collapse: separate !important; border-spacing: 0 4px !important; width: 100% !important; }
table.tabza thead tr th {
  background: var(--red) !important; color: #fff !important;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700 !important; font-size: 11px !important;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 12px 14px !important; border: none !important; white-space: nowrap;
}
table.tabza thead tr th:first-child { border-radius: 8px 0 0 8px !important; }
table.tabza thead tr th:last-child  { border-radius: 0 8px 8px 0 !important; }

table.tabza tbody tr td {
  background: #fff !important;
  border-top: 1.5px solid var(--border) !important;
  border-bottom: 1.5px solid var(--border) !important;
  border-left: none !important; border-right: none !important;
  color: var(--text) !important; font-size: 13px !important;
  padding: 11px 14px !important; vertical-align: middle !important;
  transition: background .12s;
}
table.tabza tbody tr td:first-child {
  border-left: 1.5px solid var(--border) !important;
  border-radius: 8px 0 0 8px !important;
}
table.tabza tbody tr td:last-child {
  border-right: 1.5px solid var(--border) !important;
  border-radius: 0 8px 8px 0 !important;
}
table.tabza tbody tr:hover td {
  background: var(--red-faint) !important;
  border-color: rgba(215,38,56,.18) !important;
}
table.tabza tbody tr:hover td:first-child { border-left-color: var(--red) !important; }
table.tabza tbody tr:nth-child(even) td { background: #fafbff !important; }
table.tabza tbody tr:nth-child(even):hover td { background: var(--red-faint) !important; }

/* ════ ACTION BUTTONS IN TABLE ════ */
.pg-aksi { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }

.btn-wa {
  display: inline-flex; align-items: center; gap: 5px;
  background: #e8f8ee; border: 1.5px solid #b2dfc2; color: #1a8a40 !important;
  border-radius: 7px; padding: 5px 11px; font-size: 11px; font-weight: 700;
  text-decoration: none !important; white-space: nowrap; transition: all .15s;
}
.btn-wa:hover { background: #d0f0dd; border-color: #1a8a40; }

.btn-detail {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: #e8f3ff; border: 1.5px solid #b3d4fa; color: #1a6fc4 !important;
  border-radius: 7px; font-size: 12px; text-decoration: none !important; transition: all .15s;
}
.btn-detail:hover { background: #cce5ff; border-color: #1a6fc4; }

.btn-edit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: #fff8e8; border: 1.5px solid #fad88a; color: #b07800 !important;
  border-radius: 7px; font-size: 12px; text-decoration: none !important; transition: all .15s;
}
.btn-edit:hover { background: #fef0c0; border-color: #b07800; }

.btn-del {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: #fff0f1; border: 1.5px solid #fbb8bc; color: var(--red) !important;
  border-radius: 7px; font-size: 12px; text-decoration: none !important;
  cursor: pointer; transition: all .15s;
}
.btn-del:hover { background: #ffe0e2; border-color: var(--red); }

/* ════ DATATABLE OVERRIDES ════ */
.dataTables_wrapper .dataTables_filter { display: none !important; }
.dataTables_wrapper .dataTables_length label { color: var(--text-mid) !important; font-size: 12px; }
.dataTables_wrapper .dataTables_length select {
  background: var(--bg) !important; border: 1.5px solid var(--border) !important;
  border-radius: 7px !important; color: var(--text) !important;
  padding: 4px 10px !important; font-size: 12px !important;
}
.dataTables_wrapper .dataTables_info { color: var(--text-muted) !important; font-size: 12px; }
/* ════ PASTE INI DI BAGIAN <style> — GANTI CSS PAGINATION LAMA ════ */

/* Paksa override AdminLTE Bootstrap4 DataTables pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button:focus,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.paginate_button a,
div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item .page-link {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1.5px solid #e8eaf0 !important;
  border-radius: 7px !important;
  color: #4a5068 !important;
  margin: 0 2px !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(30,35,70,.07) !important;
  transition: all .15s !important;
}

/* Hover */
.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.paginate_button a:hover,
div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item:hover .page-link {
  background: #fff0f1 !important;
  background-color: #fff0f1 !important;
  border-color: #D72638 !important;
  color: #D72638 !important;
}

/* Active / current */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:focus,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.paginate_button.active a,
div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item.active .page-link {
  background: #D72638 !important;
  background-color: #D72638 !important;
  border-color: #D72638 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(215,38,56,.35) !important;
}

/* Disabled */
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item.disabled .page-link {
  background: #f5f6fa !important;
  background-color: #f5f6fa !important;
  border-color: #e8eaf0 !important;
  color: #c0c4d6 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
.dataTables_wrapper .dataTables_processing {
  background: rgba(255,255,255,.97) !important; border: 1.5px solid var(--border) !important;
  border-radius: 10px !important; color: var(--red) !important; font-weight: 600 !important;
  box-shadow: var(--shadow-md) !important;
}
table.tabza tbody td.dataTables_empty {
  text-align: center !important; color: var(--text-muted) !important;
  padding: 52px 24px !important; border: none !important; background: transparent !important;
}

/* ════ ANIMATIONS ════ */
@keyframes pgIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.pg-header  { animation: pgIn .4s ease both; }
.pg-stats   { animation: pgIn .4s .08s ease both; }
.pg-card    { animation: pgIn .4s .14s ease both; }
table.tabza tbody tr { animation: pgIn .22s ease both; }
table.tabza tbody tr:nth-child(1)  { animation-delay:.02s }
table.tabza tbody tr:nth-child(2)  { animation-delay:.05s }
table.tabza tbody tr:nth-child(3)  { animation-delay:.08s }
table.tabza tbody tr:nth-child(4)  { animation-delay:.11s }
table.tabza tbody tr:nth-child(5)  { animation-delay:.14s }
table.tabza tbody tr:nth-child(n+6){ animation-delay:.17s }

::-webkit-scrollbar { height:5px; width:5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius:99px; }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE OVERRIDES — applied when [data-theme="dark"] on <html>
   ═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg:         #0d1117;
  --white:      #161b22;
  --border:     #2a313c;
  --text:       #e6edf3;
  --text-mid:   #b1bac4;
  --text-muted: #7d8590;
  --red-faint:  rgba(215,38,56,0.15);
  --shadow-sm:  0 2px 12px rgba(0,0,0,.4);
  --shadow-md:  0 6px 32px rgba(0,0,0,.6);
  --shadow-red: 0 8px 32px rgba(215,38,56,.4);
}

[data-theme="dark"] .pg-card,
[data-theme="dark"] .pg-stat,
[data-theme="dark"] .pg-form-card { background: #161b22 !important; border-color: #2a313c !important; color: var(--text); }

[data-theme="dark"] .pg-card-head,
[data-theme="dark"] .pg-form-card .pg-card-head,
[data-theme="dark"] table.tabza thead th,
[data-theme="dark"] .tabza-toolbar { background: #1c222b !important; border-color: #2a313c !important; color: var(--text); }

[data-theme="dark"] table.tabza tbody td { background: transparent !important; color: var(--text-mid); border-color: #2a313c !important; }
[data-theme="dark"] table.tabza tbody tr:hover td { background: rgba(255,255,255,0.04) !important; }
[data-theme="dark"] table.tabza tbody tr:nth-child(even) td { background: rgba(255,255,255,0.015) !important; }

[data-theme="dark"] .form-control,
[data-theme="dark"] .custom-select,
[data-theme="dark"] .pg-input,
[data-theme="dark"] textarea.form-control {
  background: #0a0d12 !important;
  border-color: #2a313c !important;
  color: var(--text) !important;
}
[data-theme="dark"] .form-control::placeholder { color: #545d68; }
[data-theme="dark"] .input-group-text { background: #1c222b !important; border-color: #2a313c !important; color: var(--text-mid) !important; }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .pg-input:focus { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(215,38,56,0.2) !important; }

[data-theme="dark"] .pg-search-wrap input,
[data-theme="dark"] input.dataTables_filter,
[data-theme="dark"] .dataTables_filter input { background: #0a0d12 !important; border-color: #2a313c !important; color: var(--text) !important; }

[data-theme="dark"] .pg-badge.muted,
[data-theme="dark"] .pg-badge.default { background: #1c222b !important; color: var(--text-mid) !important; }

[data-theme="dark"] .note-editor,
[data-theme="dark"] .note-editing-area .note-editable {
  background: #0a0d12 !important;
  color: var(--text) !important;
  border-color: #2a313c !important;
}
[data-theme="dark"] .note-toolbar { background: #1c222b !important; border-color: #2a313c !important; }
[data-theme="dark"] .note-btn { background: #161b22 !important; color: var(--text-mid) !important; border-color: #2a313c !important; }

[data-theme="dark"] hr { border-color: #2a313c; }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] label { color: var(--text-mid); }
