/* ═══════════════════════════════════════════
   PRIME GENERATION — Shared Page Components
   pg-components.css
   Loaded globally via header.php
   ─────────────────────────────────────────
   Contains all reusable pg-* component styles
   shared across data, add, edit, and view pages.
   Individual view files keep ONLY their unique
   overrides (gradient variants, detail-card, etc.)
═══════════════════════════════════════════ */

/* ════ CSS VARIABLES (superset of all views) ════ */
: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;
  --green:        #1a8a40;
  --green-faint:  #e8f8ee;
  --orange:       #e07b00;
  --orange-faint: #fff8e8;
  --blue:         #1a6fc4;
  --blue-faint:   #e8f3ff;
  --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 ════ */
.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 .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,.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; }

/* ════ ID BADGE (edit/view pages) ════ */
.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: 9px; 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-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-import {
  display: inline-flex; align-items: center; gap: 7px;
  background: #0ebc48; border: none;
  color: #FFFFFF !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-import: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); }

.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);
}

/* ════ 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 & SEARCH ════ */
.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;
}

/* ════ 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; }

.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;
}
.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;
}
.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;
}
.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;
}

/* ════ 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;
}
.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 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 .pg-label-req,
.pg-label-req { color: var(--red); font-size: 14px; line-height: 1; }
.pg-label .pg-label-icon,
.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 (add.php — centered layout) ════ */
.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 OVERRIDES ════ */
.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 OVERRIDES ════ */
.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 OVERRIDES ════ */
.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-stats      { animation: pgIn .4s .08s ease both; }
.pg-card       { animation: pgIn .4s .14s ease both; }
.pg-form-card  { animation: pgIn .4s .1s ease both; }
.pg-field      { animation: pgIn .3s 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 }

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

/* ════ HEADER BUTTON — EDIT ════ */
.btn-pg-edit {
  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-edit:hover { background: rgba(255,255,255,.28); color: #fff !important; }
.btn-pg-edit.bg-success {
  background: rgba(26,138,64,.75); border-color: rgba(26,138,64,.5);
}
.btn-pg-edit.bg-success:hover { background: rgba(26,138,64,.9); }

/* ════ DETAIL VIEW CARD ════ */
.pg-detail-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 22px;
  animation: pgIn .4s .1s ease both;
}
.pg-detail-topbar {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 20px;
}
.pg-detail-topbar-left { flex: 1; display: flex; align-items: center; gap: 12px; }
.pg-detail-topbar h5 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.pg-detail-topbar small { font-size: 11px; color: var(--text-muted); }

/* ════ SECTION ICON ════ */
.sec-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--red-faint); color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

/* ════ FIELDS GRID (detail view) ════ */
.pg-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
}
.pg-field-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  transition: background .15s;
}
.pg-field-item:hover { background: var(--bg); }
.pg-field-item.pg-field-full { grid-column: 1 / -1; }
.pg-field-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 5px;
}
.pg-field-value {
  font-size: 14px; font-weight: 700; color: var(--text);
  word-break: break-word; line-height: 1.4;
}
.pg-field-value.empty { color: var(--text-muted); font-weight: 400; font-style: italic; font-size: 13px; }
.lbl-icon {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  background: var(--red-faint); color: var(--red);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px;
}

/* ════ FIELD VALUE HELPERS ════ */
.pg-currency { font-variant-numeric: tabular-nums; }
.pg-fk-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--blue-faint); color: var(--blue);
  border: 1px solid rgba(26,111,196,.2);
  border-radius: 6px; padding: 3px 10px;
  font-size: 12px; font-weight: 700;
}
.pg-record-count {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--red-faint); color: var(--red);
  border: 1px solid rgba(215,38,56,.2);
  border-radius: 99px; padding: 2px 10px;
  font-size: 11px; font-weight: 700;
}

