/* =====================================================================
   PTT UI - shared design system for refactored pages (2026-10-04)
   Bootstrap 5.3 + Inter. Used by include/layout_top.php (new pages)
   and headerfooter/topheader.php (old pages, together with ptt-legacy.css)
   ===================================================================== */
:root {
  --ptt-navy-900: #0a1a33;
  --ptt-navy-800: #0f2747;
  --ptt-navy-700: #163563;
  --ptt-primary: #2f6bff;
  --ptt-primary-600: #1f56e0;
  --ptt-primary-50: #eef3ff;
  --ptt-accent: #ff5a5f;
  --ptt-success: #12b76a;
  --ptt-warning: #f79009;
  --ptt-danger: #f04438;
  --ptt-ink: #101828;
  --ptt-ink-2: #344054;
  --ptt-muted: #667085;
  --ptt-line: #e7eaf0;
  --ptt-bg: #f5f7fb;
  --ptt-card: #ffffff;
  --ptt-radius: 14px;
  --ptt-radius-sm: 10px;
  --ptt-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --ptt-shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --ptt-sidebar-w: 264px;

  --bs-primary: var(--ptt-primary);
  --bs-primary-rgb: 47, 107, 255;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-color: var(--ptt-ink);
  --bs-border-color: var(--ptt-line);
  --bs-link-color: var(--ptt-primary-600);
  --bs-link-color-rgb: 31, 86, 224;
}

html, body { height: 100%; }
body { background: var(--ptt-bg); font-size: .9rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }

