/* public/css/style.css - IT Monitoring Service Mitra Keluarga */
:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  --accent: #059669;
  --accent-light: #d1fae5;
  
  --bg-page: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Status Colors */
  --status-progress-bg: #fffbeb;
  --status-progress-text: #b45309;
  --status-progress-border: #fde68a;

  --status-sparepart-bg: #fef3c7;
  --status-sparepart-text: #d97706;
  --status-sparepart-border: #fcd34d;

  --status-qc-bg: #eff6ff;
  --status-qc-text: #1d4ed8;
  --status-qc-border: #bfdbfe;

  --status-ready-bg: #f0fdf4;
  --status-ready-text: #15803d;
  --status-ready-border: #bbf7d0;

  --status-done-bg: #ecfdf5;
  --status-done-text: #047857;
  --status-done-border: #a7f3d0;

  --status-danger-bg: #fef2f2;
  --status-danger-text: #b91c1c;
  --status-danger-border: #fecaca;

  /* Spacing & Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 14px 24px -4px rgba(2, 132, 199, 0.12), 0 6px 12px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 8px rgba(2, 132, 199, 0.3);
}

.brand-text h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Nav Portal Switcher Button */
.nav-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-switch-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-ms-list {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.btn-ms-list:hover {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.live-badge {
  font-size: 0.78rem;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0369a1 100%);
  color: #ffffff;
  padding: 2.25rem 1.5rem 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 35%;
  background: radial-gradient(circle at right center, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-container {
  max-width: 1400px;
  margin: 0 auto;
}

.hero-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.hero-text h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.hero-text p {
  color: #94a3b8;
  font-size: 0.95rem;
  max-width: 720px;
}

/* Quick Metrics Cards */
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, background 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.stat-icon {
  font-size: 1.75rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
}

.stat-label {
  font-size: 0.75rem;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: 2px;
}

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: -1.25rem auto 3rem auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 10;
}

/* Mika Hospital Branch Tabs (Like MS List View Tabs) */
.mika-tabs-wrapper {
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 0.75rem 1.25rem 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow-x: auto;
}

.mika-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.6rem;
}

.mika-tab-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  position: relative;
}

.mika-tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.mika-tab-btn.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.mika-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.6rem;
  left: 0.5rem;
  right: 0.5rem;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* Filter Controls Box */
.controls-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-box-wrapper {
  flex: 1 1 320px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: #f8fafc;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.select-filters-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.custom-select {
  padding: 0.65rem 2rem 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  background: #f8fafc;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1rem;
  transition: all 0.2s;
}

.custom-select:focus {
  border-color: var(--primary);
  background-color: #ffffff;
}