/* ════ IMAGE DISPLAY (detail view) ════ */
.pg-img-wrap { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pg-img-thumb {
  width: 80px; height: 80px; border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s;
}
.pg-img-thumb:hover { transform: scale(1.04); }
.pg-img-link { display: inline-block; }
.pg-img-actions { display: flex; flex-direction: column; gap: 6px; justify-content: center; }

/* ════ DETAIL FOOTER ════ */
.pg-detail-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1.5px solid var(--border);
}
.pg-footer-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.pg-footer-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-footer-back {
  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: 8px 18px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: all .2s;
}
.btn-footer-back:hover { border-color: var(--text); color: var(--text) !important; }
.btn-footer-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: 700; cursor: pointer;
  text-decoration: none !important; transition: all .2s;
  box-shadow: 0 3px 14px rgba(215,38,56,.3);
}
.btn-footer-edit:hover {
  background: var(--red-dark); color: #fff !important;
  transform: translateY(-1px); box-shadow: 0 5px 20px rgba(215,38,56,.4);
}

/* ════ COMPANY SETTING — DETAIL VIEW ════ */
.pg-setting-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
.pg-setting-grid > *:nth-child(3) {
  grid-column: 1 / -1;
}
@media (max-width: 768px) {
  .pg-setting-grid { grid-template-columns: 1fr; }
}

/* Profile Card */
.pg-profile-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  animation: pgIn .4s .1s ease both;
}
.pg-profile-card-top {
  background: linear-gradient(135deg, var(--red-dark) 0%, var(--red) 60%, #f0404f 100%);
  padding: 32px 24px 48px;
  display: flex;
  justify-content: center;
}
.pg-logo-wrap {
  position: relative;
  width: 88px;
  height: 88px;
}
.pg-logo-wrap img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.pg-logo-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  background: #1a8a40;
  border: 2.5px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
}
.pg-profile-body {
  padding: 0 20px 22px;
  margin-top: -28px;
  text-align: center;
}
.pg-app-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  margin-top: 10px;
  line-height: 1.3;
}
.pg-app-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.pg-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red-faint);
  color: var(--red);
  border: 1px solid rgba(215,38,56,.2);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 14px;
}
.pg-contact-chip:hover { background: rgba(215,38,56,.12); color: var(--red); text-decoration: none; }

/* Status Row */
.pg-status-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pg-status-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pg-status-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pg-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}
.pg-status-pill.active {
  background: var(--green-faint);
  color: var(--green);
  border: 1px solid rgba(26,138,64,.2);
}
.pg-status-pill.active.dot::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
}

/* Info Card */
.pg-info-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: pgIn .4s .15s ease both;
}
.pg-info-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.pg-info-section-title .sec-icon {
  width: 36px;
  height: 36px;
  background: var(--red-faint);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 14px;
  flex-shrink: 0;
}
.pg-info-section-title h6 { margin: 0; font-size: 13px; font-weight: 800; color: var(--text); }
.pg-info-section-title small { font-size: 11px; color: var(--text-muted); }
.pg-info-list { padding: 8px 0; }
.pg-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.pg-info-row:last-child { border-bottom: none; }
.pg-info-row:hover { background: var(--bg); }
.pg-info-row-icon {
  width: 30px;
  height: 30px;
  background: var(--red-faint);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}
.pg-info-row-content { flex: 1; min-width: 0; }
.pg-info-row-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.pg-info-row-value { font-size: 14px; font-weight: 700; color: var(--text); word-break: break-word; }

/* Time Badge */
.pg-time-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: var(--red-faint);
  color: var(--red);
  border: 1px solid rgba(215,38,56,.2);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 16px;
  font-weight: 800;
}
.pg-time-badge small { font-size: 11px; font-weight: 600; }

/* Promo Box */
.pg-promo-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
  white-space: pre-wrap;
  font-family: inherit;
}

/* Theme / Color Card */
.pg-theme-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: pgIn .4s .2s ease both;
}
.pg-theme-body { padding: 20px 22px; }
.pg-color-swatches {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.pg-swatch-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pg-swatch {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  border: 3px solid rgba(255,255,255,.8);
  outline: 1px solid var(--border);
}
.pg-swatch-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.pg-swatch-hex { font-size: 11px; font-weight: 600; color: var(--text); font-family: monospace; }
.pg-color-preview-bar {
  display: flex;
  height: 12px;
  border-radius: 99px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.pg-color-preview-bar > div { flex: 1; }
