/* public/css/style.css */
:root {
  --primary: #0078d4;
  --primary-hover: #106ebe;
  --primary-light: #e6f2fb;
  --bg-body: #f4f7fa;
  --surface: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* Status Colors */
  --status-standby-bg: #ecfdf5;
  --status-standby-text: #059669;
  --status-standby-border: #a7f3d0;
  
  --status-dipinjam-bg: #fffbeb;
  --status-dipinjam-text: #d97706;
  --status-dipinjam-border: #fde68a;

  --status-serahterima-bg: #eff6ff;
  --status-serahterima-text: #2563eb;
  --status-serahterima-border: #bfdbfe;

  --status-service-bg: #fef2f2;
  --status-service-text: #dc2626;
  --status-service-border: #fecaca;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px 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-hover: 0 12px 20px -3px rgba(0,0,0,0.1), 0 4px 6px -4px 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-body);
  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: var(--shadow-sm);
}

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

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

.brand-logo-badge {
  background: linear-gradient(135deg, #0078d4, #005a9e);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.35);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(0, 120, 212, 0.25);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--border-light);
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--border-light);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.user-info .user-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.user-info .user-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

/* Hero Section */
.hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: white;
  padding: 2.5rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(0, 120, 212, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-container {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 650px;
  margin-bottom: 1.5rem;
}

/* Stats Counter */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stat-icon {
  font-size: 1.25rem;
}

.stat-number {
  font-size: 1.2rem;
  font-weight: 800;
  display: block;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.725rem;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Main Content Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

/* Filter Controls Box */
.controls-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

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

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #fafbfc;
}

.search-input:focus {
  outline: none;
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

.filter-selects {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.select-wrapper {
  position: relative;
}

.custom-select {
  appearance: none;
  background: #fafbfc;
  border: 1px solid var(--border);
  padding: 0.65rem 2.2rem 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s;
}

.custom-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

.select-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Category Pills */
.category-pills-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.category-pills-row::-webkit-scrollbar {
  height: 4px;
}
.category-pills-row::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.pill-btn {
  background: var(--border-light);
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: inherit;
}

.pill-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.pill-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Grid Device Cards */
.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: var(--text-main);
}

.catalog-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Marketplace Card Design */
.device-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

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

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

.device-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.status-badge {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid;
}

.status-standby {
  background: var(--status-standby-bg);
  color: var(--status-standby-text);
  border-color: var(--status-standby-border);
}

.status-dipinjam {
  background: var(--status-dipinjam-bg);
  color: var(--status-dipinjam-text);
  border-color: var(--status-dipinjam-border);
}

.status-serahterima {
  background: var(--status-serahterima-bg);
  color: var(--status-serahterima-text);
  border-color: var(--status-serahterima-border);
}

.status-service {
  background: var(--status-service-bg);
  color: var(--status-service-text);
  border-color: var(--status-service-border);
}

.card-title-group {
  margin-bottom: 0.75rem;
}

.device-type-tag {
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--primary);
}

.device-model-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.15rem;
  line-height: 1.3;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-item strong {
  color: var(--text-main);
}

.location-chip {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
}

/* Specs Box */
.specs-container {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spec-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.785rem;
}

.spec-key {
  color: var(--text-muted);
}

.spec-val {
  font-weight: 600;
  color: var(--text-main);
}

/* Card Footer Action */
.card-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.serial-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.btn-request {
  background: var(--surface);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-request:hover {
  background: var(--primary);
  color: white;
}

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

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

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Loading & Toast Notification */
.loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--text-muted);
  font-weight: 600;
  grid-column: 1 / -1;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Modal Popup */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

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

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.4rem;
  }
  .controls-card {
    padding: 1rem;
  }
  .search-row {
    flex-direction: column;
  }
  .filter-selects {
    width: 100%;
  }
  .custom-select {
    width: 100%;
  }
  .device-grid {
    grid-template-columns: 1fr;
  }
}

/* ====================================================
   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;
}