/* ---------- App shell ---------- */
.ptt-app { display: flex; min-height: 100vh; }
.ptt-sidebar {
  width: var(--ptt-sidebar-w); flex: 0 0 var(--ptt-sidebar-w);
  background: radial-gradient(120% 60% at 0% 0%, #1b4280 0%, transparent 60%),
              linear-gradient(180deg, var(--ptt-navy-800) 0%, var(--ptt-navy-900) 100%);
  color: #c9d4e8; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; z-index: 1030;
}
.ptt-sidebar::-webkit-scrollbar { width: 6px; }
.ptt-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 6px; }
.ptt-brand { padding: 18px 18px 14px; }
.ptt-brand a { display: flex; align-items: center; background: #fff; border-radius: 12px; padding: 8px 12px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.ptt-brand img { max-height: 34px; max-width: 100%; }
.ptt-brand .ptt-brand-text { color: var(--ptt-navy-800); font-weight: 700; }
.ptt-nav { padding: 6px 12px 18px; flex: 1; }
.ptt-nav-label { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #7f93b5; padding: 14px 10px 6px; }
.ptt-nav-link {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent;
  color: #c9d4e8; padding: 9px 10px; border-radius: 10px; font-weight: 500; text-align: left; transition: background .15s, color .15s;
}
.ptt-nav-link i.lead-icon { font-size: 1.05rem; width: 22px; text-align: center; opacity: .9; }
.ptt-nav-link .chev { margin-left: auto; font-size: .75rem; transition: transform .2s; opacity: .7; }
.ptt-nav-link[aria-expanded="true"] .chev { transform: rotate(90deg); }
.ptt-nav-link:hover, .ptt-nav-link:focus-visible { background: rgba(255,255,255,.07); color: #fff; }
.ptt-nav-link.active { background: linear-gradient(90deg, rgba(47,107,255,.35), rgba(47,107,255,.12)); color: #fff; box-shadow: inset 3px 0 0 #7aa2ff; }
.ptt-subnav { list-style: none; margin: 2px 0 6px; padding: 0 0 0 32px; border-left: 1px dashed rgba(255,255,255,.12); margin-left: 21px; }
.ptt-subnav a { display: block; color: #a8b8d4; padding: 6px 10px; border-radius: 8px; font-size: .85rem; }
.ptt-subnav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.ptt-subnav a.active { color: #fff; font-weight: 600; background: rgba(47,107,255,.25); }
.ptt-sidebar-foot { padding: 14px 18px; font-size: .75rem; color: #7f93b5; border-top: 1px solid rgba(255,255,255,.08); }

.ptt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ptt-topbar {
  position: sticky; top: 0; z-index: 1020; height: 64px; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--ptt-line);
}
.ptt-topbar .crumb { color: var(--ptt-muted); font-size: .85rem; }
.ptt-topbar .crumb strong { color: var(--ptt-ink); font-weight: 600; }
.ptt-sidebar, .ptt-sidebar *, .ptt-topbar, .ptt-topbar *, .ptt-backdrop { box-sizing: border-box; }
.ptt-sidebar ul { margin-top: 0; }
.ptt-nav-link, .ptt-user, .ptt-iconbtn, .ptt-search input { font: inherit; }
.ptt-topbar .crumb { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.ptt-topbar .crumb-sep { font-size: .7rem; opacity: .7; }
.ptt-spacer { margin-left: auto; }
.ptt-iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--ptt-line); background: #fff; color: var(--ptt-ink-2); display: inline-grid; place-items: center; font-size: 1.25rem; cursor: pointer; padding: 0; }
.ptt-iconbtn:hover { background: var(--ptt-bg); }
.ptt-mobile-only { display: none; }
.ptt-collapse:not(.show) { display: none; }
.ptt-search { position: relative; width: min(340px, 40vw); margin: 0; }
.ptt-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ptt-muted); font-size: .9rem; pointer-events: none; }
.ptt-search input { display: block; width: 100%; height: 38px; padding: 0 14px 0 36px; border-radius: 999px; background: var(--ptt-bg); border: 1px solid transparent; color: var(--ptt-ink); font-size: .86rem; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.ptt-search input::placeholder { color: #9aa4b5; }
.ptt-search input:focus { background: #fff; border-color: var(--ptt-primary); box-shadow: 0 0 0 4px rgba(47,107,255,.12); }
.ptt-user { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--ptt-line); background: #fff; color: var(--ptt-ink); cursor: pointer; }
.ptt-user:hover { background: var(--ptt-bg); }
.ptt-user .avatar { width: 32px; height: 32px; font-size: .8rem; border-radius: 50%; }
.ptt-user-name { font-weight: 600; font-size: .86rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptt-user-chev { font-size: .7rem; color: var(--ptt-muted); }
.ptt-dd { position: relative; }
.ptt-dd-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; border-radius: 12px; box-shadow: var(--ptt-shadow-lg); border: 1px solid var(--ptt-line); padding: 6px; display: none; z-index: 1050; }
.ptt-dd.open .ptt-dd-menu { display: block; animation: pttFade .15s ease; }
.ptt-dd-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; border-bottom: 1px solid var(--ptt-line); margin-bottom: 6px; font-size: .86rem; }
.ptt-dd-head .avatar { width: 34px; height: 34px; font-size: .8rem; border-radius: 50%; }
.ptt-dd-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ptt-ink-2); font-size: .86rem; font-weight: 500; }
.ptt-dd-menu a:hover { background: var(--ptt-bg); color: var(--ptt-ink); }
.ptt-dd-menu a.danger { color: var(--ptt-danger); }
.ptt-dd-menu a.danger:hover { background: #fff1f0; }
@keyframes pttFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ptt-content { padding: 26px 28px 40px; flex: 1; }
.ptt-footer { padding: 16px 28px; color: var(--ptt-muted); font-size: .78rem; border-top: 1px solid var(--ptt-line); background: #fff; }

@media (max-width: 991.98px) {
  .ptt-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--ptt-shadow-lg); }
  .ptt-sidebar.show { transform: none; }
  .ptt-backdrop { position: fixed; inset: 0; background: rgba(10,26,51,.45); z-index: 1025; display: none; }
  .ptt-backdrop.show { display: block; }
  .ptt-topbar { padding: 0 14px; }
  .ptt-content { padding: 18px 14px 32px; }
  .ptt-search { width: auto; flex: 1; min-width: 0; }
  .ptt-mobile-only { display: inline-grid; }
  .ptt-topbar .crumb { display: none; }
  .ptt-spacer { display: none; }
}
@media (max-width: 575.98px) { .ptt-user-name, .ptt-user-chev { display: none; } .ptt-user { padding: 3px; } }

/* ---------- Page header ---------- */
.ptt-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.ptt-page-head h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.ptt-page-head p { color: var(--ptt-muted); margin: 4px 0 0; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary { background: linear-gradient(180deg, #3d77ff, var(--ptt-primary-600)); border: 0; box-shadow: 0 6px 16px rgba(47,107,255,.28); }
.btn-primary:hover { background: linear-gradient(180deg, #2f6bff, #1847c4); }
.btn-soft { background: var(--ptt-primary-50); color: var(--ptt-primary-600); border: 0; }
.btn-soft:hover { background: #dfe8ff; color: var(--ptt-primary-600); }
.btn-ghost { background: #fff; border: 1px solid var(--ptt-line); color: var(--ptt-ink-2); }
.btn-ghost:hover { background: var(--ptt-bg); color: var(--ptt-ink); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Cards ---------- */
.ptt-card { background: var(--ptt-card); border: 1px solid var(--ptt-line); border-radius: var(--ptt-radius); box-shadow: var(--ptt-shadow); }
.ptt-card + .ptt-card { margin-top: 18px; }
.ptt-card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.ptt-card-head .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--ptt-primary-50); color: var(--ptt-primary-600); font-size: 1.1rem; }
.ptt-card-head h2 { font-size: 1.02rem; font-weight: 700; margin: 0; }
.ptt-card-head p { font-size: .8rem; color: var(--ptt-muted); margin: 0; }
.ptt-card-body { padding: 18px 22px 22px; }

/* ---------- KPI tiles ---------- */
.ptt-kpi { padding: 18px 20px; display: flex; gap: 14px; align-items: center; height: 100%; }
.ptt-kpi .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex: 0 0 46px; }
.ptt-kpi .val { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.ptt-kpi .lbl { color: var(--ptt-muted); font-size: .8rem; }
.tone-blue  { background: #eef3ff; color: #1f56e0; }
.tone-green { background: #e7f8ef; color: #0e9f5a; }
.tone-amber { background: #fff4e5; color: #c46a00; }
.tone-rose  { background: #ffeceb; color: #d92d20; }
.tone-violet{ background: #f2efff; color: #6941c6; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .8rem; color: var(--ptt-ink-2); margin-bottom: 6px; }
.form-control, .form-select { border-radius: 10px; border-color: #d9dee8; padding: .55rem .8rem; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--ptt-primary); box-shadow: 0 0 0 4px rgba(47,107,255,.12); }
.form-control::placeholder { color: #9aa4b5; }
.form-text { color: var(--ptt-muted); font-size: .75rem; }
.required::after { content: " *"; color: var(--ptt-danger); }
.input-group > .form-select.ptt-isd { flex: 0 0 116px; max-width: 116px; }
.ptt-repeat-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ptt-repeat-row .input-group { flex: 1; }
.ptt-add-link { border: 1px dashed #c9d3e6; border-radius: 10px; padding: 8px 12px; width: 100%; background: #fafbff; color: var(--ptt-primary-600); font-weight: 600; font-size: .82rem; }
.ptt-add-link:hover { background: var(--ptt-primary-50); border-color: var(--ptt-primary); }
.ptt-sub-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ptt-muted); font-weight: 700; margin: 4px 0 10px; display: flex; align-items: center; gap: 8px; }
.ptt-sub-title .count { background: var(--ptt-bg); border: 1px solid var(--ptt-line); border-radius: 999px; padding: 0 8px; font-size: .7rem; color: var(--ptt-ink-2); }

/* ---------- Avatars / chips / pills ---------- */
.avatar { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 700; color: #fff; flex: 0 0 auto; letter-spacing: .02em; }
.avatar-xl { width: 72px; height: 72px; border-radius: 20px; font-size: 1.5rem; box-shadow: 0 10px 24px rgba(16,24,40,.18); }
.av-0 { background: linear-gradient(135deg,#2f6bff,#6a8dff); } .av-1 { background: linear-gradient(135deg,#7a5af8,#a48afb); }
.av-2 { background: linear-gradient(135deg,#12b76a,#4fd69c); } .av-3 { background: linear-gradient(135deg,#f79009,#fdb022); }
.av-4 { background: linear-gradient(135deg,#ee46bc,#f670c7); } .av-5 { background: linear-gradient(135deg,#0ba5ec,#53b1fd); }
.av-6 { background: linear-gradient(135deg,#ff5a5f,#ff8a80); } .av-7 { background: linear-gradient(135deg,#15b79e,#5fe9d0); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--ptt-bg); color: var(--ptt-ink-2); border: 1px solid var(--ptt-line); white-space: nowrap; }
.chip-code { background: #0f2747; color: #fff; border-color: #0f2747; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: #e7f8ef; color: #0e9f5a; } .pill-warn { background: #fff4e5; color: #c46a00; } .pill-bad { background: #ffeceb; color: #d92d20; } .pill-muted { background: var(--ptt-bg); color: var(--ptt-muted); }

/* ---------- Hero (profile header) ---------- */
.ptt-hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 24px 26px; color: #fff; margin-bottom: 22px;
  background: radial-gradient(90% 140% at 100% 0%, rgba(122,162,255,.55) 0%, transparent 55%),
              radial-gradient(60% 120% at 0% 100%, rgba(255,90,95,.30) 0%, transparent 60%),
              linear-gradient(120deg, #0f2747 0%, #163563 55%, #1f4b8f 100%);
  box-shadow: var(--ptt-shadow-lg);
}
.ptt-hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255,255,255,.05); }
.ptt-hero h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.ptt-hero .sub { color: #c9d6f2; margin-top: 2px; }
.ptt-hero .chip { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.18); }
.ptt-hero .chip-code { background: #fff; color: #0f2747; border-color: #fff; }
.ptt-hero .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.22); }
.ptt-hero .btn-ghost:hover { background: rgba(255,255,255,.2); }
.ptt-hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.ptt-hero-stat { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px 14px; min-width: 130px; }
.ptt-hero-stat .v { font-weight: 700; font-size: 1.05rem; }
.ptt-hero-stat .l { font-size: .72rem; color: #c9d6f2; text-transform: uppercase; letter-spacing: .06em; }
.ptt-check { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); }
.ptt-check.ok i { color: #6ce9a6; } .ptt-check.no i { color: #fda29b; }

/* ---------- Section nav (form) ---------- */
.ptt-steps { position: sticky; top: 84px; }
.ptt-steps a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ptt-ink-2); font-weight: 600; font-size: .86rem; }
.ptt-steps a i { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #fff; border: 1px solid var(--ptt-line); color: var(--ptt-muted); }
.ptt-steps a:hover, .ptt-steps a.active { background: #fff; box-shadow: var(--ptt-shadow); color: var(--ptt-ink); }
.ptt-steps a.active i { background: var(--ptt-primary); border-color: var(--ptt-primary); color: #fff; }
.ptt-steps .err-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--ptt-danger); }
section.ptt-card { scroll-margin-top: 84px; }

/* ---------- Sticky action bar ---------- */
.ptt-actionbar {
  position: sticky; bottom: 0; z-index: 1010; margin: 22px -28px -40px; padding: 14px 28px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-top: 1px solid var(--ptt-line);
  display: flex; align-items: center; gap: 12px; justify-content: flex-end;
}
@media (max-width: 991.98px) { .ptt-actionbar { margin: 18px -14px -32px; padding: 12px 14px; } }

/* ---------- Tables ---------- */
.ptt-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--ptt-line); }
.ptt-tabs { display: flex; gap: 4px; background: var(--ptt-bg); padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.ptt-tabs a { padding: 6px 12px; border-radius: 9px; color: var(--ptt-muted); font-weight: 600; font-size: .82rem; }
.ptt-tabs a.active { background: #fff; color: var(--ptt-ink); box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.ptt-tabs a .n { margin-left: 4px; font-size: .72rem; color: var(--ptt-muted); }
.ptt-table { margin: 0; }
.ptt-table thead th { background: #fafbfd; color: var(--ptt-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; border-bottom: 1px solid var(--ptt-line); padding: 12px 14px; white-space: nowrap; }
.ptt-table tbody td { padding: 14px; border-color: #f0f2f6; vertical-align: middle; }
.ptt-table tbody tr { transition: background .12s; }
.ptt-table tbody tr:hover { background: #f8faff; }
.ptt-table .name { font-weight: 600; color: var(--ptt-ink); }
.ptt-table .muted { color: var(--ptt-muted); font-size: .8rem; }
.ptt-contact { display: flex; align-items: center; gap: 6px; color: var(--ptt-ink-2); font-size: .82rem; white-space: nowrap; }
.ptt-contact i { color: var(--ptt-muted); }
.ptt-empty { padding: 56px 20px; text-align: center; color: var(--ptt-muted); }
.ptt-empty i { font-size: 2.4rem; color: #c3cbd9; display: block; margin-bottom: 8px; }
.pagination .page-link { border-radius: 9px !important; margin: 0 2px; border: 0; color: var(--ptt-ink-2); font-weight: 600; }
.pagination .active > .page-link { background: var(--ptt-primary); }

/* ---------- Alerts / toasts ---------- */
.alert { border-radius: 12px; border: 0; }
.alert-danger { background: #fff1f0; color: #b42318; }
.alert-success { background: #ecfdf3; color: #067647; }
.ptt-toast-wrap { position: fixed; top: 76px; right: 24px; z-index: 1090; }
.ptt-toast-wrap .toast { border: 0; border-radius: 12px; box-shadow: var(--ptt-shadow-lg); }

/* ---------- Login ---------- */
.ptt-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.ptt-login-art {
  position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(70% 60% at 85% 10%, rgba(122,162,255,.55), transparent 60%),
              radial-gradient(60% 50% at 10% 90%, rgba(255,90,95,.35), transparent 60%),
              linear-gradient(140deg, #0a1a33, #163563 60%, #1f4b8f);
}
.ptt-login-art h2 { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; max-width: 440px; }
.ptt-login-art p { color: #c9d6f2; max-width: 420px; }
.ptt-login-art .plane { position: absolute; right: -40px; top: 34%; font-size: 15rem; opacity: .07; transform: rotate(-20deg); }
.ptt-login-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.ptt-login-form .box { width: min(400px, 100%); }
.ptt-login-form .logo { max-height: 52px; margin-bottom: 28px; }
@media (max-width: 991.98px) { .ptt-login { grid-template-columns: 1fr; } .ptt-login-art { display: none; } }
/* Sign-in on the old pages: covers the old frame */
.ptt-login-overlay { position: fixed; inset: 0; z-index: 3000; overflow: auto; background: #fff; font-family: var(--bs-body-font-family); text-align: left; }
.ptt-login-overlay .ptt-login { min-height: 100%; }
/* Show / hide password button */
.ptt-eye-btn { border: 1px solid #d9dee8; border-left: 0; background: #fff; color: var(--ptt-muted); border-radius: 0 10px 10px 0 !important; padding: 0 14px; box-shadow: none !important; }
.ptt-eye-btn:hover, .ptt-eye-btn:focus-visible { color: var(--ptt-primary-600); background: var(--ptt-primary-50); }
.input-group .form-control:focus + .ptt-eye-btn { border-color: var(--ptt-primary); }

/* ---------- Dashboard (index.php) ---------- */
:root { --dash-s1: #2a78d6; --dash-s2: #eb6834; }
.min-w-0 { min-width: 0; }
.dash-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dash-filter .input-group { width: auto; flex-wrap: nowrap; }
.dash-filter .input-group-text { background: #fff; color: var(--ptt-muted); }
.dash-filter .form-select, .dash-filter .form-control { min-width: 150px; }
a.dash-kpi { color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
a.dash-kpi:hover { transform: translateY(-2px); box-shadow: var(--ptt-shadow-lg); color: inherit; }
.ptt-kpi .sub { font-size: .74rem; color: var(--ptt-muted); margin-top: 2px; }
.dash-kpis .ptt-kpi { padding: 16px; gap: 12px; }
.dash-kpis .ptt-kpi .ico { width: 42px; height: 42px; flex-basis: 42px; font-size: 1.15rem; }
.dash-kpis .ptt-kpi .val { font-size: 1.45rem; }
.dash-kpis .ptt-kpi .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1700px) { .dash-kpi-col { flex: 0 0 auto; width: 16.6667%; } }
.dash-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash-chart { position: relative; height: 250px; }
.dash-chart-tall { height: 270px; }
.dash-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--ptt-ink-2); margin-bottom: 8px; }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dash-table-toggle { margin-top: 10px; font-size: .8rem; }
.dash-table-toggle summary { color: var(--ptt-primary-600); cursor: pointer; font-weight: 600; width: fit-content; }
.dash-table-toggle table { margin-top: 8px; }
.dash-scroll { max-height: 440px; overflow: auto; margin: 0 -22px -22px; border-top: 1px solid var(--ptt-line); }
.dash-scroll .ptt-table thead th { position: sticky; top: 0; z-index: 1; }
.dash-scroll .ptt-table td:first-child, .dash-scroll .ptt-table th:first-child { padding-left: 22px; }
.dash-scroll .ptt-table td:last-child, .dash-scroll .ptt-table th:last-child { padding-right: 22px; }
.dash-table tbody td { padding: 10px 12px; }
.dash-table tbody tr[data-href] { cursor: pointer; }
.dash-find { width: 200px; }
.dash-find input { height: 34px; }
.dash-find.wide { width: 280px; }
.kit-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dash-maxw { max-width: 240px; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f2f6; }
.dash-list li:last-child { border-bottom: 0; }
@media (max-width: 767.98px) {
  .dash-filter { width: 100%; }
  .dash-filter .input-group { flex: 1 1 160px; }
  .dash-find, .dash-find.wide { width: 100%; order: 3; }
  .kit-search { width: 100%; }
  .kit-search .dash-find { flex: 1 1 100%; }
  .ptt-card-head { flex-wrap: wrap; }
  .ptt-card-head > div:not(.ptt-search) { flex: 1 1 0; min-width: 0; }
  .dash-kpis .ptt-kpi { padding: 14px; }
  .dash-kpis .ptt-kpi .ico { display: none; }
  .dash-kpis .ptt-kpi .lbl { white-space: normal; line-height: 1.25; }
  .dash-scroll { max-height: 380px; }
  .dash-maxw { max-width: 160px; }
}

/* ---------- My profile (updateprofile.php) ---------- */
.profile-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: .88rem; }
.profile-dl dt { color: var(--ptt-muted); font-weight: 500; }
.profile-dl dd { margin: 0; font-weight: 600; text-align: right; }
.pw-meter { height: 4px; border-radius: 4px; background: var(--ptt-line); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .2s ease, background .2s ease; }
.pw-meter .lv1 { background: var(--ptt-danger); } .pw-meter .lv2 { background: var(--ptt-warning); }
.pw-meter .lv3 { background: #66c61c; } .pw-meter .lv4 { background: var(--ptt-success); }
.input-group .form-control.is-invalid + .ptt-eye-btn { border-color: var(--ptt-danger); }

/* ---------- Menu & roles (menu.php) ---------- */
.acl-roles .list-group-item { border: 0; border-radius: 10px !important; margin-bottom: 4px; padding: 10px; }
.acl-roles .list-group-item.active { background: var(--ptt-primary-50); color: var(--ptt-ink); box-shadow: inset 3px 0 0 var(--ptt-primary); }
.acl-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acl-group { border: 1px solid var(--ptt-line); border-radius: 12px; padding: 0; margin: 0; min-width: 0; }
.acl-group legend { float: none; width: 100%; font-size: .9rem; font-weight: 700; padding: 10px 12px; margin: 0; background: #fafbfd; border-bottom: 1px solid var(--ptt-line); border-radius: 12px 12px 0 0; }
.acl-group legend .acl-count { margin-left: auto; font-weight: 500; font-size: .75rem; }
.acl-items { padding: 6px; }
.acl-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: .86rem; margin: 0; }
.acl-item:hover { background: var(--ptt-bg); }
.acl-item .form-check-input { margin: 0; flex: 0 0 auto; }
.acl-item > .min-w-0 { flex: 1; }
.acl-badge { font-size: .68rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.acl-badge:empty { display: none; }
.acl-badge.plus { background: #e7f8ef; color: #0e9f5a; }
.acl-badge.minus { background: #ffeceb; color: #d92d20; }
.acl-badge.role { background: var(--ptt-bg); color: var(--ptt-muted); }
.acl-legend { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.acl-item-row { display: flex; align-items: center; gap: 8px; padding: 8px 18px; }
.acl-item-row .form-control, .acl-item-row .form-select { height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: .86rem; }
.acl-item-row > .form-control:nth-of-type(1) { flex: 1 1 35%; }
.acl-item-row > .form-control:nth-of-type(2) { flex: 1 1 35%; }
.acl-item-row > .form-select { flex: 0 0 170px; }
.acl-item-row .btn { white-space: nowrap; flex: 0 0 auto; }
.acl-item-top { padding: 14px 18px; border-bottom: 1px solid var(--ptt-line); }
.acl-item-top .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--ptt-primary-50); color: var(--ptt-primary-600); flex: 0 0 36px; }
.acl-subs { padding: 6px 0 10px 28px; }
.acl-item-new { opacity: .75; } .acl-item-new:focus-within { opacity: 1; }
@media (max-width: 767.98px) {
  .acl-item-row { flex-wrap: wrap; padding: 8px 12px; }
  .acl-item-row > .form-control, .acl-item-row > .form-select { flex: 1 1 100% !important; }
  .acl-subs { padding-left: 8px; }
  .acl-tree { grid-template-columns: 1fr; }
}

/* ---------- Company info ---------- */
.ci-logo { background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 10px 24px rgba(16,24,40,.18); display: inline-flex; align-items: center; }
.ci-logo img { max-height: 52px; max-width: 220px; }
.ci-preview { min-height: 90px; border: 1px dashed #d5dbe6; border-radius: 12px; display: grid; place-items: center; padding: 12px; background:
  repeating-conic-gradient(#f4f6fa 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.ci-preview img { max-width: 100%; max-height: 120px; }

/* ---------- Menu items: drag & drop order ---------- */
.acl-sort-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--ptt-primary-50); color: var(--ptt-ink-2); font-size: .85rem; }
.acl-sort-hint.warn { background: #fff4e5; color: #8a4b00; }
.acl-sort-status { font-weight: 600; font-size: .8rem; }
.acl-sort-status.ok { color: #0e9f5a; } .acl-sort-status.bad { color: var(--ptt-danger); }
.acl-handle { cursor: grab; color: #98a2b3; display: inline-grid; place-items: center; width: 22px; height: 32px; border-radius: 6px; flex: 0 0 22px; touch-action: none; }
.acl-handle:hover { color: var(--ptt-primary-600); background: var(--ptt-primary-50); }
.acl-handle:active { cursor: grabbing; }
.acl-top { margin-bottom: 18px; } .ptt-card.acl-top + .ptt-card.acl-top { margin-top: 0; }
.acl-sublist { min-height: 10px; }
.acl-ghost { opacity: .35; background: var(--ptt-primary-50) !important; }
.acl-chosen { box-shadow: var(--ptt-shadow-lg); background: #fff; border-radius: 10px; }
body.acl-dragging, body.acl-dragging * { user-select: none !important; -webkit-user-select: none !important; cursor: grabbing !important; }
.sortable-fallback { opacity: .9 !important; box-shadow: var(--ptt-shadow-lg); }
.acl-sort-hint > span:not(.acl-sort-status) { flex: 1 1 320px; }
.form-control[readonly] { background: var(--ptt-bg); color: var(--ptt-muted); }
.d-flex.flex-column > .ptt-card + .ptt-card { margin-top: 0; }
.ptt-table code { color: var(--ptt-ink-2); font-size: .82rem; }
