/* ============================================================
   Ziday — Application Styles
   ============================================================ */

/* ---- Variables ---- */
:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255,255,255,0.06);
  --sidebar-text: rgba(255,255,255,0.65);
  --sidebar-active-bg: rgba(255,255,255,0.08);
  --sidebar-active-border: #6366f1;
  --sidebar-hover-bg: rgba(255,255,255,0.05);

  --topbar-h: 64px;
  --topbar-bg: #ffffff;
  --topbar-border: #e5e7eb;

  --content-bg: #f1f5f9;
  --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --card-radius: 10px;

  --primary: #6366f1;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: var(--content-bg);
  color: #1e293b;
  margin: 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1030;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  flex-shrink: 0;
}
.brand-name {
  display: block;
  font-size: 16px; font-weight: 700;
  color: #fff; letter-spacing: .4px;
}
.brand-sub {
  display: block;
  font-size: 10px; font-weight: 400;
  color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .8px;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sidebar-nav { padding: 0 10px; }

.nav-section {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .9px;
  color: rgba(255,255,255,.3);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--sidebar-hover-bg); color: rgba(255,255,255,.9); }
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  border-left: 3px solid var(--sidebar-active-border);
  margin-left: -1px;
}
.nav-icon { font-size: 16px; flex-shrink: 0; }

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 14px;
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  padding: 8px;
  border-radius: 8px;
  transition: background .15s;
}
.sidebar-user:hover { background: var(--sidebar-hover-bg); }
.sidebar-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.4); }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1029;
}

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 1020;
}

