/* =====================================================================
   NusantaraV2 - application design system  (English UI)
   Bootstrap 5 loads first; this file themes + overrides it.
   ===================================================================== */

:root{
  /* Brand colours (superadmin-editable; injected inline by layouts) */
  --jg-primary:#0056b3;
  --jg-secondary:#212529;
  --jg-accent:#dc3545;

  /* Derived / fixed palette */
  --jg-primary-050:#eaf2fb;
  --jg-primary-100:#d3e4f7;
  --jg-primary-600:#0056b3;
  --jg-primary-700:#004494;
  --jg-primary-800:#00356f;

  --jg-navy-1:#0b2c52;      /* brand panel gradient start */
  --jg-navy-2:#061a33;      /* brand panel gradient end   */

  --jg-ink:#1f2937;
  --jg-ink-soft:#475467;
  --jg-muted:#8a94a6;
  --jg-bg:#f2f5f9;
  --jg-card:#ffffff;
  --jg-border:#e6eaf0;
  --jg-border-strong:#d7dee8;
  --jg-ring:rgba(0,86,179,.18);

  --jg-radius:16px;
  --jg-radius-sm:11px;
  --jg-radius-xs:8px;
  --jg-pill:999px;

  --jg-shadow-xs:0 1px 2px rgba(16,24,40,.06);
  --jg-shadow-sm:0 2px 8px rgba(16,24,40,.06);
  --jg-shadow:0 10px 30px rgba(16,24,40,.08);
  --jg-shadow-lg:0 24px 60px rgba(9,25,54,.18);

  --jg-sidebar-w:256px;
  --jg-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;

  --jg-grad-primary:linear-gradient(135deg,var(--jg-primary) 0%,var(--jg-primary-800) 100%);
}

*,*::before,*::after{ box-sizing:border-box; }

