﻿:root {
  --navy-950: #0f2043;
  --navy-900: #142a56;
  --navy-800: #1d3d7a;
  --navy-700: #29539e;
  --blue-600: #2463eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --bg-outer: #dbe6f8;
  --surface: #ffffff;
  --surface-soft: #f5f8ff;
  --border: #e1eaf7;
  --border-strong: #cddbf0;
  --text: #13254b;
  --text-muted: #5d7193;
  --text-light: #899bb8;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-shell: 0 16px 44px rgba(19, 40, 82, 0.12);
  --shadow-card: 0 6px 22px rgba(28, 54, 109, 0.06);
  --shadow-btn: 0 6px 16px rgba(36, 99, 235, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: radial-gradient(circle at 12% 10%, #edf4ff 0%, transparent 45%),
              radial-gradient(circle at 92% 85%, #d6e4fb 0%, transparent 50%),
              linear-gradient(135deg, #d7e3f7 0%, #eaf1fd 100%);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell Layout ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 12px;
  min-height: 100vh;
  padding: 10px;
  transition: grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-shell.collapsed { grid-template-columns: 82px minmax(0, 1fr); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 10px;
  height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: radial-gradient(ellipse at 15% 88%, rgba(77, 130, 224, 0.38) 0%, transparent 52%),
              linear-gradient(175deg, #132852 0%, #1c3b75 52%, #28519c 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 45px rgba(15, 32, 67, 0.26);
  color: #f0f6ff;
  padding: 18px 13px 0;
  overflow: visible;
  z-index: 30;
}

.sb-top { flex: 0 0 auto; }
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 10px;
}
.sb-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  filter: drop-shadow(0 2px 8px rgba(147, 197, 253, 0.4));
}
.sb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
}
.sb-brand-text b { font-size: 18px; font-weight: 800; letter-spacing: 0.4px; }
.sb-brand-text small { font-size: 11px; font-weight: 500; color: #c7dcff; letter-spacing: 0.1px; }

.sb-admin-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 4px 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.sb-admin-badge .crown { color: #fbbf24; font-size: 14px; }

.sb-pt-box {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 2px 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.sb-pt-box img { width: 24px; height: 24px; object-fit: contain; flex: 0 0 24px; }
.sb-pt-select {
  width: 100%;
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.sb-pt-select option { color: var(--text); background: #ffffff; }
.sb-pt-name {
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

.sb-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.sb-nav::-webkit-scrollbar { display: none; }

.nav-item, .nav-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 11px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #d9e7ff;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}
.nav-item svg, .nav-parent svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.9; }
.nav-item:hover, .nav-parent:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.nav-item.on {
  background: linear-gradient(135deg, #4b9bff 0%, #2463eb 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(36, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.nav-parent .chev { margin-left: auto; width: 15px; height: 15px; transition: transform 0.2s ease; }
.nav-parent.open .chev { transform: rotate(180deg); }

.nav-sub-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 3px 16px;
}
.nav-sub-list[hidden] { display: none; }
.nav-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #c6dafc;
  font-size: 12.2px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav-sub::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
  flex: 0 0 5px;
}
.nav-sub:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.nav-sub.on {
  background: linear-gradient(135deg, #54a2ff 0%, #2d6ce8 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 5px 14px rgba(36, 99, 235, 0.35);
}
.nav-sub.on::before { opacity: 1; background: #ffffff; }

.sb-art {
  flex: 0 0 auto;
  position: relative;
  margin: auto -13px 0;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  pointer-events: none;
  padding-top: 6px;
  background: transparent;
  z-index: 4;
}
.sb-typist {
  width: 282px;
  max-width: none;
  flex: 0 0 auto;
  margin-left: 0;
  margin-right: -28px;
  aspect-ratio: 1.5;
  background: url('/oss-typing.png') 0 0 / 200% 200% no-repeat;
  border-bottom-left-radius: 21px;
  filter: drop-shadow(0 10px 18px rgba(10, 24, 54, 0.28));
  animation: typing 1.05s steps(1, end) infinite;
}
.sb-cloud {
  width: 120px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 14px 20px rgba(8, 19, 44, 0.45));
  animation: floatSlow 5s ease-in-out infinite;
}
@media (max-height: 780px) {
  .sb-typist { width: 268px; margin-right: -14px; }
  .sb-cloud { width: 96px; margin: 0 auto 6px; }
}
@media (max-height: 620px) {
  .sb-typist { width: 236px; margin-right: 0; }
}
@keyframes typing {
  0%, 88%, 100% { background-position: 0 0; }
  22%, 66% { background-position: 100% 0; }
  44% { background-position: 0 100%; }
  78% { background-position: 100% 100%; }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.app-shell.collapsed .sb-brand-text,
.app-shell.collapsed .sb-admin-badge,
.app-shell.collapsed .sb-pt-box,
.app-shell.collapsed .nav-label,
.app-shell.collapsed .chev,
.app-shell.collapsed .nav-sub-list,
.app-shell.collapsed .sb-art { display: none !important; }
.app-shell.collapsed .sb-brand { justify-content: center; padding: 6px 0 14px; }
.app-shell.collapsed .nav-item,
.app-shell.collapsed .nav-parent { justify-content: center; padding: 11px; }

.sb-backdrop { display: none; }

/* ---------- Workspace & Topbar ---------- */
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - 20px);
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, #f9fbff 0%, #edf3fe 60%, #f7f9ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-shell);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.tb-left { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.tb-left-slot { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; max-width: 440px; min-width: 0; }
.tb-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.icon-btn, .icon-btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #364e7a;
  transition: all 0.16s ease;
}
.icon-btn-sm { width: 30px; height: 30px; border-radius: 8px; border-color: transparent; background: #f1f5fc; }
.icon-btn:hover, .icon-btn-sm:hover { background: #eff5ff; border-color: #acc6ef; color: var(--blue-600); }

.tb-company-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 8px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 8px rgba(30, 58, 118, 0.05);
  max-width: 100%;
}
.tb-company-pill img { width: 26px; height: 26px; object-fit: contain; flex: 0 0 26px; }
.tb-pt-name { font-weight: 700; font-size: 13.5px; color: var(--text); white-space: nowrap; padding-right: 4px; }
.tb-company-pill select {
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  max-width: 280px;
  cursor: pointer;
}

.tb-search {
  position: relative;
  width: 100%;
  max-width: 360px;
}
.tb-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #7c91b3;
  pointer-events: none;
}
.tb-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #f8fbff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.tb-search input:focus {
  background: #ffffff;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.notif-wrap, .user-wrap { position: relative; }
.notif-btn { position: relative; border-radius: 999px; }
.notif-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  transition: all 0.16s ease;
}
.user-pill:hover { border-color: #a9c4ef; background: #f8fbff; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b9bff, #1e4ed8);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(36, 99, 235, 0.25);
}
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.user-meta strong { font-size: 13px; color: var(--text); }
.user-meta small { font-size: 11px; color: var(--text-muted); }

.popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(19, 40, 82, 0.16);
  padding: 8px;
  z-index: 40;
}
.notif-pop { width: min(350px, 90vw); padding: 12px; }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.pop-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  font-size: 13px;
}
.pop-item:hover { background: #f2f6ff; color: var(--blue-600); }
.pop-item.danger:hover { background: #fff1f2; color: #dc2626; }
.notif-list { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.notif-row { padding: 9px 10px; border-radius: 10px; background: #f7faff; border: 1px solid #e6eefb; font-size: 12.5px; }
.notif-row.unread { background: #edf4ff; border-color: #c5dcff; }
.notif-row strong { display: block; color: var(--text); margin-bottom: 2px; }
.notif-row small { color: var(--text-muted); }

/* ---------- Main Content ---------- */
.main-area {
  flex: 1 1 auto;
  padding: 20px 26px 34px;
  position: relative;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.breadcrumb a:hover { color: var(--blue-600); }
.breadcrumb strong { color: var(--text); font-weight: 600; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-title-wrap { display: flex; align-items: center; gap: 13px; }
.page-3d-icon { width: 42px; height: 42px; object-fit: contain; flex: 0 0 42px; filter: drop-shadow(0 4px 10px rgba(36, 99, 235, 0.16)); }
.page-title-wrap h1 {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 27px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--navy-950);
}
.page-title-wrap p { margin: 2px 0 0; font-size: 13.5px; color: var(--text-muted); }

.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #7c91b3;
  pointer-events: none;
}
.search-box input {
  width: 245px;
  padding: 9px 14px 9px 36px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.search-box input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.btn:hover { background: #f4f8ff; border-color: #acc6ef; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-primary {
  background: linear-gradient(135deg, #408cff 0%, #205cd8 100%);
  border-color: #205cd8;
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { background: linear-gradient(135deg, #5298ff 0%, #2463eb 100%); border-color: #2463eb; color: #ffffff; }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-excel { background: #effcf4; border-color: #bcebd0; color: #166534; }
.btn-excel:hover { background: #dcfce7; border-color: #86efac; }
.btn-pdf { background: #fff1f2; border-color: #fecdd3; color: #b91c1c; }
.btn-pdf:hover { background: #ffe4e6; border-color: #fda4af; }
.btn-icon { width: 38px; height: 38px; padding: 0; }

/* ---------- Hero Banner (Dashboard PT) ---------- */
.hero-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 142px;
  padding: 22px 28px;
  border-radius: 20px;
  background: linear-gradient(115deg, #e7f0ff 0%, #f1f6ff 55%, #e6f0ff 100%);
  border: 1px solid #ffffff;
  box-shadow: 0 8px 26px rgba(30, 58, 122, 0.08), inset 0 0 0 1px #d7e5fb;
  overflow: hidden;
  margin-bottom: 18px;
}
.hero-copy { position: relative; z-index: 2; max-width: 52%; }
.hero-copy h1 { margin: 0; font-size: clamp(24px, 2.7vw, 31px); font-weight: 800; letter-spacing: -0.6px; color: var(--navy-950); }
.hero-copy p { margin: 5px 0 0; font-size: 14.5px; color: #476088; font-weight: 500; }
.hero-art {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 52%;
  object-fit: cover;
  object-position: center 22%;
  mask-image: linear-gradient(to right, transparent 0%, #000 22%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%);
  pointer-events: none;
}

/* ---------- Metric Cards ---------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metrics-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metrics-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }

.metric-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(29, 56, 112, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  cursor: pointer;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(29, 56, 112, 0.11); }
.metric-card img.m-ico {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 46px;
  filter: drop-shadow(0 4px 8px rgba(15, 32, 67, 0.12));
}
.metric-card .m-info { min-width: 0; }
.metric-card .m-label { display: block; font-size: 12px; font-weight: 600; color: #394d72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card .m-val { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.6px; color: var(--navy-950); line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }

.metric-card.tone-blue { background: linear-gradient(135deg, #edf5ff 0%, #d9e9ff 100%); border-color: #c8defe; }
.metric-card.tone-purple { background: linear-gradient(135deg, #f3efff 0%, #e4dcff 100%); border-color: #d5c9fd; }
.metric-card.tone-green { background: linear-gradient(135deg, #eafcf3 0%, #cef5e1 100%); border-color: #b4ecd0; }
.metric-card.tone-yellow { background: linear-gradient(135deg, #fffbeb 0%, #fef0c2 100%); border-color: #fce08c; }
.metric-card.tone-orange { background: linear-gradient(135deg, #fff4ea 0%, #ffe2c8 100%); border-color: #fbcba0; }
.metric-card.tone-red { background: linear-gradient(135deg, #fff0f1 0%, #ffd8dd 100%); border-color: #fbbac3; }

/* Admin Large Metric Cards (Image 5) */
.metric-admin {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 122px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(29, 56, 112, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.metric-admin:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(29, 56, 112, 0.12); }
.metric-admin .ma-top { display: flex; align-items: center; gap: 9px; position: relative; z-index: 2; }
.metric-admin .ma-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue-600);
}
.metric-admin .ma-label { font-size: 13.5px; font-weight: 700; color: #2b3f66; }
.metric-admin .ma-val { position: relative; z-index: 2; font-size: 32px; font-weight: 800; letter-spacing: -0.8px; color: var(--navy-950); margin-top: 8px; font-variant-numeric: tabular-nums; }
.metric-admin .ma-art {
  position: absolute;
  right: 8px;
  bottom: 4px;
  width: 82px;
  height: 82px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(15, 32, 67, 0.14));
}

/* ---------- Cards & Tables ---------- */
.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}
.card + .card { margin-top: 16px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card-title { display: flex; align-items: center; gap: 9px; font-size: 16.5px; font-weight: 700; color: var(--navy-950); margin: 0; }
.card-title img { width: 24px; height: 24px; object-fit: contain; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #e7effb; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 13.5px;
}
table.data-table thead th {
  background: linear-gradient(180deg, #e5effd 0%, #d8e7fb 100%);
  color: #163060;
  font-weight: 700;
  font-size: 12.5px;
  text-align: left;
  padding: 11px 13px;
  white-space: nowrap;
  border-bottom: 1px solid #cadbf5;
}
table.data-table thead th.sortable { cursor: pointer; user-select: none; }
table.data-table thead th.sortable:hover { background: #d0e1fa; }
table.data-table tbody td {
  padding: 11px 13px;
  border-bottom: 1px solid #edf2fa;
  color: #203459;
  vertical-align: middle;
}
table.data-table tbody tr:last-child td { border-bottom: 0; }
table.data-table tbody tr:hover td { background: #f6f9ff; }

.tka-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy-950); }
.tka-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  flex: 0 0 30px;
  box-shadow: 0 2px 6px rgba(30, 58, 122, 0.16);
}
.pt-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy-950); }
.pt-cell img { width: 28px; height: 28px; object-fit: contain; flex: 0 0 28px; }

/* ---------- Badges & Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.pill-green { background: #dcfce7; color: #15803d; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-red { background: #fee2e2; color: #b91c1c; }
.pill-blue { background: #dbeafe; color: #1d4ed8; }
.pill-indigo { background: #e0e7ff; color: #3730a3; }
.pill-gray { background: #f1f5f9; color: #475569; }

.date-status { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.row-actions { display: inline-flex; align-items: center; gap: 4px; position: relative; }
.act-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #4f658b;
  display: inline-grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.act-icon:hover { background: #e9f1fe; color: var(--blue-600); }
.act-icon.danger:hover { background: #fee2e2; color: #dc2626; }

/* ---------- Pagination ---------- */
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.pg-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pg-select { padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border-strong); background: #ffffff; font-size: 12.5px; }
.pg-btns { display: flex; align-items: center; gap: 4px; }
.pg-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}
.pg-btn:hover:not(:disabled) { background: #eff5ff; border-color: #9ec0f3; }
.pg-btn.on { background: var(--blue-600); border-color: var(--blue-600); color: #ffffff; }
.pg-btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- Charts Row (Dashboard PT) ---------- */
.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px;
  margin-bottom: 18px;
}
.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.donut-svg { width: 170px; height: 170px; flex: 0 0 170px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; min-width: 150px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: #2b3f66; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }

.trend-box { position: relative; width: 100%; height: 184px; }
.trend-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--navy-950);
  color: #ffffff;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transform: translate(-50%, -115%);
  box-shadow: 0 6px 14px rgba(15, 32, 67, 0.25);
}

/* ---------- Reminder ITAS Split Layout ---------- */
.itas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.itas-layout.with-panel {
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
}
.itas-group {
  border: 1px solid #e3ecfa;
  border-radius: 13px;
  overflow: hidden;
  margin-bottom: 11px;
  background: #ffffff;
}
.itas-group:last-child { margin-bottom: 0; }
.grp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.grp-head .grp-title { display: flex; align-items: center; gap: 8px; }
.grp-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
}
.grp-red { background: #ffe9eb; color: #991b1b; }
.grp-red .grp-count { background: #dc2626; }
.grp-amber { background: #fef5da; color: #92400e; }
.grp-amber .grp-count { background: #d97706; }
.grp-blue { background: #e7f1ff; color: #1e40af; }
.grp-blue .grp-count { background: #2563eb; }
.grp-green { background: #e3f9ec; color: #166534; }
.grp-green .grp-count { background: #16a34a; }

.rem-section {
  padding: 13px;
  border-radius: 13px;
  background: #f8fbff;
  border: 1px solid #e4ecf8;
  margin-bottom: 12px;
}
.rem-section h3 { margin: 0 0 9px; font-size: 13.5px; font-weight: 700; color: var(--navy-950); display: flex; align-items: center; gap: 7px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid #d5e2f5;
  font-size: 12px;
  font-weight: 600;
  color: #263f6e;
}
.email-chip button {
  border: 0;
  background: transparent;
  padding: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
}
.email-chip button:hover { color: #dc2626; }

.email-add-row { display: flex; gap: 6px; }
.email-add-row input { flex: 1; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: #ffffff; font-size: 12.5px; outline: none; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: #293e66;
}
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}
.slider::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.switch input:checked + .slider { background: var(--blue-600); }
.switch input:checked + .slider::before { transform: translateX(17px); }

/* ---------- Dokumen Explorer (Image 3) ---------- */
.docs-explorer {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.tree-pane {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  box-shadow: var(--shadow-card);
  max-height: calc(100vh - 205px);
  overflow-y: auto;
}
.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.14s;
}
.tree-node:hover { background: #f2f7ff; }
.tree-node.on { background: #dbeafe; color: #1e40af; }
.tree-node img { width: 20px; height: 20px; object-fit: contain; flex: 0 0 20px; }
.tree-node .t-chev { width: 14px; height: 14px; color: #64748b; transition: transform 0.15s; flex: 0 0 14px; }
.tree-node.open .t-chev { transform: rotate(90deg); }
.tree-children { padding-left: 18px; display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }

.file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 800;
  color: #ffffff;
  flex: 0 0 30px;
  letter-spacing: 0.2px;
}
.fb-pdf { background: linear-gradient(135deg, #f87171, #dc2626); }
.fb-doc { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.fb-xls { background: linear-gradient(135deg, #34d399, #16a34a); }
.fb-img { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.fb-oth { background: linear-gradient(135deg, #94a3b8, #475569); }

.drop-zone {
  border: 2px dashed #adc7f0;
  background: #f4f8ff;
  border-radius: 14px;
  padding: 14px 18px;
  text-align: center;
  color: #48628b;
  font-size: 13px;
  margin-bottom: 14px;
  transition: all 0.18s ease;
}
.drop-zone.dragover { border-color: var(--blue-600); background: #e3eeff; color: var(--blue-600); }

/* ---------- Filter & Row Menus ---------- */
.rel { position: relative; }
.menu-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 195px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  box-shadow: 0 14px 32px rgba(19, 40, 82, 0.16);
  padding: 6px;
  z-index: 35;
}

/* ---------- Modal Dialog ---------- */
.modal-dlg {
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 0;
  width: min(560px, 94vw);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 32, 67, 0.28);
  color: var(--text);
}
.modal-dlg::backdrop { background: rgba(15, 32, 67, 0.45); backdrop-filter: blur(3px); }
.modal-form { display: flex; flex-direction: column; max-height: 88vh; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--navy-950); }
.modal-body { padding: 16px 20px; overflow-y: auto; display: grid; gap: 12px; }
.form-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 600; color: #364e7a; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fbfdff;
  font-size: 13.5px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  background: #ffffff;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.13);
}
.modal-err { margin: 0; padding: 0 20px; color: #dc2626; font-size: 12.5px; font-weight: 600; }
.modal-err:empty { display: none; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #f9fbff;
}

/* ---------- Toast & AI FAB/Drawer ---------- */
.toast-bar {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--navy-950);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(15, 32, 67, 0.3);
  z-index: 60;
}
.ai-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, #4b9bff 0%, #1e54d6 100%);
  color: #ffffff;
  font-size: 22px;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(36, 99, 235, 0.38);
  z-index: 45;
  transition: transform 0.18s ease;
}
.ai-fab:hover { transform: scale(1.06) rotate(8deg); }

.ai-drawer {
  position: fixed;
  right: 22px;
  bottom: 84px;
  width: min(370px, calc(100vw - 32px));
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 32, 67, 0.22);
  overflow: hidden;
  z-index: 46;
  display: flex;
  flex-direction: column;
}
.ai-drawer[hidden] { display: none; }
.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: linear-gradient(135deg, #162e5e, #254f9e);
  color: #ffffff;
}
.ai-head-title { display: flex; align-items: center; gap: 10px; }
.ai-head-title strong { display: block; font-size: 14px; }
.ai-head-title small { font-size: 11.5px; color: #c7dcff; }
.ai-spark { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: grid; place-items: center; }
.ai-msgs { padding: 12px 14px; max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; background: #f8fbff; }
.ai-bubble { padding: 9px 12px; border-radius: 12px; font-size: 13px; max-width: 88%; white-space: pre-wrap; }
.ai-bubble.user { align-self: flex-end; background: var(--blue-600); color: #ffffff; }
.ai-bubble.bot { align-self: flex-start; background: #ffffff; border: 1px solid var(--border); color: var(--text); }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; background: #ffffff; }
.chip-btn { padding: 4px 10px; border-radius: 999px; border: 1px solid #d4e2f7; background: #f3f7ff; font-size: 11.5px; color: #2451a1; font-weight: 600; }
.chip-btn:hover { background: #e3eeff; }
.ai-form { display: flex; gap: 7px; padding: 10px 12px; border-top: 1px solid var(--border); background: #ffffff; }
.ai-form input { flex: 1; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--border-strong); font-size: 13px; outline: none; }

.empty-state { text-align: center; padding: 36px 16px; color: var(--text-muted); font-size: 13.5px; }

/* ---------- AI Dokumen Panel & JSON Grid ---------- */
.ai-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: 14px;
  background: #f5f9ff;
  border: 1px solid #d5e3f8;
  margin-bottom: 16px;
}
.ai-banner.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ai-banner.err { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.ai-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ai-kv {
  padding: 9px 11px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #e2ebf8;
}
.ai-kv small { display: block; font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px; }
.ai-kv strong { display: block; font-size: 13.5px; color: var(--navy-950); margin-top: 2px; word-break: break-word; }

.tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #476088;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s ease;
}
.tab-btn:hover { background: #f2f7ff; color: var(--blue-600); }
.tab-btn.on {
  background: linear-gradient(135deg, #408cff 0%, #205cd8 100%);
  border-color: #205cd8;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(36, 99, 235, 0.25);
}
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(36, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}
.tab-btn.on .tab-badge { background: rgba(255, 255, 255, 0.24); color: #ffffff; }
.pilah-note { font-size: 12px; color: #92400e; background: #fef3c7; padding: 3px 8px; border-radius: 7px; display: inline-block; margin-top: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1220px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics-grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .itas-layout { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app-shell, .app-shell.collapsed { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .sidebar {
    position: fixed;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 260px;
    height: auto;
    transform: translateX(-130%);
    transition: transform 0.25s ease;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sb-typist { width: 268px; margin-right: -10px; }
  .sb-backdrop.on { display: block; position: fixed; inset: 0; background: rgba(15, 32, 67, 0.45); z-index: 25; }
  .workspace { border-radius: 0; min-height: 100vh; }
  .charts-grid, .docs-explorer, .metrics-grid.cols-4 { grid-template-columns: 1fr; }
  .hero-copy { max-width: 100%; }
  .hero-art { opacity: 0.28; width: 70%; }
}
@media (max-width: 640px) {
  .main-area { padding: 14px 14px 30px; }
  .topbar { padding: 10px 14px; }
  .metrics-grid, .metrics-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-2col { grid-template-columns: 1fr; }
  .search-box input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