.sidebar-toggle {
  background: none; border: none; padding: 6px 8px;
  font-size: 20px; color: #64748b; cursor: pointer;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.sidebar-toggle:hover { background: #f1f5f9; color: #1e293b; }

.topbar-breadcrumb { color: #94a3b8; font-size: 13px; }
.topbar-divider { width: 1px; height: 28px; background: #e2e8f0; }

.topbar-user-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 8px;
  transition: background .15s;
}
.topbar-user-btn:hover { background: #f1f5f9; }
.topbar-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.topbar-user-name { font-size: 13px; font-weight: 600; color: #1e293b; line-height: 1.2; }
.topbar-user-role { font-size: 11px; color: #94a3b8; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* Flash */
.flash-container { padding: 16px 24px 0; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content { flex: 1; padding: 24px; }

.main-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--topbar-border);
  font-size: 12px; color: #94a3b8;
  background: #fff;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 24px;
}
.page-title { font-size: 20px; font-weight: 700; color: #0f172a; margin: 0; }
.page-subtitle { font-size: 13px; color: #94a3b8; margin: 2px 0 0; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}
.card-header {
  padding: 14px 20px;
  background: transparent;
  border-bottom: 1px solid #f1f5f9;
}
.card-title { font-size: 14px; font-weight: 600; color: #0f172a; }
.card-body { padding: 20px; }
.card-footer {
  padding: 10px 20px;
  background: #fafafa;
  border-top: 1px solid #f1f5f9;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-card--primary .stat-icon { background: #eef2ff; color: #6366f1; }
.stat-card--success .stat-icon { background: #f0fdf4; color: #22c55e; }
.stat-card--warning .stat-icon { background: #fffbeb; color: #f59e0b; }
.stat-card--info    .stat-icon { background: #ecfeff; color: #06b6d4; }
.stat-value { font-size: 26px; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-label { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   TABLES
   ============================================================ */
.table { color: #1e293b; }
.table thead th {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: #64748b; border-bottom: 1px solid #e2e8f0;
  padding: 10px 16px; white-space: nowrap;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-color: #f1f5f9; }
.table-hover tbody tr:hover { background: #f8fafc; }
.table-light { background: #f8fafc !important; }

/* Title cell: wrap up to 2 lines, expand with available space */
.cell-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 200px;
  max-width: 360px;
  line-height: 1.4;
  word-break: break-word;
}

/* Sortable column headers */
.th-sort {
  display: inline-flex; align-items: center; gap: 4px;
  color: inherit; text-decoration: none; cursor: pointer;
  transition: color .12s;
}
.th-sort i { font-size: 9px; opacity: .4; }
.th-sort:hover { color: #4f46e5; }
.th-sort:hover i { opacity: .8; }
.th-sort.active { color: #4f46e5; }
.th-sort.active i { opacity: 1; }

/* ============================================================
   STATUS & PRIORITY BADGES
   ============================================================ */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
}
.status-on_progress { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.status-pending     { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.status-completed   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.status-cancel      { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.status-deployment  { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }

/* Reminder rows in the Job Activities table — red blinking highlight */
@keyframes reminderBlink {
  0%, 100% { background-color: #fecaca; }
  50%      { background-color: #fef2f2; }
}
.table tr.row-reminder > td {
  /* Bootstrap paints cell bg via an inset box-shadow; disable it so the
     animated background-color is actually visible. */
  box-shadow: none !important;
  --bs-table-bg: transparent;
  --bs-table-accent-bg: transparent;
  animation: reminderBlink 1.2s ease-in-out infinite;
}
/* Keep hover from masking the blink */
.table-hover tbody tr.row-reminder:hover > td {
  background-color: #fca5a5;
}
/* Pulsing bell (acknowledge) button for a due reminder */
@keyframes reminderPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}
.reminder-bell {
  animation: reminderPulse 1.2s ease-in-out infinite;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 5px; color: #374151; }
.form-label.required::after { content: ' *'; color: #ef4444; }
.form-control, .form-select {
  font-size: 13.5px;
  border-radius: 7px;
  border-color: #d1d5db;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.input-group-text {
  background: #f8fafc; border-color: #d1d5db; color: #94a3b8;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { font-size: 13.5px; font-weight: 500; border-radius: 7px; }
.btn-primary { background: #6366f1; border-color: #6366f1; }
.btn-primary:hover { background: #4f46e5; border-color: #4f46e5; }
.btn-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-lg { padding: 10px 20px; font-size: 14px; }

/* ============================================================
   UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover { border-color: #6366f1; background: #f5f5ff; }
.upload-input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  margin-bottom: 6px;
  font-size: 13px;
}

/* Image upload zone */
.img-preview-zone {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  height: 160px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  transition: border-color .2s;
}
.img-preview-zone:hover { border-color: #6366f1; }

/* ============================================================
   ATTACHMENTS
   ============================================================ */
.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/* ============================================================
   TIMELINE (history)
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 2px; background: #e2e8f0;
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -20px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e2e8f0;
}
.timeline-body {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
}
.history-diff { border-left: 3px solid #e2e8f0; padding-left: 10px; }
.diff-old, .diff-new { font-size: 12px; padding: 2px 0; color: #64748b; }

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.auth-body {
  background: #0f172a;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}
.auth-brand {
  flex: 1;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 60px;
  display: none;
  position: relative; overflow: hidden;
}
@media (min-width: 992px) { .auth-brand { display: flex; } }
.auth-brand-inner { max-width: 380px; color: #fff; position: relative; z-index: 1; }

/* ---- Latar animasi pertambangan (SVG sebaris di layouts/auth.php) ----
   Semua gerak murni CSS supaya tidak ada berkas gambar/aset luar yang dimuat. */
.mine-scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
/* Teks tetap terbaca di atas pemandangan */
.auth-brand::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(105deg, rgba(30,27,75,.82) 0%, rgba(49,46,129,.55) 55%, rgba(67,56,202,.25) 100%);
}

@keyframes mineTruck  { from { transform: translateX(-90px); } to { transform: translateX(880px); } }
@keyframes mineDrill  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(9px); } }
@keyframes mineArm    { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-13deg); } }
@keyframes mineDust   { 0%   { transform: translateY(0)    scale(.7); opacity: 0; }
                        25%  { opacity: .45; }
                        100% { transform: translateY(-70px) scale(1.5); opacity: 0; } }
@keyframes mineTwinkle{ 0%,100% { opacity: .18; } 50% { opacity: .7; } }
@keyframes mineGlow   { 0%,100% { opacity: .16; } 50% { opacity: .3; } }

.mine-truck     { animation: mineTruck 19s linear infinite; }
.mine-drill     { animation: mineDrill 2.6s ease-in-out infinite; }
.mine-arm       { transform-origin: 566px 484px; animation: mineArm 6s ease-in-out infinite; }
.mine-sun       { animation: mineGlow 7s ease-in-out infinite; }
.mine-star      { animation: mineTwinkle 4s ease-in-out infinite; }
.mine-star:nth-of-type(2) { animation-delay: 1.1s; }
.mine-star:nth-of-type(3) { animation-delay: 2.3s; }
.mine-star:nth-of-type(4) { animation-delay: .6s; }
.mine-star:nth-of-type(5) { animation-delay: 3.1s; }
.mine-star:nth-of-type(6) { animation-delay: 1.8s; }
.mine-dust      { opacity: 0; animation: mineDust 9s ease-out infinite; }
.mine-dust-2    { animation-duration: 11s; animation-delay: 2.5s; }
.mine-dust-3    { animation-duration: 8s;  animation-delay: 4.5s; }
.mine-dust-4    { animation-duration: 12s; animation-delay: 6.5s; }

@media (prefers-reduced-motion: reduce) {
  .mine-truck, .mine-drill, .mine-arm, .mine-sun, .mine-star, .mine-dust { animation: none; }
  .mine-dust { opacity: .25; }
}
.auth-logo {
  width: 64px; height: 64px;
  background: rgba(255,255,255,.15);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin-bottom: 24px;
}
.auth-brand h1 { font-size: 36px; font-weight: 800; margin-bottom: 8px; }
.auth-brand p { font-size: 16px; color: rgba(255,255,255,.7); margin-bottom: 0; }

.auth-card-wrapper {
  width: 100%;
  max-width: 460px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 30px;
  background: #fff;
  margin: 0 auto;
}
@media (min-width: 992px) {
  .auth-card-wrapper { margin: 0; border-radius: 0; }
}

.auth-card { width: 100%; max-width: 380px; }
.auth-card-header { text-align: center; margin-bottom: 32px; }
.auth-card-header h2 { font-size: 26px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.auth-card-header p { color: #94a3b8; font-size: 14px; }
.auth-card-footer { text-align: center; margin-top: 24px; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-avatar {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #fff;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.user-avatar-sm {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* Avatar photo override — .avatar-img dipasang absolut, jadi SETIAP wadah yang
   memuatnya wajib position:relative + overflow:hidden. Tanpa itu fotonya
   menempel ke elemen berposisi terdekat (akhirnya <body>) lalu melebar
   inset:0 menutupi seluruh halaman — persis yang terjadi pada tabel pengguna
   setelah satu pengguna mengunggah foto profil. */
.sidebar-avatar,
.topbar-avatar,
.profile-avatar,
.user-avatar-sm,
.update-avatar,
.update-avatar-sm,
.update-comment-avatar { position: relative; overflow: hidden; }
.avatar-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Sidebar brand logo image */
.sidebar-brand-logo { background: transparent; padding: 2px; }
.sidebar-brand-logo img {
  width: 100%; height: 100%;
  object-fit: contain; border-radius: 6px;
}

/* Auth logo image */
.auth-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-logo-box {
  width: 80px; height: 80px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc;
  overflow: hidden;
}
.settings-logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.category-card { transition: box-shadow .15s; }
.category-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.category-icon-box {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE — MOBILE SIDEBAR
   ============================================================ */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { margin-left: 0 !important; }
}

/* ============================================================
   DATATABLES OVERRIDES
   ============================================================ */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 8px;
}
.dataTables_wrapper .dataTables_info { font-size: 12px; color: #94a3b8; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { gap: 2px; }
.page-link {
  border-radius: 6px !important;
  border-color: #e2e8f0;
  color: #475569;
  font-size: 12.5px;
  padding: 5px 10px;
  min-width: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.page-link:hover { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }
.page-item.active .page-link {
  background: #6366f1; border-color: #6366f1; color: #fff;
}
.page-item.disabled .page-link { background: #f8fafc; color: #cbd5e1; border-color: #e2e8f0; }

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */
.topbar-notif-btn {
  position: relative;
  background: none; border: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #64748b; cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.topbar-notif-btn:hover { background: #f1f5f9; color: #1e293b; }

.notif-badge {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 16px; height: 16px;
  background: #ef4444; color: #fff;
  border-radius: 20px;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid #fff;
  line-height: 1;
  pointer-events: none;
}

.notif-dropdown {
  width: 340px;
  max-width: 95vw;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  overflow: hidden;
}

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
  background: #fff;
}
.notif-markall {
  font-size: 12px; color: #6366f1; text-decoration: none;
}
.notif-markall:hover { text-decoration: underline; }
.notif-enable-push {
  font-size: 11px; color: #6366f1; background: none;
  border: 1px solid #c7d2fe; border-radius: 4px;
  padding: 2px 8px; cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.notif-enable-push:hover { background: #eef2ff; }

.notif-list {
  max-height: 380px;
  overflow-y: auto;
  background: #fff;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

.notif-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px; color: #94a3b8;
}

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid #f8fafc;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
  position: relative;
}
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #f5f7ff; }
.notif-item.unread:hover { background: #eef2ff; }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; margin-top: 1px;
}
.notif-icon.text-primary  { background: #eef2ff; }
.notif-icon.text-success  { background: #f0fdf4; }
.notif-icon.text-warning  { background: #fffbeb; }

.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: 12.5px; font-weight: 600; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.notif-body {
  font-size: 11.5px; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.notif-time { font-size: 11px; color: #94a3b8; }

.notif-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0; margin-top: 6px;
}

/* ============================================================
   REAL-TIME TOAST NOTIFICATIONS
   ============================================================ */
.notif-toast {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  overflow: hidden;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .25s ease, transform .25s ease;
  will-change: opacity, transform;
}
.notif-toast.show {
  opacity: 1;
  transform: translateX(0);
}
.notif-toast.hiding {
  opacity: 0;
  transform: translateX(20px);
}
.notif-toast-header {
  display: flex; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  gap: 4px;
}
.notif-toast-title {
  flex: 1;
  font-size: 12.5px; font-weight: 600; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-toast-close {
  background: none; border: none; padding: 2px 4px;
  color: #94a3b8; cursor: pointer; border-radius: 4px;
  font-size: 12px; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.notif-toast-close:hover { background: #f1f5f9; color: #475569; }
.notif-toast-body {
  padding: 8px 14px 10px;
  font-size: 12px; color: #64748b; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Sidebar notifications badge */
.sidebar-notif-badge {
  margin-left: auto;
  background: #ef4444; color: #fff;
  border-radius: 20px; font-size: 10px; font-weight: 700;
  padding: 1px 6px; min-width: 18px; text-align: center;
}

/* ============================================================
   NOTIFICATIONS FULL PAGE
   ============================================================ */
.notif-page-list {
  display: flex; flex-direction: column;
}

.notif-page-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
}
.notif-page-item:last-child { border-bottom: none; }
.notif-page-item:hover { background: #f8fafc; }
.notif-page-item.unread { background: #f5f7ff; }
.notif-page-item.unread:hover { background: #eef2ff; }

.notif-page-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0; margin-top: 2px;
}
.notif-page-icon.text-primary { background: #eef2ff; }
.notif-page-icon.text-success { background: #f0fdf4; }
.notif-page-icon.text-warning { background: #fffbeb; }

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

.notif-page-top {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 4px;
}
.notif-page-title {
  font-size: 13.5px; font-weight: 600; color: #1e293b;
}
.notif-page-item:not(.unread) .notif-page-title {
  font-weight: 500; color: #475569;
}

.notif-type-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px;
}
.notif-type-new_update  { background: #eef2ff; color: #4338ca; }
.notif-type-new_comment { background: #f0fdf4; color: #15803d; }
.notif-type-edit_update { background: #fffbeb; color: #b45309; }

.notif-unread-badge {
  font-size: 10px; font-weight: 700;
  background: #6366f1; color: #fff;
  border-radius: 20px; padding: 2px 7px;
}

.notif-page-text {
  font-size: 13px; color: #64748b;
  margin-bottom: 6px; line-height: 1.5;
  word-break: break-word;
}
.notif-page-meta {
  font-size: 11.5px; color: #94a3b8;
  display: flex; align-items: center; gap: 2px;
  flex-wrap: wrap;
}

.notif-page-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; margin-top: 2px;
}

/* ============================================================
   DETAIL STRIP (horizontal metadata bar on show page)
   ============================================================ */
.detail-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.detail-strip-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 20px 4px 0;
  min-width: 0;
}
.detail-strip-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #94a3b8;
  white-space: nowrap;
}
.detail-strip-value {
  font-size: 13px;
  color: #1e293b;
  white-space: nowrap;
}
.detail-strip-sub {
  font-size: 11px;
  color: #94a3b8;
}
.detail-strip-sep {
  width: 1px;
  height: 36px;
  background: #e2e8f0;
  margin: 0 16px 0 4px;
  flex-shrink: 0;
  align-self: center;
}
@media (max-width: 767.98px) {
  .detail-strip-sep { display: none; }
  .detail-strip-item { padding: 6px 12px 6px 0; }
}

/* ============================================================
   PROGRESS UPDATES
   ============================================================ */
.update-filter-bar { margin-bottom: 12px; }
.update-filter-bar .input-group { border-radius: 7px; overflow: hidden; }
.update-filter-bar .input-group > * { border-color: #e2e8f0; }
.update-filter-bar .input-group > *:focus { border-color: #6366f1; box-shadow: none; z-index: 3; }
.update-filter-count {
  font-size: 11.5px;
  color: #94a3b8;
  padding: 3px 2px 0;
}

.update-compose {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #fafbff;
  margin-bottom: 12px;
}
.update-compose-body { min-width: 0; }
.update-compose-body textarea {
  resize: vertical;
  min-height: 72px;
}

.update-list { display: flex; flex-direction: column; gap: 8px; }
.update-item { display: block; }
.update-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #94a3b8, #64748b);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.update-body {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}
/* Brief highlight for the update just edited / navigated to */
.update-item.update-focus .update-body {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
  transition: box-shadow .3s, border-color .3s;
}
.update-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
/* Hover memakai lapisan gradient, BUKAN filter. `filter` membentuk stacking
   context baru pada .update-header, dan begitu itu terjadi menu dropdown aksi
   (ubah/hapus) ikut terkurung di dalamnya — ia lalu tertimbun blok komentar di
   bawahnya sehingga klik justru mendarat di kolom komentar. Gradient memberi
   efek gelap yang sama tanpa membentuk stacking context.
   Dengan alasan yang sama, JANGAN memberi .update-header position + z-index:
   menu update pertama akan tertimbun kepala update berikutnya. */
.update-header:hover { background-image: linear-gradient(rgba(15,23,42,.035), rgba(15,23,42,.035)); }
.update-header:hover .update-title { color: #1d4ed8; }


/* Kolom aksi: didorong ke kanan dan tidak pernah ikut menyusut, supaya
   tombolnya tetap utuh betapa pun panjang judul atau nama penulisnya. */
.update-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.update-actions .dropdown-menu { z-index: 1056; }

/* Isi, lampiran, dan komentar dibungkus .update-collapse yang sudah memberi
   padding 12px sejajar kepala update — jangan menambah padding lagi di sini,
   jaraknya akan terhitung dua kali. */
.update-chevron {
  font-size: 10px;
  color: #64748b;
  flex-shrink: 0;
  transition: transform 0.18s ease;
  width: 14px;
  text-align: center;
}
.update-chevron.open { transform: rotate(90deg); }
.update-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #0f172a;
  line-height: 1.4;
  transition: color 0.15s;
}

/* Status-coded accent + header tint so updates are easy to tell apart */
.update-item[data-status="pending"]     .update-body { border-left: 3px solid #94a3b8; }
.update-item[data-status="in_progress"] .update-body { border-left: 3px solid #2563eb; }
.update-item[data-status="completed"]   .update-body { border-left: 3px solid #16a34a; }
.update-item[data-status="cancel"]      .update-body { border-left: 3px solid #be123c; }

.update-item[data-status="pending"]     .update-header { background: #f1f5f9; }
.update-item[data-status="in_progress"] .update-header { background: #eff6ff; }
.update-item[data-status="completed"]   .update-header { background: #f0fdf4; }
.update-item[data-status="cancel"]      .update-header { background: #fff1f2; }
.update-edit-form { padding: 10px 12px; }
.update-collapse {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.22s ease, opacity 0.18s ease;
  padding: 0 12px;
}
/* max-height: none, BUKAN angka tetap — update dengan banyak komentar atau
   lampiran melewati batas berapa pun yang dipatok dan isinya akan terpotong
   tanpa jejak. Konsekuensinya membuka tidak beranimasi tinggi (nilai auto tidak
   bisa diinterpolasi); yang tersisa transisi opacity, dan itu memadai. */
.update-collapse.open {
  max-height: none;
  opacity: 1;
  padding: 10px 12px;
}
.update-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}
.update-avatar-sm {
  width: 18px; height: 18px;
  background: linear-gradient(135deg, #94a3b8, #64748b);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px; font-weight: 700;
  flex-shrink: 0;
}
.update-footer-name {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.update-footer-time {
  font-size: 11px;
  color: #94a3b8;
}
.update-content {
  font-size: 13.5px;
  color: #111827;
  line-height: 1.65;
  word-break: break-word;
}
.update-img-thumb {
  width: 140px;
  height: 90px;
  border-radius: 6px;
  margin-top: 8px;
  cursor: pointer;
  object-fit: cover;
  display: block;
  border: 1px solid #e5e7eb;
  transition: transform .15s, box-shadow .15s;
}
.update-img-thumb:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.update-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.update-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 3px 10px 3px 8px;
  font-size: 12px;
  color: #475569;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.update-att-chip:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}
/* Attachment rename rows */
.attach-rename-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.attach-rename-row {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 5px 10px;
}
.attach-rename-row .attach-ext {
  font-size: 12px; font-weight: 600; color: #64748b;
  flex-shrink: 0; white-space: nowrap;
}

/* Update action buttons (edit + delete) */
.btn-update-action {
  background: none;
  border: none;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  color: #cbd5e1;
  transition: background .15s, color .15s;
  line-height: 1;
}
.btn-update-edit:hover  { background: #eff6ff; color: #3b82f6; }
.btn-update-delete:hover { background: #fee2e2; color: #ef4444; }

/* Update status badges */
.update-status-pending,
.update-status-in-progress,
.update-status-completed,
.update-status-cancel {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .2px;
}
.update-status-pending     { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.update-status-in-progress { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.update-status-completed   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.update-status-cancel      { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

/* Comments */
.update-comments { border-top: 1px solid #f1f5f9; padding-top: 10px; }
.update-comments-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.update-comment { display: flex; gap: 8px; align-items: flex-start; }
.update-comment-avatar {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, #94a3b8, #64748b);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 700;
  flex-shrink: 0; margin-top: 1px;
}
.update-comment-body {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 0;
}
.update-comment-meta {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px; flex-wrap: wrap;
}
.comment-role-badge {
  font-size: 10px; font-weight: 600;
  background: #eef2ff; color: #4338ca;
  border-radius: 4px; padding: 1px 5px;
}
.update-comment-content {
  font-size: 12.5px; color: #374151; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.btn-comment-delete {
  background: none; border: none;
  padding: 0 4px; border-radius: 4px;
  color: #cbd5e1; font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s;
  margin-left: auto;
}
.btn-comment-delete:hover { background: #fee2e2; color: #ef4444; }

.update-comment-compose {
  display: flex; gap: 6px; align-items: center;
}
.update-comment-compose .update-comment-avatar { flex-shrink: 0; }
.update-comment-compose .form-control { flex: 1; }

/* Remove attachment button inside edit form */
.btn-att-remove {
  display: inline-flex; align-items: center;
  background: none; border: none; padding: 0 2px;
  border-radius: 3px; color: #94a3b8; font-size: 13px; cursor: pointer;
  text-decoration: none;
  transition: color .15s;
}
.btn-att-remove:hover { color: #ef4444; }

/* History read more */
.btn-read-more {
  background: none; border: none; padding: 0 2px;
  font-size: 11px; color: #6366f1; cursor: pointer;
  text-decoration: underline;
}
.btn-read-more:hover { color: #4f46e5; }
.diff-full { font-size: 12px; color: #64748b; }

/* ============================================================
   UTILITIES
   ============================================================ */
.activity-description { line-height: 1.7; color: #374151; }
.badge-sm { font-size: 10px; padding: 2px 6px; }
a.text-decoration-none:hover { text-decoration: underline !important; }

/* Progress bar override */
.progress { background: #f1f5f9; }

/* Modal */
.modal-content { border-radius: 12px; border: 1px solid #e2e8f0; }
.modal-header { border-bottom: 1px solid #f1f5f9; padding: 16px 20px; }
.modal-footer { border-top: 1px solid #f1f5f9; }

/* ============================================================
   PMS / ASSET — TABS, OVERDUE ROWS, TIMELINE
   ============================================================ */
.page-tabs { border-bottom: 1px solid #e2e8f0; }
.page-tabs .nav-link {
  color: #64748b;
  font-weight: 500;
  font-size: 14px;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
}
.page-tabs .nav-link:hover { color: #6366f1; border-bottom-color: #c7d2fe; }
.page-tabs .nav-link.active {
  color: #6366f1;
  background: none;
  border-bottom-color: #6366f1;
}
tr.table-danger-subtle > td { background: #fef2f2; }
.pms-timeline li { position: relative; padding-left: 16px; }
.pms-timeline li::before {
  content: ''; position: absolute; left: 0; top: 5px;
  width: 8px; height: 8px; border-radius: 50%; background: #6366f1;
}

/* ============================================================
   SEARCHABLE DROPDOWN (asset manufacturer, etc.)
   ============================================================ */
.ss-menu {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 1060;
  margin-top: 2px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.ss-menu.show { display: block; }
.ss-item {
  padding: 7px 12px;
  font-size: 14px;
  cursor: pointer;
}
.ss-item:hover, .ss-item.active { background: #eef2ff; color: #4338ca; }
.ss-empty { padding: 7px 12px; font-size: 13px; color: #94a3b8; }

/* ============================================================
   ZIRALIS — gaya khusus modul CRM
   ============================================================ */

/* --- Alur dokumen: Penawaran → Kontrak → Project → Invoice --- */
.flow-steps {
  display: flex; align-items: stretch; gap: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: var(--card-radius);
  box-shadow: var(--card-shadow); overflow: hidden; margin-bottom: 20px;
}
.flow-step {
  flex: 1 1 0; padding: 14px 16px; position: relative;
  display: flex; align-items: center; gap: 12px; min-width: 0;
  text-decoration: none; color: inherit;
}
.flow-step + .flow-step { border-left: 1px solid #e2e8f0; }
.flow-step .fs-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: #f1f5f9; color: #64748b;
}
.flow-step .fs-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .4px; }
.flow-step .fs-value { font-size: 15px; font-weight: 600; color: #0f172a; line-height: 1.3;
                       white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-step.done    .fs-icon { background: #f0fdf4; color: #22c55e; }
.flow-step.current .fs-icon { background: #eef2ff; color: #6366f1; }
.flow-step.current { background: #fafaff; }
.flow-step.muted   { opacity: .55; }
@media (max-width: 767px) {
  .flow-steps { flex-direction: column; }
  .flow-step + .flow-step { border-left: 0; border-top: 1px solid #e2e8f0; }
}

/* --- Pratinjau dokumen di halaman detail --- */
.doc-preview {
  background: #fff; border: 1px solid #e2e8f0; border-radius: var(--card-radius);
  padding: 28px 30px; font-family: 'Times New Roman', Times, serif; color: #111;
}
.doc-preview .dp-head { border-bottom: 3px double #14532d; padding-bottom: 8px; margin-bottom: 16px; }
/* Logo di sisi kiri, teks kop tetap di tengah — bentuk yang sama dengan
   tampilan cetak (.letterhead.lh-center di layouts/print.php). Pembatas ukuran
   WAJIB ada: tanpa ini berkas logo tampil sebesar ukuran aslinya dan menutupi
   seluruh halaman. */
.doc-preview .dp-head { position: relative; min-height: 72px; }
.doc-preview .dp-head .logo {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  max-height: 68px; max-width: 140px; object-fit: contain;
}
.doc-preview .dp-head .lh-text { text-align: center; }

/* Tanda tangan pada pratinjau dokumen di layar — pasangan .sign-img di
   layouts/print.php. Tanpa pembatas ini gambarnya tampil sebesar ukuran
   aslinya, persis masalah yang dulu terjadi pada logo kop. */
.doc-preview .sign-img { height: 60px; max-width: 100%; object-fit: contain; display: block; margin: 2px 0; }
.doc-preview .dp-company { font-size: 20px; font-weight: 700; color: #14532d; line-height: 1.15; }
.doc-preview .dp-sub     { font-size: 12px; font-weight: 600; letter-spacing: 2px; color: #166534; }
.doc-preview .dp-slogan  { font-size: 11px; font-style: italic; color: #475569; }
.doc-preview .dp-contact { font-size: 10.5px; color: #475569; }
.doc-preview table.doc { width: 100%; border-collapse: collapse; font-size: 12px; }
.doc-preview table.doc th,
.doc-preview table.doc td { border: 1px solid #475569; padding: 4px 6px; vertical-align: top; }
.doc-preview table.doc thead th { background: #e8f0e8; text-align: center; font-weight: 700; }
.doc-preview table.doc .num { text-align: right; white-space: nowrap; }
.doc-preview table.doc .ctr { text-align: center; }
.doc-preview .sec-row  td { background: #f1f5f9; font-weight: 700; }
.doc-preview .tot-row  td { background: #fafafa; font-weight: 700; }
.doc-preview .grand-row td { background: #e8f0e8; font-weight: 700; }
.doc-preview .article-title { font-weight: 700; text-align: center; margin: 16px 0 6px; }
.doc-preview .article-body  { white-space: pre-wrap; text-align: justify; font-size: 13px; }
.doc-preview ul.doc-list { padding-left: 18px; }
.doc-preview ul.doc-list li { margin-bottom: 4px; text-align: justify; font-size: 13px; }

/* Metode dan Tahapan Kegiatan — di layar boleh menggulir mendatar bila
   tahapannya banyak; pada cetak dipadatkan (lihat layouts/print.php). */
.doc-preview .stage-block { margin-top: 24px; border-top: 1px dashed #cbd5e1; padding-top: 16px; overflow-x: auto; }
.doc-preview .stage-title { font-weight: 700; text-align: center; margin-bottom: 10px; }
.doc-preview table.stage-table { table-layout: fixed; min-width: 720px; font-size: 11px; }
.doc-preview table.stage-table td { vertical-align: top; }
.doc-preview table.stage-table ul.stage-points { padding-left: 14px; margin: 0; }
.doc-preview table.stage-table ul.stage-points li { font-size: 11px; text-align: left; margin-bottom: 3px; }

/* --- Baris dinamis pada formulir --- */
.row-builder { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.row-builder > table { margin-bottom: 0; }
.row-builder thead th {
  background: #f8fafc; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .4px; color: #64748b; padding: 8px 8px; white-space: nowrap;
  border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 2;
}
.row-builder td { padding: 5px 6px; vertical-align: top; border-top: 1px solid #f1f5f9; }
.row-builder .form-control, .row-builder .form-select { font-size: 13px; padding: 5px 8px; }
/* Uraian Pekerjaan & Keterangan hanya boleh dilebarkan ke bawah — resize
   mendatar (bawaan browser) merusak lebar kolom tabel BOQ. */
.row-builder textarea.form-control { resize: vertical; min-height: 34px; }
.row-builder .form-control-sm { min-width: 60px; }
.row-builder tr.sec-builder-row td { background: #f8fafc; }
.builder-scroll { max-height: 560px; overflow: auto; }

/* Kolom Jumlah yang diisi manual berhenti dihitung otomatis (mis. baris
   "charge by progres"). Ditandai supaya jelas kenapa baris itu tidak ikut
   berubah saat harga satuan disunting — kosongkan kolomnya untuk kembali
   otomatis. */
.row-builder .calc-amount[data-manual="1"] {
  background: #fffbeb;
  border-color: #fcd34d;
}
.col-narrow  { width: 78px;  }
.col-tiny    { width: 58px;  }
.col-money   { width: 138px; }
.col-actions { width: 74px;  }

/* Baris multi-upload (data-multi-upload): berkas terpilih tampil di samping
   nama tampilannya — nama berkas panjang dipotong, bukan melebarkan baris. */
.mu-file { max-width: 14rem; }

/* Baris tombol simpan pada formulir lebar penuh — menempel di bawah layar
   supaya tetap terjangkau walau tabel BOQ panjang. */
.form-actions-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  padding: 12px 16px; margin-top: 4px;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: var(--card-radius); box-shadow: 0 -2px 8px rgba(15,23,42,.06);
}

/* --- Ringkasan nilai dokumen --- */
.totals-box {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px;
}
.totals-box .tr { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; font-size: 14px; }
.totals-box .tr.grand {
  border-top: 2px solid #cbd5e1; margin-top: 6px; padding-top: 8px;
  font-size: 17px; font-weight: 700; color: #0f172a;
}

/* --- Kartu ringkas dokumen terkait --- */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { text-decoration: none; color: #1e293b; font-weight: 500; }
.mini-list a:hover { color: #6366f1; }
.mini-meta { font-size: 11.5px; color: #94a3b8; }

/* --- Portal klien: kotak aksi persetujuan --- */
.client-action-box {
  border: 2px dashed #c7d2fe; background: #f5f7ff;
  border-radius: var(--card-radius); padding: 20px;
}
.client-action-box.warn   { border-color: #fde68a; background: #fffbeb; }
.client-action-box.done   { border-color: #bbf7d0; background: #f0fdf4; border-style: solid; }

/* --- Progress bar aktivitas --- */
.progress-slim { height: 6px; border-radius: 4px; background: #f1f5f9; }
.progress-slim .progress-bar { border-radius: 4px; }
.activity-row td { vertical-align: middle; }

/* --- Baris revisi kontrak --- */
.revision-item { border-left: 3px solid #f59e0b; background: #fffbeb; border-radius: 8px;
                 padding: 12px 14px; margin-bottom: 10px; }
.revision-item.resolved { border-left-color: #22c55e; background: #f0fdf4; }
.revision-reply { border-left: 2px solid #cbd5e1; margin-top: 8px; padding-left: 10px;
                  font-size: 13px; color: #475569; }

@media print { .sidebar, .topbar, .main-footer, .no-print { display: none !important; } }