.view-toggle-group {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.view-btn {
  background: transparent;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}

.view-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Catalog Sub-header */
.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.catalog-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.catalog-count-badge {
  font-size: 0.8rem;
  background: #e2e8f0;
  color: #475569;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Service Card Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.25rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: #38bdf8;
  box-shadow: var(--shadow-card-hover);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.mika-badge {
  background: #0284c7;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* 3 Kondisi Status Sesuai Microsoft List SharePoint */
.status-progress {
  background: #966000;
  color: #ffffff;
  border-color: #784e00;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(150, 96, 0, 0.2);
}

.status-done {
  background: #237804;
  color: #ffffff;
  border-color: #1b5e03;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(35, 120, 4, 0.2);
}

.status-cancel {
  background: #b91c1c;
  color: #ffffff;
  border-color: #991b1b;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(185, 28, 28, 0.2);
}

.card-device-info {
  margin-bottom: 0.85rem;
}

.device-type-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  display: block;
}

.device-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.device-sn {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  display: inline-block;
  margin-top: 4px;
}

.card-department-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
}

/* Kerusakan Box */
.card-problem-box {
  background: #fff7ed;
  border-left: 3px solid #f97316;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #9a3412;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Latest Follow-up Box */
.card-followup-box {
  background: #ecfdf5;
  border-left: 3px solid #10b981;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #065f46;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.followup-badge-title {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #047857;
  display: block;
  margin-bottom: 2px;
}

.followup-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta Data Grid in Card */
.card-meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.meta-field span:first-child {
  color: var(--text-subtle);
  display: block;
  font-size: 0.7rem;
}

.meta-field span:last-child {
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Action Footer */
.card-footer {
  margin-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pickup-date-chip {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
}

.btn-open-detail {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.service-card:hover .btn-open-detail {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Table View */
.table-responsive {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.service-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.service-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.service-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: #1e293b;
  vertical-align: middle;
}

.service-table tbody tr {
  transition: background 0.15s;
  cursor: pointer;
}

.service-table tbody tr:hover {
  background: #f1f5f9;
}

/* Empty State */
.empty-state {
  background: var(--surface);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* Loading State */
.loading-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e0f2fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem auto;
}

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

/* ==============================================================
   DETAIL MODAL / POP-UP STYLES
   ============================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 960px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-device-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.modal-title-group h3 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal-title-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

/* Stepper / Timeline Ribbon */
.process-stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.process-stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 2rem;
  right: 2rem;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 120px;
}

.step-node {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}

.step-item.completed .step-node {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.step-item.completed .step-label {
  color: #065f46;
  font-weight: 700;
}

.step-item.active .step-node {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.25);
  animation: pulse-step 2s infinite ease-in-out;
}

.step-item.active .step-label {
  color: #0284c7;
  font-weight: 800;
}

@keyframes pulse-step {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Modal Sections */
.modal-section {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 0.88rem;
  font-weight: 750;
  color: #1e293b;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 2px;
}

.detail-value {
  font-size: 0.85rem;
  font-weight: 650;
  color: #0f172a;
}

/* Follow-up Timeline Log */
.timeline-log {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid #cbd5e1;
  margin-left: 0.5rem;
}

.log-entry {
  position: relative;
  margin-bottom: 1rem;
}

.log-entry:last-child {
  margin-bottom: 0;
}

.log-dot {
  position: absolute;
  left: -1.95rem;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0284c7;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px #0284c7;
}

.log-date {
  font-size: 0.74rem;
  font-weight: 750;
  color: #0284c7;
  display: block;
}

.log-text {
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.4;
  margin-top: 2px;
}

/* Modal Footer */
.modal-footer {
  padding: 1rem 1.75rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal-footer-left {
  display: flex;
  gap: 0.6rem;
}

.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
}
.btn-whatsapp:hover {
  background: #1eb956;
}

.btn-outline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .process-stepper {
    flex-direction: column;
    gap: 1rem;
    padding: 0;
  }
  .process-stepper::before {
    display: none;
  }
  .step-item {
    flex-direction: row;
    max-width: none;
    gap: 0.75rem;
    text-align: left;
  }
  .step-node {
    margin-bottom: 0;
  }
}

/* ====================================================
   Hierarchical Dropdown Menu: Services
   ==================================================== */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #f0fdf4;
  color: #047857;
  border: 1px solid #bbf7d0;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.nav-dropdown-btn:hover,
.nav-dropdown.active .nav-dropdown-btn,
.nav-dropdown:focus-within .nav-dropdown-btn {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.dropdown-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .dropdown-chevron,
.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown:focus-within .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 200;
  transform-origin: top right;
  animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownPop {
  0% { opacity: 0; transform: translateY(-6px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.is-open .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: flex;
}

.dropdown-header {
  padding: 0.35rem 0.65rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: #0f172a;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: #0284c7;
}

.dropdown-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dropdown-icon-box.blue {
  background: #e0f2fe;
  color: #0284c7;
}

.dropdown-icon-box.amber {
  background: #fef3c7;
  color: #d97706;
}

.dropdown-icon-box.emerald {
  background: #d1fae5;
  color: #059669;
}

.dropdown-info {
  display: flex;
  flex-direction: column;
}

.dropdown-title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}

.dropdown-subtitle {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.2;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0.25rem 0;
}


/* ====================================================
   UNIFIED SIDEBAR NAVIGATION SYSTEM (RS MITRA KELUARGA)
   ==================================================== */
:root {
  --sidebar-width: 270px;
  --sidebar-width-collapsed: 74px;
  --topbar-height: 58px;
}

body {
  height: 100vh !important;
  overflow: hidden !important;
}

.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 140;
}

.app-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 150;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.04);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.sidebar-header {
  padding: 1rem 1.15rem;
  height: var(--topbar-height);
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  min-width: 0;
}

.brand-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.brand-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.brand-info h2 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.brand-info .badge-mika {
  font-size: 0.65rem;
  font-weight: 800;
  background: #e0f2fe;
  color: #0284c7;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.brand-info p {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
  margin: 0;
}

.btn-sidebar-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-sidebar-toggle:hover {
  background: #f1f5f9;
  color: #0284c7;
  border-color: #cbd5e1;
}

.btn-sidebar-toggle .icon-toggle {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 0.6rem 0.65rem 0.25rem;
  white-space: nowrap;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sidebar-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-item.active {
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 700;
}

.nav-item-icon {
  font-size: 1.15rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-ext-arrow {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-left: auto;
}

/* Nav Group Accordion */
.nav-group {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
}

.nav-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #047857;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: left;
}

.nav-group-header:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.group-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-group.is-open .group-chevron {
  transform: rotate(180deg);
}

.nav-group-items {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem 0 0.35rem 0.85rem;
  position: relative;
  border-left: 2px solid #e2e8f0;
  margin-left: 1.25rem;
  margin-top: 0.25rem;
}

.nav-group.is-open .nav-group-items {
  display: flex;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  text-decoration: none;
  color: #64748b;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-sub-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-sub-item.active {
  background: #eff6ff;
  color: #0284c7;
  font-weight: 700;
  border-left: 3px solid #0284c7;
  padding-left: calc(0.65rem - 3px);
}

.sub-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.sub-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.sub-title {
  font-size: 0.82rem;
  line-height: 1.2;
}

.sub-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.badge-blue {
  background: #e0f2fe;
  color: #0284c7;
}

.badge-amber {
  background: #fef3c7;
  color: #d97706;
}

.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}

.status-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.status-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
}

.status-subtitle {
  font-size: 0.68rem;
  color: #64748b;
}

/* Collapsed Mini Sidebar */
.app-sidebar.is-collapsed {
  width: var(--sidebar-width-collapsed);
}

.app-sidebar.is-collapsed .brand-info,
.app-sidebar.is-collapsed .nav-item-text,
.app-sidebar.is-collapsed .nav-section-title,
.app-sidebar.is-collapsed .sub-text,
.app-sidebar.is-collapsed .item-ext-arrow,
.app-sidebar.is-collapsed .status-info,
.app-sidebar.is-collapsed .group-chevron {
  display: none !important;
}

.app-sidebar.is-collapsed .btn-sidebar-toggle .icon-toggle {
  transform: rotate(180deg);
}

.app-sidebar.is-collapsed .sidebar-header {
  justify-content: center;
  padding: 0.75rem 0.5rem;
}

.app-sidebar.is-collapsed .sidebar-brand {
  display: none;
}

.app-sidebar.is-collapsed .sidebar-item,
.app-sidebar.is-collapsed .nav-group-header {
  justify-content: center;
  padding: 0.65rem 0.5rem;
}

.app-sidebar.is-collapsed .nav-group-items {
  margin-left: 0;
  padding-left: 0;
  border-left: none;
  align-items: center;
}

.app-sidebar.is-collapsed .nav-sub-item {
  justify-content: center;
  padding: 0.6rem 0.5rem;
  border-left: none;
}

.app-sidebar.is-collapsed .sidebar-footer {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0;
}

/* Main Viewport & Scroll Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.main-topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  z-index: 50;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.btn-mobile-menu {
  display: none;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.35rem;
  color: #64748b;
  cursor: pointer;
}

.btn-mobile-menu:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.85rem;
}

.crumb-root {
  color: #64748b;
  font-weight: 600;
}

.crumb-sep {
  color: #94a3b8;
}

.crumb-current {
  font-weight: 800;
  color: #0f172a;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.main-content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - var(--topbar-height));
}

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

  .app-sidebar.is-mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.is-mobile-open {
    display: block;
  }

  .btn-mobile-menu {
    display: flex;
  }

  .btn-sidebar-toggle {
    display: none;
  }

  .main-topbar {
    padding: 0 0.85rem;
  }
}

.badge-emerald {
  background: #d1fae5;
  color: #059669;
}

/* Dokumen Aset Group & OneDrive Badge */
.nav-group-header.doc-header {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  margin-top: 0.2rem;
}

.nav-group-header.doc-header:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.badge-onedrive {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}
