
/* ============================================================
   EHI DocSign — Design System v2
   Exeins Health Initiative | Research Signature Platform
   Colors: EHI Logo Palette · Royal Blue · Cyan · Gold
   Font: Plus Jakarta Sans
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────────────────
   TOAST NOTIFICATION SYSTEM
───────────────────────────────────────────────────────── */

#ehi-toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 40px);
}

.ehi-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: white;
  border-radius: 14px;
  padding: 14px 14px 10px 16px;
  box-shadow: 0 8px 32px rgba(13,50,100,.16), 0 2px 8px rgba(13,50,100,.08);
  border-left: 4px solid;
  pointer-events: all;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform .28s cubic-bezier(.34,1.4,.64,1), opacity .22s ease;
  position: relative;
  overflow: hidden;
}

.ehi-toast.ehi-toast-in {
  transform: translateX(0);
  opacity: 1;
}

@keyframes toastOut {
  to { transform: translateX(calc(100% + 24px)); opacity: 0; }
}

/* Type colors */
.ehi-toast-success { border-left-color: #0EA96D; }
.ehi-toast-error   { border-left-color: #E53535; }
.ehi-toast-warning { border-left-color: #D97706; }
.ehi-toast-info    { border-left-color: #1A8CE8; }

/* Icon */
.ehi-toast-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.ehi-toast-success .ehi-toast-icon { background: #E6F9F1; color: #0EA96D; }
.ehi-toast-error   .ehi-toast-icon { background: #FEF0F0; color: #E53535; }
.ehi-toast-warning .ehi-toast-icon { background: #FFF8EC; color: #D97706; }
.ehi-toast-info    .ehi-toast-icon { background: #EFF4FF; color: #1A8CE8; }

/* Body */
.ehi-toast-body {
  flex: 1;
  min-width: 0;
}

.ehi-toast-msg {
  font-size: 13px;
  font-weight: 600;
  color: #0D1F38;
  line-height: 1.45;
  display: block;
  padding-right: 8px;
}

/* Progress bar */
.ehi-toast-progress {
  height: 2px;
  background: #EEF3FA;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.ehi-toast-bar {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  transition: none;
}
.ehi-toast-success .ehi-toast-bar { background: #0EA96D; }
.ehi-toast-error   .ehi-toast-bar { background: #E53535; }
.ehi-toast-warning .ehi-toast-bar { background: #D97706; }
.ehi-toast-info    .ehi-toast-bar { background: #1A8CE8; }

/* Close button */
.ehi-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #8FA6C2;
  padding: 2px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.ehi-toast-close:hover { background: #EEF3FA; color: #0D1F38; }

/* Mobile: bottom center */
@media (max-width: 767px) {
  #ehi-toasts {
    top: auto;
    bottom: 74px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: unset;
  }
  .ehi-toast {
    transform: translateY(20px);
  }
  .ehi-toast.ehi-toast-in {
    transform: translateY(0);
  }
  @keyframes toastOut {
    to { transform: translateY(20px); opacity: 0; }
  }
}

/* ─────────────────────────────────────────────────────────
   BUTTON SPINNER
───────────────────────────────────────────────────────── */

.ehi-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: ehiSpin .65s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

/* Dark spinner variant (on light buttons) */
.ehi-spinner-dark {
  border-color: rgba(13,50,100,.2);
  border-top-color: #0F40A0;
}

@keyframes ehiSpin {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────
   SKELETON LOADING (shimmer)
───────────────────────────────────────────────────────── */

.skel {
  background: linear-gradient(90deg, #EEF3FA 0%, #E2ECF8 40%, #EEF3FA 80%);
  background-size: 300% 100%;
  animation: skelShimmer 1.6s ease infinite;
  border-radius: 8px;
  display: block;
}

.skel-h { height: 16px; }

@keyframes skelShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ─────────────────────────────────────────────────────────
   ACTION BANNER (dashboard — dokumen perlu perhatian)
───────────────────────────────────────────────────────── */

.action-banner {
  background: linear-gradient(135deg, #082266 0%, #1057C0 100%);
  border-radius: var(--r-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(8,34,102,.25);
  flex-wrap: wrap;
}

.ab-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(245,168,35,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.ab-body { flex: 1; min-width: 0; }

.ab-title {
  font-size: 15px;
  font-weight: 800;
  color: white;
  margin-bottom: 3px;
}

.ab-sub {
  font-size: 12px;
  color: rgba(255,255,255,.65);
}

.ab-btn {
  background: var(--brand-gold);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(245,168,35,.35);
  transition: transform .15s, box-shadow .15s;
}
.ab-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(245,168,35,.45);
}

/* Success variant (semua selesai) */
.action-banner.ab-clean {
  background: linear-gradient(135deg, #065F46 0%, #059669 100%);
  box-shadow: 0 4px 20px rgba(6,95,70,.2);
}
.action-banner.ab-clean .ab-icon {
  background: rgba(255,255,255,.15);
}
.action-banner.ab-clean .ab-btn {
  background: rgba(255,255,255,.2);
  box-shadow: none;
}

/* ─────────────────────────────────────────────────────────
   RECENT DOCS SECTION (dashboard)
───────────────────────────────────────────────────────── */

.recent-doc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
  border-radius: 8px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}
.recent-doc-row:last-child { border-bottom: none; }
.recent-doc-row:hover { background: #F4F8FF; }

.recent-doc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #EFF4FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.recent-doc-info { flex: 1; min-width: 0; }
.recent-doc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-doc-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-doc-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────
   CLICKABLE CARDS (dashboard stat cards)
───────────────────────────────────────────────────────── */

.card[onclick], .card.clickable {
  cursor: pointer;
}
.card[onclick]:hover, .card.clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--s-md);
  border-left-width: 5px;
}

.card-link-hint {
  font-size: 11px;
  color: var(--brand-bright);
  font-weight: 600;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Brand */
  --brand-deep:    #082266;
  --brand-royal:   #0F40A0;
  --brand-mid:     #1565C0;
  --brand-bright:  #1A8CE8;
  --brand-cyan:    #00B4DE;
  --brand-gold:    #F5A823;
  --brand-gold-lt: #FFF7E6;
  --brand-gold-md: #FDEBC0;

  /* Neutrals */
  --bg:       #EEF3FA;
  --surface:  #FFFFFF;
  --border:   #DDE6F3;
  --border-2: #C8D8EE;
  --text:     #0D1F38;
  --text-2:   #476080;
  --text-3:   #8FA6C2;

  /* Status */
  --green:    #0EA96D;
  --green-lt: #E6F9F1;
  --green-md: #A7EDCD;
  --red:      #E53535;
  --red-lt:   #FEF0F0;
  --red-md:   #FCBCBC;
  --amber:    #D97706;
  --amber-lt: #FFF8EC;
  --amber-md: #FDE8A0;
  --purple:   #7C3AED;
  --purple-lt:#EDE9FE;

  /* Layout */
  --sidebar-w: 244px;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* Shadows */
  --s-xs: 0 1px 4px rgba(13,50,100,.06);
  --s-sm: 0 2px 10px rgba(13,50,100,.07);
  --s-md: 0 4px 24px rgba(13,50,100,.10);
  --s-lg: 0 8px 48px rgba(13,50,100,.14);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ──────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  padding: 28px;
  min-width: 0;
  position: relative;
}

/* Page watermark — EHI logo peeking bottom-right */
.page-wm {
  position: fixed;
  bottom: -48px;
  right: -48px;
  width: 210px;
  height: 210px;
  pointer-events: none;
  z-index: 0;
  opacity: .055;
  transform: rotate(-14deg);
  user-select: none;
}
.page-wm img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Keep all content above the watermark */
.main > *:not(.page-wm) {
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(188deg, #072060 0%, #0D3896 55%, #1350B8 100%);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Molecular glow decoration */
.sidebar::before {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(245,168,35,.18) 0%, transparent 65%);
  pointer-events: none;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 30%;
  right: -80px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0,180,222,.12) 0%, transparent 65%);
  pointer-events: none;
}

/* Brand block */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 28px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 20px;
}

.sb-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}

.sb-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-gold);
  letter-spacing: -.3px;
  line-height: 1.2;
}

.sb-tagline {
  font-size: 10px;
  color: rgba(255,255,255,.5);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav */
.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.68);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .18s, color .18s;
  position: relative;
  z-index: 2;
}

.sb-link:hover {
  background: rgba(255,255,255,.1);
  color: white;
}

.sb-link.active {
  background: rgba(255,255,255,.14);
  color: white;
  font-weight: 700;
}

.sb-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--brand-gold);
  border-radius: 0 3px 3px 0;
}

.sb-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .85;
}

.sb-link.active .sb-icon,
.sb-link:hover .sb-icon {
  opacity: 1;
}

/* Footer / logout */
.sb-footer {
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 16px;
  position: relative;
  z-index: 2;
}

.sb-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: var(--r-sm);
  background: rgba(229,53,53,.15);
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s;
  font-family: inherit;
}

.sb-logout:hover {
  background: rgba(229,53,53,.35);
  color: white;
}

/* Ghost watermark in sidebar */
.sb-wm {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  opacity: .06;
  pointer-events: none;
  z-index: 1;
}
.sb-wm img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.topbar > div > span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 4px;
}

.topbar h2 {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1.1;
}

.upload-btn {
  background: linear-gradient(135deg, var(--brand-gold) 0%, #E8920A 100%);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(245,168,35,.35);
  transition: transform .15s, box-shadow .15s;
}

.upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245,168,35,.45);
}

/* ── Hero Section (Dashboard) ────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #082266 0%, var(--brand-royal) 45%, #1565C0 100%);
  color: white;
  padding: 38px 44px;
  border-radius: var(--r-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

/* Decorative glow orbs */
.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(245,168,35,.22) 0%, transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  right: 25%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0,180,222,.14) 0%, transparent 65%);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero > div > p:first-child {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.65);
  margin-bottom: 6px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 4px 0 8px;
  letter-spacing: -.4px;
}