body{
  font-family:var(--jg-font);
  color:var(--jg-ink);
  background:var(--jg-bg);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

a{ color:var(--jg-primary); text-decoration:none; }
a:hover{ color:var(--jg-primary-700); text-decoration:underline; }

h1,h2,h3,h4,h5,h6{ color:var(--jg-ink); font-weight:700; letter-spacing:-.01em; }

::selection{ background:var(--jg-primary-100); }

/* ---------- Scrollbars ---------- */
*::-webkit-scrollbar{ width:10px; height:10px; }
*::-webkit-scrollbar-thumb{ background:#c7d0dd; border-radius:8px; border:2px solid transparent; background-clip:content-box; }
*::-webkit-scrollbar-thumb:hover{ background:#aeb9c9; background-clip:content-box; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn{ border-radius:var(--jg-radius-xs); font-weight:600; }
.btn-lg{ border-radius:var(--jg-radius-sm); padding:.7rem 1.15rem; }

.btn-primary{
  background:var(--jg-grad-primary);
  border:0;
  box-shadow:0 6px 18px -6px rgba(0,86,179,.55);
}
.btn-primary:hover,.btn-primary:focus{ filter:brightness(1.05); background:var(--jg-grad-primary); }
.btn-primary:active{ filter:brightness(.95); }

.btn-dark{ background:linear-gradient(135deg,#2b3648,#161c26); border:0; }
.btn-outline-secondary{ border-color:var(--jg-border-strong); color:var(--jg-ink-soft); }
.btn-outline-secondary:hover{ background:#f1f4f8; color:var(--jg-ink); border-color:var(--jg-border-strong); }
.btn-link{ text-decoration:none; }

/* =====================================================================
   Forms
   ===================================================================== */
.form-label{ font-weight:600; font-size:.82rem; color:var(--jg-ink-soft); margin-bottom:.35rem; }
.form-control,.form-select{
  border-radius:var(--jg-radius-xs);
  border-color:var(--jg-border-strong);
  padding:.6rem .8rem;
  color:var(--jg-ink);
}
.form-control::placeholder{ color:#a9b2c1; }
.form-control:focus,.form-select:focus{
  border-color:var(--jg-primary);
  box-shadow:0 0 0 4px var(--jg-ring);
}
.input-group-text{
  background:#f4f7fb;
  border-color:var(--jg-border-strong);
  color:var(--jg-muted);
  border-radius:var(--jg-radius-xs);
}
.input-group .form-control{ border-left:0; }
.input-group .form-control:focus{ border-left:0; }
.input-group:focus-within .input-group-text{ border-color:var(--jg-primary); color:var(--jg-primary); }
.input-group > .jg-pw-toggle{
  border:1px solid var(--jg-border-strong); border-left:0;
  color:var(--jg-muted); background:#fff;
}
.input-group:focus-within > .jg-pw-toggle{ border-color:var(--jg-primary); }
.jg-pw-toggle:hover{ color:var(--jg-primary); }

.form-check-input:checked{ background-color:var(--jg-primary); border-color:var(--jg-primary); }
.form-check-input:focus{ box-shadow:0 0 0 4px var(--jg-ring); border-color:var(--jg-primary); }

.invalid-feedback{ font-size:.8rem; }

/* =====================================================================
   AUTH  (two-column login)
   ===================================================================== */
.jg-auth-body{ margin:0; background:var(--jg-bg); height:100vh; overflow:hidden; }
.jg-auth{
  height:100vh;
  display:grid;
  grid-template-columns:1.05fr 1fr;
}

/* ---- Left: brand panel ---- */
.jg-auth__brand{
  position:relative;
  color:#eaf1fb;
  padding:40px 52px;
  overflow-y:auto;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(56,132,255,.28), transparent 60%),
    linear-gradient(160deg,var(--jg-navy-1) 0%,var(--jg-navy-2) 100%);
  display:flex; flex-direction:column;
  overflow:hidden;
}
.jg-auth__brand::before{  /* blueprint grid */
  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:44px 44px;
  mask-image:linear-gradient(180deg,rgba(0,0,0,.9),rgba(0,0,0,.15));
}
.jg-auth__brand > *{ position:relative; z-index:1; }

.jg-auth__logo{ display:flex; align-items:center; gap:13px; margin-bottom:26px; }
.jg-auth__logo img{ height:40px; width:auto; object-fit:contain; }
.jg-auth__logo .jg-wordmark{ font-size:1.45rem; font-weight:800; letter-spacing:.02em; color:#fff; }
.jg-auth__logo .jg-logo-fallback{
  height:40px; width:40px; border-radius:11px; display:grid; place-items:center;
  background:rgba(255,255,255,.12); font-weight:800; font-size:1.1rem; color:#fff;
}

.jg-auth__title{
  font-size:1.8rem; line-height:1.3; font-weight:800; color:#fff;
  margin:0 0 6px; letter-spacing:-.01em;
}
.jg-auth__title .accent{
  background:linear-gradient(90deg,#5fd0ff,#3a8bff);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.jg-auth__tagline{ color:#9fb4d4; font-size:.92rem; margin-bottom:22px; }

.jg-feature-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px; }
.jg-feature{
  display:flex; align-items:center; gap:13px;
  padding:11px 14px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:13px;
  background:rgba(255,255,255,.04);
  backdrop-filter:blur(2px);
  transition:transform .15s ease, background .15s ease;
}
.jg-feature:hover{ transform:translateX(3px); background:rgba(255,255,255,.07); }
.jg-feature__icon{
  height:38px; width:38px; flex:0 0 38px; border-radius:10px;
  display:grid; place-items:center; font-size:1rem;
  background:rgba(95,208,255,.16); color:#8fdcff;
}
.jg-feature__t{ font-weight:700; font-size:.92rem; color:#eef4ff; }
.jg-feature__d{ font-size:.8rem; color:#9fb4d4; }

.jg-auth__foot{ margin-top:auto; padding-top:22px; font-size:.74rem; color:#7f96b8; }

/* ---- Right: form panel ---- */
.jg-auth__panel{
  display:flex; align-items:center; justify-content:center;
  padding:28px;
  overflow-y:auto;
  background:linear-gradient(180deg,#eef3f9 0%,#f7f9fc 100%);
}
.jg-auth__card{
  position:relative;
  width:100%; max-width:428px;
  background:var(--jg-card);
  border-radius:20px;
  box-shadow:var(--jg-shadow-lg);
  padding:28px 30px 24px;
  overflow:hidden;
}
.jg-auth__card::before{
  content:""; position:absolute; left:0; right:0; top:0; height:4px;
  background:linear-gradient(90deg,#5fd0ff,var(--jg-primary));
}
.jg-pill{
  display:inline-flex; align-items:center; gap:7px;
  padding:5px 12px; border-radius:var(--jg-pill);
  background:var(--jg-primary-050); color:var(--jg-primary-700);
  font-size:.72rem; font-weight:700; letter-spacing:.06em;
}
.jg-pill::before{ content:""; height:7px; width:7px; border-radius:50%; background:var(--jg-primary); }
.jg-auth__card h2{ font-size:1.22rem; margin:11px 0 3px; }
.jg-auth__card .jg-auth__sub{ color:var(--jg-muted); font-size:.84rem; margin-bottom:15px; }

/* Tabs (Login Client | Login Staff) */
.jg-auth-tabs{
  display:flex; gap:6px; padding:5px;
  background:#f1f4f8; border-radius:12px; margin-bottom:15px;
}
.jg-auth-tabs .nav-link{
  flex:1; text-align:center; border:0; border-radius:9px;
  font-weight:600; font-size:.86rem; color:var(--jg-ink-soft);
  padding:.5rem .25rem;
}
.jg-auth-tabs .nav-link:hover{ color:var(--jg-ink); }
.jg-auth-tabs .nav-link.active{
  background:#fff; color:var(--jg-primary);
  box-shadow:var(--jg-shadow-xs);
}

.jg-field{ margin-bottom:13px; }
.jg-field__labelrow{ display:flex; justify-content:space-between; align-items:baseline; }
.jg-linkbtn{
  background:none; border:0; padding:0; font-size:.76rem; font-weight:600;
  color:var(--jg-primary); cursor:pointer;
}
.jg-linkbtn:hover{ text-decoration:underline; }

.jg-auth__row{
  display:flex; align-items:center; justify-content:space-between;
  margin:2px 0 12px; font-size:.82rem;
}

.jg-auth__submit{
  font-size:.92rem; font-weight:600;
  padding:.62rem 1rem; border-radius:var(--jg-radius-xs);
}
.jg-auth__submit i{ font-size:.88em; }

.jg-auth__hint{ text-align:center; color:var(--jg-muted); font-size:.8rem; margin-top:13px; }

.jg-trust{
  margin-top:12px; padding-top:11px; border-top:1px solid var(--jg-border);
  display:flex; flex-wrap:wrap; gap:5px 14px; justify-content:center;
  font-size:.71rem; color:var(--jg-muted);
}
.jg-trust span{ display:inline-flex; align-items:center; gap:5px; }
.jg-trust i{ color:#2fae66; }

@media (max-width: 991.98px){
  .jg-auth-body{ height:auto; overflow:auto; }
  .jg-auth{ grid-template-columns:1fr; height:auto; min-height:100vh; }
  .jg-auth__brand{ padding:32px 24px; }
  .jg-auth__title{ font-size:1.55rem; }
  .jg-feature-list{ display:none; }         /* keep mobile login lean */
  .jg-auth__tagline{ margin-bottom:0; }
  .jg-auth__foot{ display:none; }
}

/* =====================================================================
   APP SHELL
   ===================================================================== */
.jg-shell{ display:flex; min-height:100vh; }

.jg-sidebar{
  width:var(--jg-sidebar-w); flex:0 0 var(--jg-sidebar-w);
  position:fixed; inset:0 auto 0 0; z-index:1040;
  display:flex; flex-direction:column;
  color:#c8d3e6;
  background:linear-gradient(180deg,var(--jg-navy-1) 0%,var(--jg-navy-2) 100%);
  border-right:1px solid rgba(255,255,255,.06);
  transition:transform .22s ease;
}
.jg-sidebar__brand{
  display:flex; align-items:center; gap:11px;
  padding:18px 20px; color:#fff; font-weight:800; letter-spacing:.02em;
  border-bottom:1px solid rgba(255,255,255,.07);
}
.jg-sidebar__brand img{ height:30px; width:auto; object-fit:contain; }
.jg-sidebar__brand .jg-logo-fallback{
  height:32px; width:32px; border-radius:9px; display:grid; place-items:center;
  background:rgba(255,255,255,.12); font-weight:800;
}

.jg-sidebar__scroll{ flex:1 1 auto; overflow-y:auto; padding:14px 12px 24px; }
.jg-navgroup + .jg-navgroup{ margin-top:18px; }
.jg-navgroup__label{
  font-size:.66rem; font-weight:700; letter-spacing:.12em;
  color:#6c82a6; padding:0 10px 8px;
}
.jg-nav{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.jg-nav a{
  display:flex; align-items:center; gap:11px;
  padding:9px 10px; border-radius:10px;
  color:#c1cde0; font-size:.9rem; font-weight:500;
  transition:background .12s ease,color .12s ease;
}
.jg-nav a:hover{ background:rgba(255,255,255,.06); color:#fff; text-decoration:none; }
.jg-nav a.active{
  background:linear-gradient(135deg,rgba(95,208,255,.22),rgba(0,86,179,.28));
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
}
.jg-nav .jg-nav-icon{
  height:28px; width:28px; flex:0 0 28px; border-radius:8px;
  display:grid; place-items:center; font-size:.82rem;
  background:rgba(255,255,255,.07); color:#aebfda;
}
.jg-nav a.active .jg-nav-icon{ background:rgba(255,255,255,.16); color:#fff; }
.jg-nav .jg-nav-badge{ margin-left:auto; }
.jg-nav .badge.bg-danger{ box-shadow:0 0 0 3px rgba(220,53,69,.18); }

.jg-sidebar__foot{
  padding:12px 18px; font-size:.7rem; color:#6c82a6;
  border-top:1px solid rgba(255,255,255,.07);
}

.jg-main{
  margin-left:var(--jg-sidebar-w); flex:1 1 auto; min-width:0;
  display:flex; flex-direction:column;
}
.jg-topbar{
  position:sticky; top:0; z-index:1030;
  display:flex; align-items:center; gap:16px;
  padding:14px 26px;
  background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(8px);
  border-bottom:1px solid var(--jg-border);
}
.jg-topbar .jg-page-title{ margin:0; font-size:1.05rem; font-weight:700; }
.jg-topbar .jg-crumb{ font-size:.78rem; color:var(--jg-muted); }

.jg-userchip{
  display:flex; align-items:center; gap:10px;
  border:1px solid var(--jg-border); border-radius:var(--jg-pill);
  padding:5px 6px 5px 12px; background:#fff; cursor:pointer;
}
.jg-userchip:hover{ border-color:var(--jg-border-strong); }
.jg-userchip__name{ font-size:.82rem; font-weight:600; line-height:1.1; }
.jg-userchip__role{ font-size:.68rem; color:var(--jg-muted); text-transform:capitalize; }
.jg-avatar{
  height:32px; width:32px; border-radius:50%;
  display:grid; place-items:center; font-size:.78rem; font-weight:700; color:#fff;
  background:var(--jg-grad-primary);
}

/* ---- notification bell ---- */
.jg-bell{
  position:relative; border:1px solid var(--jg-border); background:#fff;
  height:38px; width:38px; border-radius:10px; color:var(--jg-muted);
  display:grid; place-items:center; font-size:.95rem; cursor:pointer;
}
.jg-bell:hover{ border-color:var(--jg-border-strong); color:var(--jg-secondary); }
.jg-bell-badge{
  position:absolute; top:-5px; right:-5px; min-width:17px; height:17px; padding:0 4px;
  border-radius:9px; background:var(--jg-accent); color:#fff;
  font-size:.66rem; font-weight:700; line-height:17px; text-align:center;
  box-shadow:0 0 0 2px #fff;
}
.jg-notif-menu{ width:360px; max-width:92vw; padding:0; overflow:hidden; }
.jg-notif-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 14px; border-bottom:1px solid var(--jg-border);
  font-weight:600; font-size:.9rem;
}
.jg-notif-refresh{ color:var(--jg-muted); text-decoration:none; }
.jg-notif-list{ max-height:min(420px, 70vh); overflow-y:auto; }
.jg-notif-item{
  display:flex; gap:10px; padding:10px 14px; border-bottom:1px solid var(--jg-border);
  color:inherit; text-decoration:none;
}
.jg-notif-item:last-child{ border-bottom:0; }
.jg-notif-item:hover{ background:#f6f8fb; }
.jg-notif-item.unread{ background:rgba(0,86,179,.05); }
.jg-notif-ico{
  height:30px; width:30px; flex:0 0 30px; border-radius:8px;
  display:grid; place-items:center; font-size:.8rem;
  background:#eef2f8; color:var(--jg-primary);
}
.jg-notif-item.level-danger  .jg-notif-ico{ background:#fdecec; color:#dc3545; }
.jg-notif-item.level-warning .jg-notif-ico{ background:#fff6e6; color:#b8860b; }
.jg-notif-body{ min-width:0; display:block; }
.jg-notif-text{ font-size:.82rem; line-height:1.3; display:block; }
.jg-notif-time{ font-size:.7rem; color:var(--jg-muted); margin-top:2px; display:block; }
.jg-notif-empty{ padding:26px 14px; text-align:center; color:var(--jg-muted); font-size:.85rem; }

.jg-content{ padding:26px; max-width:1320px; width:100%; }
.jg-content > .jg-page-head{ margin-bottom:20px; }
.jg-page-head h1{ font-size:1.35rem; margin:0 0 4px; }
.jg-page-head p{ color:var(--jg-muted); font-size:.88rem; margin:0; }

/* =====================================================================
   Cards / stats / tables
   ===================================================================== */
.card{
  border:1px solid var(--jg-border);
  border-radius:var(--jg-radius);
  box-shadow:var(--jg-shadow-sm);
}
.card-header{
  background:#fff; border-bottom:1px solid var(--jg-border);
  font-weight:700; padding:14px 18px;
  border-radius:var(--jg-radius) var(--jg-radius) 0 0;
}
.card-body{ padding:18px; }
.list-group-item{ border-color:var(--jg-border); padding:12px 18px; }

.jg-stat-card{ position:relative; overflow:hidden; }
.jg-stat-card .card-body{ display:flex; align-items:center; gap:14px; }
.jg-stat-icon{
  height:44px; width:44px; flex:0 0 44px; border-radius:12px;
  display:grid; place-items:center; font-size:1.05rem;
  background:var(--jg-primary-050); color:var(--jg-primary);
}
.jg-stat-icon.is-info{ background:#e7f6fb; color:#0d7ea3; }
.jg-stat-icon.is-success{ background:#e7f7ee; color:#1e874b; }
.jg-stat-icon.is-danger{ background:#fdecec; color:var(--jg-accent); }
.jg-stat-icon.is-warning{ background:#fdf3e2; color:#b26a00; }
.jg-stat-value{ font-size:1.6rem; font-weight:800; line-height:1; letter-spacing:-.02em; }
.jg-stat-label{ font-size:.76rem; text-transform:uppercase; letter-spacing:.05em; color:var(--jg-muted); margin-top:3px; }

.table{ margin:0; color:var(--jg-ink); }
.table > :not(caption) > * > *{ padding:.8rem 1rem; }
.table thead th{
  background:#f7f9fc; color:var(--jg-ink-soft);
  font-size:.74rem; text-transform:uppercase; letter-spacing:.04em;
  border-bottom:1px solid var(--jg-border); font-weight:700;
}
.table-hover tbody tr:hover{ background:#f6f9ff; }
.table td, .table th{ border-color:var(--jg-border); vertical-align:middle; }
.jg-table-card{ border-radius:var(--jg-radius); overflow:hidden; }

.badge{ font-weight:600; padding:.4em .6em; border-radius:7px; }
.badge.bg-secondary{ background:#eef1f6 !important; color:#5a6473 !important; }

/* =====================================================================
   Sub-tabs / toolbar / action links / row buttons
   ===================================================================== */
.jg-toolbar{ display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-bottom:16px; }
.jg-toolbar .jg-toolbar-spacer{ flex:1 1 auto; }

.jg-subtabs{ border-bottom:1px solid var(--jg-border); gap:2px; }
.jg-subtabs .nav-link{
  color:var(--jg-ink-soft); font-weight:600; font-size:.88rem;
  border:0; border-bottom:2px solid transparent; padding:.6rem .9rem;
}
.jg-subtabs .nav-link:hover{ color:var(--jg-ink); border-bottom-color:var(--jg-border-strong); }
.jg-subtabs .nav-link.active{ color:var(--jg-primary); border-bottom-color:var(--jg-primary); background:none; }

.jg-action-link{ display:inline-flex; align-items:center; gap:6px; font-size:.86rem; white-space:nowrap; }
.jg-action-link:hover{ text-decoration:underline; }
.jg-action-link.text-danger{ color:var(--jg-accent) !important; }

.jg-icon-btn{ color:var(--jg-muted); line-height:1; border:0; background:none; padding:.28rem .4rem; border-radius:7px; }
.jg-icon-btn:hover{ color:var(--jg-primary); background:var(--jg-primary-050); }
.jg-icon-btn.jg-danger:hover{ color:var(--jg-accent); background:#fdecec; }
td .jg-icon-btn + .jg-icon-btn{ margin-left:2px; }

.jg-muted-code{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.85em; color:var(--jg-ink-soft); }

/* ---------- Settings: image slots ---------- */
.jg-imgslot__preview{
  width:96px; height:96px; flex:0 0 96px;
  border:1px solid var(--jg-border); border-radius:var(--jg-radius-xs);
  background:#f4f7fb;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.jg-imgslot__preview img{ max-width:100%; max-height:100%; object-fit:contain; }
.jg-imgslot + .jg-imgslot{ border-top:1px solid var(--jg-border); padding-top:16px; }
.form-control-color{ width:44px; flex:0 0 44px; padding:.2rem; }

.card.rounded-0.rounded-bottom{ border-radius:0 0 var(--jg-radius) var(--jg-radius) !important; border-top:0; }

/* =====================================================================
   Timeline
   ===================================================================== */
.jg-timeline{ list-style:none; margin:0; padding:0; position:relative; }
.jg-timeline::before{ content:""; position:absolute; left:12px; top:6px; bottom:6px; width:2px; background:var(--jg-border-strong); }
.jg-timeline li{ position:relative; padding:0 0 20px 38px; }
.jg-timeline li::before{
  content:""; position:absolute; left:5px; top:2px; height:16px; width:16px;
  border-radius:50%; background:#fff; border:3px solid var(--jg-primary);
}
.jg-timeline li.done::before{ background:var(--jg-primary); }

/* =====================================================================
   Modals / SweetAlert
   ===================================================================== */
.modal-content{ border:0; border-radius:var(--jg-radius); box-shadow:var(--jg-shadow-lg); }
.modal-header{ border-bottom:1px solid var(--jg-border); padding:16px 20px; }
.modal-title{ font-size:1.05rem; }
.modal-body{ padding:20px; }
.modal-footer{ border-top:1px solid var(--jg-border); padding:14px 20px; }
.swal2-popup{ border-radius:var(--jg-radius) !important; max-height:calc(100vh - 2rem); overflow-y:auto; }
.swal2-html-container{ overflow-y:auto; max-height:62vh; }

/* --- Modal scrolling -------------------------------------------------
   Our modals wrap header/body/footer in a <form>, which sits between
   .modal-content and .modal-body and breaks Bootstrap's scrollable-modal
   flex chain (tall modals then overflow the viewport with no way to reach
   the buttons). Make that <form> the flex column so .modal-body scrolls.
   Every modal-dialog also carries .modal-dialog-scrollable so Bootstrap
   caps the dialog height in the first place. */
.modal-content > form{
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}
.modal-dialog-scrollable .modal-content{ overflow: hidden; }
.modal-dialog-scrollable .modal-content > form{
  max-height: 100%;
  overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form > .modal-body{
  overflow-y: auto;
  min-height: 0;
}
/* Safety net for any modal without the scrollable class: never let it grow
   past the viewport - let the whole dialog scroll instead. */
.modal-dialog:not(.modal-dialog-scrollable):not(.modal-fullscreen){
  max-height: calc(100% - 2 * var(--bs-modal-margin, 1.75rem));
  overflow-y: auto;
}

/* =====================================================================
   E-Tickets / Messages (chat)
   ===================================================================== */
.jg-tk-wrap{ align-items:stretch; }
.jg-tk-list{ max-height:calc(100vh - 260px); overflow-y:auto; }
.jg-tk-item{
  display:block; width:100%; text-align:left; border:0; background:none;
  padding:12px 14px; border-bottom:1px solid var(--jg-border); cursor:pointer;
}
.jg-tk-item:hover{ background:#f6f8fb; }
.jg-tk-item.active{ background:rgba(0,86,179,.07); box-shadow:inset 3px 0 0 var(--jg-primary); }
.jg-tk-dot{ height:9px; width:9px; border-radius:50%; background:var(--jg-accent); flex:0 0 9px; }
.jg-tk-dot.ghost{ background:transparent; }

.jg-tk-thread-card{ display:flex; flex-direction:column; min-height:460px; height:calc(100vh - 210px); }
.jg-tk-empty{ margin:auto; padding:40px 20px; }
.jg-tk-thead{
  display:flex; align-items:center; gap:6px; padding:12px 16px;
  border-bottom:1px solid var(--jg-border); flex:0 0 auto;
}
.jg-tk-thead .min-w-0{ min-width:0; }
.jg-tk-messages{
  flex:1 1 auto; overflow-y:auto; padding:18px 16px; background:#f4f7fb;
  display:flex; flex-direction:column; gap:10px;
}
.jg-tk-msg{ max-width:78%; align-self:flex-start; }
.jg-tk-msg.mine{ align-self:flex-end; }
.jg-tk-bubble{
  background:#fff; border:1px solid var(--jg-border); border-radius:14px 14px 14px 4px;
  padding:9px 12px; box-shadow:0 1px 2px rgba(16,42,80,.06);
}
.jg-tk-msg.mine .jg-tk-bubble{
  background:var(--jg-primary); color:#fff; border-color:var(--jg-primary);
  border-radius:14px 14px 4px 14px;
}
.jg-tk-text{ white-space:pre-wrap; word-break:break-word; font-size:.9rem; line-height:1.4; }
.jg-tk-meta{ font-size:.68rem; color:var(--jg-muted); margin-top:3px; padding:0 4px; }
.jg-tk-msg.mine .jg-tk-meta{ text-align:right; }
.jg-tk-atts{ display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.jg-tk-att-img img{ max-width:180px; max-height:180px; border-radius:8px; display:block; }
.jg-tk-att-file{
  display:inline-flex; align-items:center; gap:6px; max-width:220px;
  background:rgba(0,0,0,.05); border-radius:8px; padding:6px 10px; font-size:.8rem;
  color:inherit; text-decoration:none;
}
.jg-tk-msg.mine .jg-tk-att-file{ background:rgba(255,255,255,.18); color:#fff; }

.jg-tk-composer{ flex:0 0 auto; border-top:1px solid var(--jg-border); padding:10px 14px; background:#fff; }
.jg-tk-composer-row{ display:flex; align-items:flex-end; gap:8px; }
.jg-tk-composer textarea{ resize:none; max-height:140px; min-height:38px; }
.jg-tk-attach{ flex:0 0 auto; border:1px solid var(--jg-border); }
.jg-tk-files{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.jg-tk-files.d-none{ display:none; }
.jg-tk-chip{
  display:inline-flex; align-items:center; gap:6px; background:#eef2f8;
  border-radius:20px; padding:3px 6px 3px 10px; font-size:.75rem;
}
.jg-tk-chip button{ border:0; background:rgba(0,0,0,.12); border-radius:50%; width:16px; height:16px; line-height:14px; }

@media (max-width: 991.98px){
  .jg-tk-wrap #tkThreadCol{ display:none; }
  .jg-tk-wrap.jg-tk-thread-open #tkListCol{ display:none; }
  .jg-tk-wrap.jg-tk-thread-open #tkThreadCol{ display:block; }
  .jg-tk-thread-card{ height:calc(100vh - 190px); }
  .jg-tk-list{ max-height:calc(100vh - 230px); }
  .jg-tk-msg{ max-width:88%; }
}

/* =====================================================================
   Mobile
   ===================================================================== */
.jg-sidebar-backdrop{ position:fixed; inset:0; background:rgba(9,25,54,.45); z-index:1035; display:none; }
.jg-sidebar-backdrop.show{ display:block; }

@media (max-width: 991.98px){
  .jg-sidebar{ transform:translateX(-100%); }
  .jg-sidebar.open{ transform:translateX(0); box-shadow:var(--jg-shadow-lg); }
  .jg-main{ margin-left:0; }
  .jg-content{ padding:18px; }
  .jg-userchip__meta{ display:none; }
}