.hero > div > p:last-of-type {
  font-size: 14px;
  color: rgba(255,255,255,.7);
}

/* Hero user badges */
.hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero-badge {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
}

/* Stats in hero */
.stats {
  display: flex;
  gap: 36px;
}

.stats > div {
  text-align: center;
}

.stats h2 {
  font-size: 38px;
  font-weight: 800;
  color: var(--brand-gold);
  letter-spacing: -1px;
  line-height: 1;
}

.stats p {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  box-shadow: var(--s-sm);
  border-left: 4px solid var(--brand-mid);
  transition: transform .18s, box-shadow .18s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--s-md);
}

.card:nth-child(2) { border-left-color: var(--brand-gold); }
.card:nth-child(3) { border-left-color: var(--green); }
.card:nth-child(4) { border-left-color: var(--red); }

.card h2 {
  font-size: 40px;
  font-weight: 800;
  color: var(--brand-deep);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.card p {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Table Section ───────────────────────────────────────── */
.table-section,
.module {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--s-sm);
  margin-bottom: 24px;
}

.table-section h2,
.module h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

/* ── Table ───────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .7px;
  border-bottom: 1px solid var(--border);
}

td {
  text-align: left;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: #F4F8FF; }

/* ── Status Badges ───────────────────────────────────────── */
.badge,
.pending, .approved, .review {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.pending, .badge.pending {
  background: var(--amber-lt);
  color: var(--amber);
}

.approved, .badge.approved {
  background: var(--green-lt);
  color: var(--green);
}

.review, .badge.review {
  background: #EFF4FF;
  color: var(--brand-mid);
}

.badge.urgent {
  background: var(--red-lt);
  color: var(--red);
}

.badge.medium {
  background: var(--amber-lt);
  color: var(--amber);
}

.badge.normal {
  background: #F1F5F9;
  color: var(--text-2);
}

.status-approved {
  background: var(--green-lt);
  color: var(--green);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.status-pending {
  background: var(--amber-lt);
  color: var(--amber);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.status-rejected {
  background: var(--red-lt);
  color: var(--red);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

/* ── Priority Badges ─────────────────────────────────────── */
.pri-normal {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green-lt);
  color: var(--green);
}

.pri-urgent {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--amber-lt);
  color: var(--amber);
}

.pri-critical {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--red-lt);
  color: var(--red);
  animation: pulse-red 1.6s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* ── Deadline badges ─────────────────────────────────────── */
.deadline-ok      { font-size: 11px; color: var(--text-3); }
.deadline-near    { font-size: 11px; font-weight: 700; color: var(--amber); }
.deadline-overdue { font-size: 11px; font-weight: 700; color: var(--red); }

/* ── Step badges ─────────────────────────────────────────── */
.step-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.step-badge.step1 { background: #EFF4FF; color: var(--brand-mid); }
.step-badge.step2 { background: var(--purple-lt); color: var(--purple); }

/* ── Buttons ─────────────────────────────────────────────── */
.sign-btn, .action-btn, .download-btn, .approve-btn,
.primary-btn, .secondary-btn, .success-btn {
  border: none;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  transition: transform .14s, box-shadow .14s, opacity .14s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sign-btn, .approve-btn {
  background: linear-gradient(135deg, var(--brand-gold), #E8920A);
  color: white;
  box-shadow: 0 3px 10px rgba(245,168,35,.3);
}

.sign-btn:hover, .approve-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(245,168,35,.4);
}

.reject-btn {
  background: var(--red-lt);
  color: var(--red);
  border: none;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  transition: background .14s;
}
.reject-btn:hover { background: var(--red-md); }

.download-btn {
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: var(--r-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: background .14s, border-color .14s;
}
.download-btn:hover {
  background: var(--border);
  border-color: var(--border-2);
}

.primary-btn {
  background: var(--brand-mid);
  color: white;
  box-shadow: 0 3px 10px rgba(21,101,192,.2);
}
.primary-btn:hover { background: var(--brand-royal); }

.secondary-btn {
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.secondary-btn:hover { background: var(--border); }

.success-btn {
  background: var(--green);
  color: white;
  box-shadow: 0 3px 10px rgba(14,169,109,.25);
}
.success-btn:hover { opacity: .9; }

/* Generic .btn classes */
.btn {
  border: none;
  padding: 12px 20px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  transition: .15s;
}
.btn.primary { background: var(--brand-mid); color: white; }
.btn.secondary { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.btn.success { background: var(--green); color: white; }

/* ── Action cell (table) ─────────────────────────────────── */
.action-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Upload Zone / Box ───────────────────────────────────── */
.upload-box, .upload-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  padding: 44px;
  text-align: center;
  background: #F8FBFF;
  transition: border-color .2s, background .2s;
}

.upload-box:hover, .upload-zone:hover {
  border-color: var(--brand-cyan);
  background: #F0F8FF;
}

.upload-zone h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.upload-zone p { color: var(--text-2); margin-bottom: 16px; }

/* ── Form elements ───────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label,
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-bright);
  box-shadow: 0 0 0 3px rgba(26,140,232,.12);
}

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar select,
.filter-bar input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .18s;
  background: white;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--brand-bright);
}

.filter-count {
  font-size: 12px;
  color: var(--text-3);
  margin-left: auto;
  font-weight: 600;
}

/* ── Doc meta labels ─────────────────────────────────────── */
.doc-title-main {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.doc-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
}

.doc-meta span { margin-right: 8px; }

/* ── Note bubbles ────────────────────────────────────────── */
.note-bubble {
  background: var(--amber-lt);
  border: 1px solid var(--amber-md);
  border-radius: var(--r-xs);
  padding: 8px 10px;
  font-size: 11px;
  color: #7A4500;
  margin-top: 6px;
  max-width: 400px;
}

.note-bubble strong {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  color: var(--amber);
}

/* ── Info Box ────────────────────────────────────────────── */
.info-box {
  margin-top: 20px;
  padding: 14px 16px;
  background: #EFF4FF;
  border-radius: var(--r-md);
  color: var(--brand-mid);
  border-left: 4px solid var(--brand-bright);
  font-size: 13px;
}

/* ── Actions row ─────────────────────────────────────────── */
.actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────
   PDF SIGN — Signing Workspace
───────────────────────────────────────────────────────── */

.pdf-workspace {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 30px;
  box-shadow: var(--s-md);
  margin-bottom: 24px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.workspace-title h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.workspace-title p {
  font-size: 13px;
  color: var(--text-2);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-btn {
  background: #EFF4FF;
  color: var(--brand-mid);
  border: none;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s;
}

.tool-btn:hover {
  background: var(--brand-mid);
  color: white;
}

.upload-zone {
  margin-bottom: 28px;
}

.workspace-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
}

.pdf-viewer {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 22px;
  min-height: 800px;
  overflow: auto;
}

.signature-panel {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 22px;
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.signature-panel h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 18px;
  color: var(--text);
}

.signature-box {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: white;
  margin-bottom: 16px;
}

.signature-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* PDF canvas */
.pdf-container {
  position: relative;
  margin-top: 28px;
  background: var(--bg);
  padding: 18px;
  border-radius: var(--r-lg);
  overflow: auto;
}

#pdf-canvas {
  background: white;
  border-radius: var(--r-sm);
  max-width: 100%;
  cursor: crosshair;
  box-shadow: var(--s-sm);
}

#signature-preview {
  position: absolute;
  width: 160px;
  display: none;
  pointer-events: none;
}

.signature-area { margin-top: 28px; }

.signature-pad {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: white;
  width: 100%;
  max-width: 500px;
  height: 200px;
}

/* Upload signature btn */
.upload-signature { margin-bottom: 16px; }

.upload-sign-btn {
  display: inline-block;
  background: #EFF4FF;
  color: var(--brand-mid);
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s;
}

.upload-sign-btn:hover {
  background: var(--brand-mid);
  color: white;
}

/* ── Tab System (pdf-sign.html) ──────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--r-sm);
  width: fit-content;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--r-xs);
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s;
}

.tab-btn.active {
  background: white;
  color: var(--brand-mid);
  box-shadow: var(--s-xs);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Form Card (upload form) ─────────────────────────────── */
.form-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--s-sm);
  margin-bottom: 24px;
}

.form-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* Layout for sign workspace (two-panel) */
.sign-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

/* Step 2 toggle (Rahasia checkbox) */
.step2-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color .18s;
}

.step2-toggle:hover { border-color: var(--brand-bright); }

.step2-toggle input[type="checkbox"] {
  width: auto;
  cursor: pointer;
  accent-color: var(--brand-mid);
}

/* ── Division Summary (dashboard admin) ──────────────────── */
.div-summary-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--s-xs);
  border-left: 4px solid var(--brand-mid);
}

.div-summary-card .div-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.div-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — 3 tiers
   Desktop  : > 1100px  → full sidebar 244px
   Tablet   : 768–1100px → icon-only sidebar 68px
   Phone    : < 768px   → fixed bottom navigation bar
══════════════════════════════════════════════════════════ */

/* ── Tier 1: Narrow desktop / small laptop (≤1100px) ────── */
@media (max-width: 1100px) {
  .workspace-body,
  .sign-layout {
    grid-template-columns: 1fr;
  }
  .signature-panel { position: relative; top: auto; }
}

/* ── Tier 2: Tablet / iPad (768px – 1100px) ─────────────── */
@media (min-width: 768px) and (max-width: 1100px) {

  /* Collapse sidebar to icon-only narrow bar */
  .sidebar {
    width: 68px;
    min-width: 68px;
    padding: 18px 10px;
    align-items: center;
  }

  /* Show only logo icon, hide name+tagline */
  .sb-brand {
    flex-direction: column;
    gap: 0;
    padding-bottom: 18px;
    justify-content: center;
  }
  .sb-logo { width: 36px; height: 36px; }
  .sb-name, .sb-tagline { display: none; }

  /* Nav items: icon centered, hide text */
  .sb-link {
    justify-content: center;
    padding: 12px 6px;
    position: relative;
  }
  .sb-link span,
  .sb-link > *:not(.sb-icon) { display: none; }

  /* Tooltip on hover */
  .sb-link::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    color: white;
    padding: 5px 10px;
    border-radius: var(--r-xs);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    z-index: 999;
  }
  .sb-link:hover::after { opacity: 1; }

  /* Logout: icon only */
  .sb-logout {
    justify-content: center;
    padding: 12px 6px;
    font-size: 0; /* hide text */
  }
  .sb-logout > *:not(.sb-icon) { display: none; }

  /* Hide ghost wm on narrow sidebar */
  .sb-wm { display: none; }
  .sidebar::before { width: 120px; height: 120px; }

  /* Main gets more room */
  .main { padding: 22px; }
  .topbar h2 { font-size: 26px; }

  /* Cards: 2 columns */
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 28px 32px; }
}

/* ── Tier 3: Phone / small tablet (< 768px) ─────────────── */
@media (max-width: 767px) {

  /* ── Sidebar → Fixed bottom nav bar ── */
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100% !important;
    min-width: unset !important;
    height: 62px;
    flex-direction: row;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,.13);
    border-radius: 0;
    z-index: 500;
    overflow: hidden;
  }

  /* Hide brand header, footer, wm in bottom nav */
  .sb-brand,
  .sb-footer,
  .sb-wm { display: none !important; }
  .sidebar::before,
  .sidebar::after { display: none !important; }

  /* Nav: horizontal, evenly distributed */
  .sb-nav {
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    flex: 1;
    gap: 0;
    padding: 0;
  }

  /* Each link: icon + tiny label, stacked vertically */
  .sb-link {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 2px 8px;
    font-size: 9px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    border-radius: 0;
    letter-spacing: .2px;
    min-width: 0;
    overflow: hidden;
  }

  /* Active indicator: top border */
  .sb-link.active::before { display: none; }
  .sb-link.active {
    background: rgba(255,255,255,.16);
  }
  .sb-link.active .sb-icon {
    filter: drop-shadow(0 0 4px rgba(245,168,35,.8));
  }

  .sb-icon { width: 20px; height: 20px; }

  /* Truncate long label text */
  .sb-link > *:not(.sb-icon) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* ── Main content: full width, bottom padding for nav ── */
  .main {
    padding: 16px 14px 78px;
    width: 100%;
  }

  /* App layout: column with sidebar at bottom */
  .app { flex-direction: column; }

  /* ── Topbar ── */
  .topbar {
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .topbar > div > span { font-size: 10px; }
  .topbar h2 { font-size: 22px; }
  .upload-btn {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ── Hero ── */
  .hero {
    padding: 22px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    border-radius: var(--r-lg);
    margin-bottom: 16px;
  }
  .hero h1 { font-size: 20px; }
  .hero > div > p:first-child { font-size: 10px; }
  .stats {
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }
  .stats h2 { font-size: 28px; }
  .stats p { font-size: 10px; }
  .hero-badges { gap: 6px; }
  .hero-badge { font-size: 11px; padding: 5px 10px; }

  /* ── Stat Cards: 2 columns ── */
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .card { padding: 16px 14px; border-radius: var(--r-md); }
  .card h2 { font-size: 28px; }
  .card p { font-size: 10px; }

  /* ── Table Section ── */
  .table-section,
  .module {
    padding: 16px 14px;
    border-radius: var(--r-md);
    margin-bottom: 14px;
  }
  .table-section h2,
  .module h2 { font-size: 15px; margin-bottom: 14px; }

  /* ── Tables: horizontal scroll ── */
  .table-wrapper,
  .table-section > div { overflow-x: auto; }
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
  }
  th { padding: 10px 12px; font-size: 10px; }
  td { padding: 10px 12px; font-size: 12px; }

  /* ── Filter bar: single column ── */
  .filter-bar {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
  }
  .filter-bar select,
  .filter-bar input {
    width: 100%;
    min-width: unset;
    white-space: nowrap;
  }
  .filter-count { margin-left: 0; font-size: 11px; }

  /* ── Upload form (pdf-sign.html) ── */
  .form-card { padding: 16px 14px; }
  .form-card h3 { font-size: 14px; margin-bottom: 14px; padding-bottom: 10px; }

  /* Form grid to single column on phone */
  .form-grid-2col {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Larger touch targets for inputs */
  input[type="text"],
  input[type="email"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    padding: 13px 14px;
    font-size: 15px; /* prevents iOS zoom */
    border-radius: var(--r-sm);
  }

  /* ── Tab bar ── */
  .tab-bar { width: 100%; }
  .tab-btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 12px;
    text-align: center;
  }

  /* ── Signing workspace ── */
  .pdf-workspace { padding: 16px 14px; }
  .workspace-body,
  .sign-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pdf-viewer { padding: 14px; min-height: 300px; border-radius: var(--r-md); }
  .signature-panel { padding: 16px 14px; border-radius: var(--r-md); }
  .signature-panel h3 { font-size: 14px; }

  /* Signature pad shorter on phone */
  canvas#signature-pad,
  .signature-pad { height: 100px !important; }

  /* Action buttons: full width on phone */
  .action-cell { gap: 6px; }
  .sign-btn, .approve-btn, .reject-btn,
  .primary-btn, .success-btn {
    font-size: 12px;
    padding: 9px 12px;
  }

  /* Download buttons */
  .dl-btn { font-size: 11px; padding: 6px 10px; }

  /* ── Note bubbles ── */
  .note-bubble { max-width: 100%; }

  /* ── Page watermark: smaller on phone ── */
  .page-wm {
    width: 130px;
    height: 130px;
    bottom: -24px;
    right: -24px;
  }
}
