/* ==============================================================================
   AQL (AMANI BRAIN) - PROPERTY WEB AGENT STYLESHEET
   Master Design System Matching Control Tower Layout (v3.0)
   Compact 70% Scaled Sidebar with Interactive Floating Tooltips on Collapse
   ============================================================================== */

:root {
  --amani-navy: #0B192C;
  --amani-navy-dark: #070F1E;
  --amani-navy-light: #1E293B;
  --amani-cyan: #0284C7;
  --amani-cyan-light: #E0F2FE;
  --amani-cyan-hover: #0369A1;
  --amani-teal: #0D9488;
  --amani-yellow: #F59E0B;
  --amani-yellow-light: #FEF3C7;
  --amani-green: #10B981;
  --amani-red: #EF4444;
  --amani-purple: #8B5CF6;
  
  --bg-app: #F8FAFC;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border-color: #E2E8F0;
  --border-subtle: #F1F5F9;

  /* 70% Scaled Sidebar Dimensions */
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 54px;
  --topbar-height: 58px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body, button, input, select, textarea {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================================================
   1. COMPACT LEFT SIDEBAR (70% SCALE & ICON-ONLY COLLAPSE WITH TOOLTIPS)
   ============================================================================== */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--amani-navy);
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.brand-box {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.brand-logo-full {
  height: 25px; /* 70% scale */
  object-fit: contain;
  display: block;
  transition: var(--transition);
}

.sidebar.collapsed .brand-box {
  display: none !important;
}

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  width: 26px; /* 70% scale */
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.toggle-svg {
  transition: transform 0.25s ease;
}

.sidebar.collapsed .toggle-svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  align-items: center;
  padding: 0;
}

.sidebar.collapsed .sidebar-toggle-btn {
  margin: 0 auto;
}

/* ==============================================================================
   SIDEBAR NAV ITEMS (COMPACT 70% SCALE & TOOLTIPS ON COLLAPSE)
   ============================================================================== */
.sidebar-nav {
  flex: 1;
  padding: 0.55rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.sidebar-nav-item {
  width: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.5rem;
  padding: 0.38rem 0.52rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: #94A3B8;
  font-family: inherit;
  font-size: calc(0.72rem + 2px); /* Ditambahkan 2px */
  font-weight: 600;
  text-align: left !important;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.sidebar-nav-item.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.28) 0%, rgba(2, 132, 199, 0.12) 100%);
  color: #BAE6FD;
  border-left: 2.5px solid var(--amani-cyan);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.nav-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-icon svg {
  width: 17px !important;
  height: 17px !important;
  stroke-width: 2 !important;
  display: block;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left !important;
}

/* Sidebar Collapsible Submenu */
.sidebar-nav-group {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-nav-item .submenu-chevron {
  margin-left: auto;
  transition: transform 0.2s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
}

.sidebar-nav-item:hover .submenu-chevron {
  color: #FFFFFF;
}

.sidebar-nav-item.active .submenu-chevron {
  color: #BAE6FD;
}

.sidebar-nav-group.expanded .submenu-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: none;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.45rem 0 0.35rem 1.65rem;
  position: relative;
}

.sidebar-nav-group.expanded .sidebar-submenu {
  display: flex;
}

.sidebar-submenu-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.45rem;
  background: transparent;
  border: none;
  padding: 0.1rem 0;
  color: #94A3B8;
  font-family: inherit;
  font-size: calc(0.72rem + 2px); /* Ditambahkan 2px, sama dengan menu induk */
  font-weight: 400;
  text-align: left !important;
  cursor: pointer;
  transition: color 0.15s ease;
  white-space: nowrap;
  outline: none;
}

.sidebar-submenu-item:hover {
  color: #E2E8F0;
}

.sidebar-submenu-item.active {
  color: #38BDF8 !important;
  font-weight: 600 !important;
}

/* Bullet Dot */
.sidebar-submenu-item .submenu-dot {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: #94A3B8;
  flex-shrink: 0;
  display: inline-block;
  transition: background-color 0.15s ease;
}

.sidebar-submenu-item:hover .submenu-dot {
  background: #E2E8F0;
}

.sidebar-submenu-item.active .submenu-dot {
  background: #38BDF8 !important;
}

.sidebar.collapsed .sidebar-submenu {
  display: none !important;
}

.sidebar.collapsed .submenu-chevron {
  display: none;
}

/* Collapsed Nav Item State */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width) !important;
}

.sidebar.collapsed .sidebar-header {
  height: 52px;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.sidebar.collapsed .sidebar-toggle-btn {
  width: 34px !important;
  height: 34px !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
}

.sidebar.collapsed .sidebar-nav {
  padding: 0.55rem 0.35rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.sidebar.collapsed .sidebar-nav-group {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.sidebar.collapsed .sidebar-nav-item {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  border-left: none !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
}

.sidebar.collapsed .sidebar-nav-item .nav-icon {
  margin: 0 !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.sidebar.collapsed .sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #FFFFFF !important;
}

.sidebar.collapsed .sidebar-nav-item.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.38) 0%, rgba(2, 132, 199, 0.18) 100%) !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  border-left: 1px solid rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.28) !important;
}

.sidebar.collapsed .nav-label {
  display: none !important;
}

/* ==============================================================================
   FLOATING TOOLTIP HINTS ON COLLAPSE
   ============================================================================== */
.sidebar.collapsed .sidebar-nav-item[data-tooltip]::after,
.sidebar.collapsed .sidebar-project-select-box[data-tooltip]::after,
.sidebar.collapsed .sidebar-ext-link[data-tooltip]::after,
.sidebar.collapsed .sidebar-user-card[data-tooltip]::after {
  content: attr(data-tooltip);
  position: fixed;
  left: calc(var(--sidebar-collapsed-width) + 8px);
  background: #070F1E;
  color: #F8FAFC;
  border: 1px solid rgba(2, 132, 199, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateX(-4px);
  z-index: 9999;
}

.sidebar.collapsed .sidebar-nav-item:hover[data-tooltip]::after,
.sidebar.collapsed .sidebar-project-select-box:hover[data-tooltip]::after,
.sidebar.collapsed .sidebar-ext-link:hover[data-tooltip]::after,
.sidebar.collapsed .sidebar-user-card:hover[data-tooltip]::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Sidebar Separator */
.sidebar-separator {
  margin: 0.4rem 0 0.2rem 0;
  padding: 0.3rem 0.4rem 0.1rem 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-separator-title {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
}

.sidebar.collapsed .sidebar-separator {
  width: 32px !important;
  margin: 0.45rem auto !important;
  padding: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  display: flex !important;
  justify-content: center !important;
}

.sidebar.collapsed .sidebar-separator-title {
  display: none !important;
}

/* Sidebar Embedded Project Dropdown */
.sidebar-project-select-box {
  margin-bottom: 0.35rem;
  padding: 0 0.15rem;
  position: relative;
}

.sidebar-project-dropdown-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.45rem;
  gap: 0.35rem;
  position: relative;
  transition: var(--transition);
}

.sidebar-project-dropdown-wrapper:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--amani-cyan);
}

.sidebar-project-icon {
  width: 17px !important;
  height: 17px !important;
  stroke-width: 2 !important;
  display: block;
  flex-shrink: 0;
}

.sidebar-project-select {
  width: 100%;
  border: none !important;
  background: transparent !important;
  color: #BAE6FD;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  outline: none !important;
  cursor: pointer;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  padding: 0;
}

.sidebar-project-select option {
  background: var(--amani-navy);
  color: #F8FAFC;
}

.sidebar.collapsed .sidebar-project-select-box {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 auto 0.25rem auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.sidebar.collapsed .sidebar-project-dropdown-wrapper {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(2, 132, 199, 0.35) !important;
}

.sidebar.collapsed .sidebar-project-dropdown-wrapper svg {
  width: 17px !important;
  height: 17px !important;
  margin: 0 auto !important;
}

.sidebar.collapsed .sidebar-project-select {
  display: none !important;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.5rem 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-footer {
  padding: 0.6rem 0.35rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

.sidebar-ext-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.45rem;
  color: #94A3B8;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.sidebar-ext-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--amani-cyan-light);
}

.sidebar.collapsed .sidebar-ext-link {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
}

.sidebar.collapsed .sidebar-ext-link .nav-icon {
  margin: 0 !important;
}

.sidebar.collapsed .sidebar-ext-link .nav-label {
  display: none !important;
}

.sidebar-user-card {
  margin-top: 0.2rem;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-user-card {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
}

.sidebar.collapsed .user-info-text {
  display: none !important;
}

.user-avatar-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amani-cyan), #0284C7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.62rem;
  flex-shrink: 0;
}

.sidebar.collapsed .user-avatar-dot {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.65rem !important;
  margin: 0 auto !important;
}

.user-info-text {
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.collapsed .user-info-text {
  display: none !important;
}

.user-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: #F1F5F9;
}

.user-role {
  font-size: 0.58rem;
  color: #94A3B8;
}

/* ==============================================================================
   2. MAIN CONTAINER & TOP BAR
   ============================================================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-app);
  overflow-x: hidden;
  box-sizing: border-box;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
  max-width: calc(100vw - var(--sidebar-collapsed-width));
}

.top-bar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.top-bar-left .page-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--amani-navy);
  letter-spacing: -0.02em;
}

.top-bar-left .page-subtitle {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 0.05rem;
}

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

.active-project-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #F0F9FF;
  border: 1.5px solid #BAE6FD;
  color: var(--amani-cyan-hover);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ==============================================================================
   3. TAB VIEWS
   ============================================================================== */
.tab-view {
  display: none;
  padding: 1.35rem 1.5rem;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  animation: fadeIn 0.22s ease-in-out;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   4. CHAT LAYOUT (TAB 1: AMANI PROPERTY AI)
   ============================================================================== */
.chat-layout {
  display: flex;
  gap: 1.15rem;
  height: calc(100vh - var(--topbar-height) - 2.7rem);
  position: relative;
}

.preset-panel {
  width: 260px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  flex-shrink: 0;
}

.preset-panel.collapsed {
  width: 0;
  padding: 0;
  margin: 0;
  border: none;
  opacity: 0;
  pointer-events: none;
}

.recent-header {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFBFD;
}

.recent-header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--amani-navy);
}

.recent-header-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-clear-history, .btn-collapse-history {
  background: transparent;
  border: none;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-clear-history:hover, .btn-collapse-history:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.recent-queries-list {
  flex: 1;
  padding: 0.55rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.recent-query-item {
  padding: 0.5rem 0.65rem;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.recent-query-item:hover {
  background: var(--amani-cyan-light);
  border-color: #BAE6FD;
  color: var(--amani-cyan-hover);
  transform: translateX(2px);
}

.btn-expand-history {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 30;
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.btn-expand-history.show {
  display: inline-flex;
}

.btn-expand-history:hover {
  background: var(--amani-cyan-light);
  color: var(--amani-cyan-hover);
}

.chat-box {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.chat-messages {
  flex: 1;
  padding: 1.15rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.msg {
  display: flex;
  gap: 0.75rem;
  max-width: 88%;
  animation: fadeIn 0.2s ease-out;
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg.agent {
  align-self: flex-start;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.msg.agent .msg-avatar {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
}

.msg.user .msg-avatar {
  background: var(--amani-navy);
  color: white;
  font-weight: 700;
  font-size: 0.74rem;
}

.msg-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 100%;
}

.msg-header-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.msg-author-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--amani-cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msg.user .msg-author-tag {
  color: var(--text-muted);
  text-align: right;
  width: 100%;
}

.msg-body {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-lg);
  font-size: 0.86rem;
  line-height: 1.55;
  position: relative;
  word-wrap: break-word;
}

.msg.agent .msg-body {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-top-left-radius: 4px;
}

.msg.user .msg-body {
  background: linear-gradient(135deg, var(--amani-navy) 0%, #1E3A8A 100%);
  color: #FFFFFF;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(11, 25, 44, 0.15);
}

.msg-body h1, .msg-body h2, .msg-body h3, .msg-body h4 {
  margin-top: 0.55rem;
  margin-bottom: 0.3rem;
  color: var(--amani-navy);
  font-weight: 700;
}
.msg.user .msg-body h1, .msg.user .msg-body h2, .msg.user .msg-body h3 {
  color: #FFFFFF;
}

.msg-body p { margin-bottom: 0.4rem; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body ul, .msg-body ol { margin-left: 1.15rem; margin-bottom: 0.5rem; }
.msg-body li { margin-bottom: 0.18rem; }

.msg-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.65rem 0;
  font-size: 0.8rem;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.msg-body th, .msg-body td {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border-color);
  text-align: left;
}
.msg-body th {
  background: #F1F5F9;
  font-weight: 700;
  color: var(--amani-navy);
}

.msg-body blockquote {
  border-left: 3px solid var(--amani-cyan);
  padding: 0.4rem 0.65rem;
  background: rgba(2, 132, 199, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.5rem 0;
  font-size: 0.82rem;
  color: #0369A1;
}

.msg-body code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.82em;
}
.msg.user .msg-body code {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.chat-property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.chat-prop-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 0.65rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.chat-prop-card:hover {
  border-color: var(--amani-cyan);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.chat-prop-title { font-size: 0.8rem; font-weight: 700; color: var(--amani-navy); }
.chat-prop-price { font-size: 0.88rem; font-weight: 800; color: var(--amani-cyan); }
.chat-prop-meta { font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }

.chat-prop-actions { display: flex; gap: 0.3rem; margin-top: 0.3rem; }

.btn-chip-action {
  flex: 1;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: #FAFBFD;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.btn-chip-action:hover {
  background: var(--amani-cyan);
  color: #FFFFFF;
  border-color: var(--amani-cyan);
}

.suggested-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.prompt-chip {
  padding: 0.3rem 0.65rem;
  background: #FFFFFF;
  border: 1px solid #BAE6FD;
  color: var(--amani-cyan-hover);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.prompt-chip:hover {
  background: var(--amani-cyan);
  color: #FFFFFF;
  border-color: var(--amani-cyan);
}

.chat-input-container {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
}

/* Attachments Preview Bar */
.chat-attachments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0 1rem;
  background: #FFFFFF;
}

.chat-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--amani-navy);
  animation: fadeIn 0.15s ease-out;
}

.chat-attachment-chip img {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}

.chat-attachment-remove {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.chat-attachment-remove:hover {
  color: #EF4444;
  background: #FEE2E2;
}

.chat-input-bar {
  padding: 0.65rem 1rem 0.85rem 1rem;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  position: relative;
}

/* Chat Attachment Button & Dropdown */
.chat-attach-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.chat-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.chat-attach-btn:hover,
.chat-attach-btn.active {
  background: #E0F2FE;
  color: var(--amani-cyan-hover);
  border-color: #BAE6FD;
  transform: scale(1.05);
}

.chat-attach-dropdown {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px -4px rgba(11, 25, 44, 0.18), 0 8px 10px -4px rgba(11, 25, 44, 0.08);
  min-width: 230px;
  padding: 0.4rem;
  z-index: 120;
  display: none;
  animation: fadeIn 0.15s ease-out;
}

.chat-attach-dropdown.show {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-attach-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  background: transparent;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-main);
}

.chat-attach-item:hover {
  background: #F1F5F9;
  color: var(--amani-cyan-hover);
}

.attach-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.attach-icon-file {
  background: rgba(2, 132, 199, 0.08);
  color: var(--amani-cyan-hover);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.attach-icon-gdrive {
  background: rgba(5, 150, 105, 0.08);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.attach-icon-onedrive {
  background: rgba(14, 165, 233, 0.08);
  color: #0284C7;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.chat-attach-item:hover .attach-icon-file {
  background: var(--amani-cyan);
  color: #FFFFFF;
}

.chat-attach-item:hover .attach-icon-gdrive {
  background: #059669;
  color: #FFFFFF;
}

.chat-attach-item:hover .attach-icon-onedrive {
  background: #0284C7;
  color: #FFFFFF;
}

.chat-attach-item .attach-text {
  display: flex;
  flex-direction: column;
}

.chat-attach-item .attach-text strong {
  font-size: 0.78rem;
  color: var(--amani-navy);
}

.chat-attach-item .attach-text small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.chat-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
  background: #FAFBFD;
}
.chat-input:focus {
  border-color: var(--amani-cyan);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.15rem;
  background: linear-gradient(135deg, var(--amani-cyan) 0%, #0284C7 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
  flex-shrink: 0;
}
.send-btn:hover {
  background: linear-gradient(135deg, #0369A1 0%, #075985 100%);
  transform: translateY(-1px);
}

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.55rem 0.85rem;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ==============================================================================
   5. COMMON UI CARDS, KPI GRIDS, FORMS & TABLES
   ============================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #BAE6FD;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kpi-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--amani-navy);
  margin: 0.25rem 0 0.1rem 0;
}
.kpi-sub {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--amani-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.navy-card {
  background: linear-gradient(145deg, var(--amani-navy) 0%, #0F284E 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.view-mode-toggle-group {
  display: inline-flex;
  align-items: center;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.view-mode-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.view-mode-icon-btn:hover {
  background: #FFFFFF;
  color: var(--amani-cyan-hover);
  border-color: #CBD5E1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.view-mode-icon-btn.active {
  background: #FFFFFF;
  color: var(--amani-cyan-hover);
  border-color: #BAE6FD;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.18);
}

/* ==============================================================================
   3-DOTS ACTION DROPDOWN MENU
   ============================================================================== */
.action-menu-container {
  position: relative;
  display: inline-block;
}

.action-dots-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #64748B;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 0;
}

.action-dots-btn:hover,
.action-dots-btn.active {
  background: #F1F5F9;
  color: var(--amani-navy);
  border-color: #CBD5E1;
}

.action-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(11, 25, 44, 0.15), 0 8px 10px -6px rgba(11, 25, 44, 0.1);
  min-width: 120px;
  padding: 0.35rem;
  z-index: 100;
  display: none;
  animation: fadeIn 0.15s ease-out;
}

.action-dropdown-menu.show {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-dropdown-item {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.5rem;
  width: 100%;
  padding: 0.42rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left !important;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-dropdown-item:hover {
  background: #F8FAFC;
  color: var(--amani-cyan-hover);
}

.action-dropdown-item.danger {
  color: #EF4444;
}

.action-dropdown-item.danger:hover {
  background: #FEF2F2;
  color: #DC2626;
}

.action-dropdown-divider {
  height: 1px;
  background: #F1F5F9;
  margin: 3px 0;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
  background: #FAFBFD;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-main);
  background: #FFFFFF;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}
.form-control:focus {
  border-color: var(--amani-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.data-table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  background: #FFFFFF;
  scrollbar-width: thin;
  scrollbar-color: #BAE6FD #F8FAFC;
}

.data-table-container::-webkit-scrollbar {
  height: 6px;
}
.data-table-container::-webkit-scrollbar-track {
  background: #F8FAFC;
  border-radius: 4px;
}
.data-table-container::-webkit-scrollbar-thumb {
  background: #BAE6FD;
  border-radius: 4px;
}
.data-table-container::-webkit-scrollbar-thumb:hover {
  background: var(--amani-cyan);
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
}
.data-table th {
  background: #F8FAFC;
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  color: var(--amani-navy);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.data-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.data-table tr:hover td {
  background: #FAFBFD;
}

/* ==============================================================================
   GOOGLE SHEETS DATABASE EXPLORER CARDS
   ============================================================================== */
.sheet-file-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.95rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.sheet-file-card:hover {
  transform: translateY(-2px);
  border-color: #10B981;
  box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.15), 0 6px 8px -4px rgba(16, 185, 129, 0.08);
}

.sheet-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.12);
}

.sheet-tab-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 44, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}
.modal-overlay.active { display: flex; }

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: #F1F5F9;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}
.modal-close-btn:hover { background: #E2E8F0; color: var(--text-main); }

/* ==============================================================================
   DATABASE 3-CATEGORY SYSTEM, FILE EXPLORER & MD LOG VIEWER
   ============================================================================== */
.db-category-nav {
  display: flex;
  gap: 0.5rem;
  background: #F1F5F9;
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

.db-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.db-cat-btn:hover {
  color: var(--amani-navy);
  background: rgba(255, 255, 255, 0.6);
}

.db-cat-btn.active {
  background: #FFFFFF;
  color: var(--amani-navy);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.db-section-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.35rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.db-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* File Explorer */
.file-explorer-container {
  background: #FAFBFD;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.file-explorer-toolbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-explorer-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
  padding: 1rem;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
}

.folder-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.folder-tile:hover {
  background: #F0F9FF;
  border-color: #BAE6FD;
  transform: translateY(-1px);
}

.file-explorer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.file-explorer-table th {
  background: #F8FAFC;
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid #E2E8F0;
}

.file-explorer-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.file-explorer-table tr:hover td {
  background: #F8FAFC;
}

/* Markdown Log Viewer */
.md-viewer-modal-card {
  max-width: 860px;
  width: 95%;
  height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.md-viewer-header {
  padding: 1rem 1.35rem;
  background: #0B192C;
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.md-viewer-toolbar {
  padding: 0.65rem 1.35rem;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.md-viewer-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  background: #FFFFFF;
  color: #1E293B;
  font-size: 0.88rem;
  line-height: 1.7;
}

.md-viewer-body h1, .md-viewer-body h2, .md-viewer-body h3 {
  color: #0B192C;
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
  font-weight: 800;
}

.md-viewer-body h1 { font-size: 1.35rem; border-bottom: 2px solid #E2E8F0; padding-bottom: 0.4rem; }
.md-viewer-body h2 { font-size: 1.15rem; border-bottom: 1px solid #E2E8F0; padding-bottom: 0.3rem; }
.md-viewer-body h3 { font-size: 1rem; }

.md-viewer-body pre {
  background: #0F172A;
  color: #E2E8F0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
}

.md-viewer-body code {
  background: #F1F5F9;
  color: #0284C7;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 600;
}

.md-viewer-body blockquote {
  border-left: 4px solid #0284C7;
  background: #F0F9FF;
  padding: 0.65rem 1rem;
  margin: 0.85rem 0;
  border-radius: 0 6px 6px 0;
  color: #0369A1;
}

.md-viewer-body hr {
  border: 0;
  height: 1px;
  background: #E2E8F0;
  margin: 1.25rem 0;
}

.md-viewer-body ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.md-viewer-body li {
  margin-bottom: 0.35rem;
}

.md-viewer-footer {
  padding: 0.65rem 1.35rem;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #DC2626;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .chat-layout { flex-direction: column; }
  .preset-panel { width: 100%; height: 160px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
}


/* ==============================================================================
   WORKSHEET TAB BUTTONS & INTERACTIVE DATABASE TABLE
   ============================================================================== */
.sheet-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.sheet-tab-btn:hover {
  background: #E0F2FE;
  border-color: #7DD3FC;
  color: #0284C7;
}

.sheet-tab-btn.active {
  background: #0B192C;
  border-color: #0B192C;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(11, 25, 44, 0.25);
}

.data-table th {
  background: #F8FAFC;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  border-bottom: 1.5px solid #E2E8F0;
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.8rem;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #F8FAFC;
}


/* ==============================================================================
   CLEAN 3-TAB DATABASE LAYOUT: DATA TABULAR | DATA NON TABULAR | LOGS
   ============================================================================== */
.db-category-nav {
  display: flex;
  gap: 0.5rem;
  background: #FFFFFF;
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.db-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.db-cat-btn:hover {
  color: var(--amani-navy);
  background: #F1F5F9;
}

.db-cat-btn.active {
  background: #0B192C;
  color: #FFFFFF;
  border-color: #0B192C;
  box-shadow: 0 4px 12px rgba(11, 25, 44, 0.2);
}

.db-cat-btn.active svg {
  stroke: #38BDF8 !important;
}

.db-tab-panel {
  animation: fadeIn 0.2s ease-out;
}

/* ==============================================================================
   LAHAN (LAND) MODULE SUB-TABS & EMPTY STATE SYSTEM
   ============================================================================== */
.lahan-tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #FFFFFF;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.lahan-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.lahan-tab-btn:hover {
  color: var(--amani-navy);
  background: #F1F5F9;
  border-color: #E2E8F0;
}

.lahan-tab-btn.active {
  color: #FFFFFF;
  background: var(--amani-navy);
  border-color: var(--amani-navy);
  box-shadow: 0 3px 10px rgba(11, 25, 44, 0.22);
}

.lahan-tab-btn.active .lahan-tab-icon {
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
}

.lahan-tab-pane {
  display: none;
}

.lahan-tab-pane.active {
  display: block;
  animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.lahan-empty-state-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.lahan-empty-state-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--amani-cyan), var(--amani-teal), var(--amani-green));
}

.lahan-empty-inner {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.lahan-empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
  color: var(--amani-cyan-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 16px -4px rgba(2, 132, 199, 0.2);
  margin-bottom: 0.35rem;
}

.lahan-empty-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--amani-navy);
  margin: 0;
}

.lahan-empty-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.lahan-empty-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 9999px;
  background: #F8FAFC;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.lahan-empty-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94A3B8;
}

/* ==============================================================================
   STAKEHOLDER MODAL & FORM CONTROLS (MATCHING SCREENSHOTS)
   ============================================================================== */
.modal-card-lg {
  background: #FFFFFF;
  border-radius: 16px;
  width: 92%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.75rem;
  position: relative;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.18);
  animation: modalScale 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stk-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #E2E8F0;
}

.stk-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--amani-navy);
  margin: 0;
}

.stk-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--amani-navy);
  margin-bottom: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stk-form-group {
  margin-bottom: 1.15rem;
}

.stk-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.stk-form-label .req {
  color: #EF4444;
  margin-left: 2px;
}

.stk-form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--text-main);
  background: #FFFFFF;
  transition: all 0.2s ease;
  outline: none;
}

.stk-form-input:focus {
  border-color: var(--amani-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.stk-phone-group {
  display: flex;
  align-items: center;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #FFFFFF;
  transition: all 0.2s ease;
}

.stk-phone-group:focus-within {
  border-color: var(--amani-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.stk-flag-prefix {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  background: #F8FAFC;
  border-right: 1.5px solid #CBD5E1;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  user-select: none;
}

.stk-phone-input {
  flex: 1;
  border: none;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
  background: transparent;
}

.stk-file-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.stk-file-box:hover {
  border-color: var(--amani-cyan);
  background: #F8FAFC;
  color: var(--text-secondary);
}

/* iOS Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
  background-color: #0B192C;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Multi-label selectable badges */
.stk-labels-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.stk-label-pill-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #CBD5E1;
  background: #F8FAFC;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  user-select: none;
}

.stk-label-pill-btn.selected {
  background: #0B192C;
  color: #FFFFFF;
  border-color: #0B192C;
  box-shadow: 0 2px 6px rgba(11, 25, 44, 0.2);
}

.stk-doc-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.stk-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid #E2E8F0;
}

/* ==============================================================================
   PREMIUM UNIFIED BUTTON DESIGN SYSTEM (AMANI MODERN LUXURY THEME)
   ============================================================================== */

/* Base Button (Only targets .btn classes, preserves sidebar and layout buttons) */
.btn {
  font-family: 'Poppins', sans-serif !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25) !important;
}

.btn:active {
  transform: scale(0.98);
}

/* Primary Button (Amani Navy Gradient & Hover Glow) */
.btn-primary,
button.btn-primary,
.btn-submit-stk {
  background: linear-gradient(135deg, #0B192C 0%, #1E3E62 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 3px 8px rgba(11, 25, 44, 0.18), 0 1px 2px rgba(11, 25, 44, 0.12) !important;
  font-weight: 700 !important;
}

.btn-primary:hover,
button.btn-primary:hover,
.btn-submit-stk:hover {
  background: linear-gradient(135deg, #1E3E62 0%, #0284C7 100%) !important;
  color: #FFFFFF !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.28), 0 2px 4px rgba(11, 25, 44, 0.12) !important;
}

/* Secondary / Outline Button (Soft Slate Clean Style) */
.btn-outline,
button.btn-outline,
.btn-cancel,
.btn-cancel-link {
  background: #FFFFFF !important;
  color: #475569 !important;
  border: 1.5px solid #CBD5E1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.btn-outline:hover,
button.btn-outline:hover,
.btn-cancel:hover,
.btn-cancel-link:hover {
  background: #F8FAFC !important;
  color: #0F172A !important;
  border-color: #94A3B8 !important;
  transform: translateY(-1.5px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Cyan Button */
.btn-cyan {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25) !important;
  font-weight: 700 !important;
}

.btn-cyan:hover {
  background: linear-gradient(135deg, #0369A1 0%, #075985 100%) !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35) !important;
}

/* Danger Button (Delete) */
.btn-danger,
button.btn-danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.25) !important;
  font-weight: 700 !important;
}

.btn-danger:hover,
button.btn-danger:hover {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%) !important;
  color: #FFFFFF !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35) !important;
}

/* Danger Outline Button */
.btn-danger-outline {
  background: #FFF5F5 !important;
  color: #DC2626 !important;
  border: 1.5px solid #FECACA !important;
  font-weight: 600 !important;
}

.btn-danger-outline:hover {
  background: #FEE2E2 !important;
  color: #B91C1C !important;
  border-color: #F87171 !important;
  transform: translateY(-1.5px);
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25) !important;
  font-weight: 700 !important;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35) !important;
}

/* Button Sizing Utilities */
.btn-sm {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.75rem !important;
  border-radius: 6px !important;
}

.btn-lg {
  padding: 0.7rem 1.6rem !important;
  font-size: 0.92rem !important;
  border-radius: 10px !important;
}

/* Modal Close Button Modern Style */
.modal-close-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #F1F5F9 !important;
  color: #64748B !important;
  border: 1px solid #E2E8F0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 0.95rem !important;
  padding: 0 !important;
  transition: all 0.2s ease !important;
}

.modal-close-btn:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
  transform: scale(1.08) !important;
}

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

/* ==============================================================================
   STAKEHOLDER GRID / CARD VIEW
   ============================================================================== */
.stk-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.15rem;
  margin-top: 1rem;
}

.stk-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
}

.stk-card:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 10px 25px rgba(11, 25, 44, 0.08);
}

.stk-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.stk-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--amani-navy);
  margin-bottom: 0.2rem;
}

.stk-card-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stk-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: #F8FAFC;
  border: 1px solid #F1F5F9;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin: 0.85rem 0;
}

.stk-card-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stk-card-metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.stk-card-metric-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--amani-navy);
}

.stk-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #F1F5F9;
  margin-top: 0.25rem;
}

/* ==============================================================================
   FLATPICKR AMANI THEME (NAVY, CYAN & POPPINS CALENDAR)
   ============================================================================== */
.flatpickr-calendar {
  font-family: 'Poppins', sans-serif !important;
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 28px -4px rgba(11, 25, 44, 0.25), 0 8px 10px -6px rgba(11, 25, 44, 0.1) !important;
  overflow: hidden;
  z-index: 99999 !important;
  width: 308px !important;
}

.flatpickr-months {
  background: #0B192C !important;
  color: #FFFFFF !important;
  padding: 0.45rem 0.25rem !important;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.flatpickr-current-month {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #FFFFFF !important;
  padding-top: 0.25rem !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  background: #0B192C !important;
  color: #FFFFFF !important;
  outline: none !important;
  border: none !important;
  cursor: pointer;
}

.flatpickr-current-month input.cur-year {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #FFFFFF !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: #BAE6FD !important;
  fill: #BAE6FD !important;
  padding: 0.45rem !important;
  transition: all 0.2s ease !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: #FFFFFF !important;
  fill: #FFFFFF !important;
}

span.flatpickr-weekday {
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: #64748B !important;
  background: #F8FAFC !important;
  padding: 0.35rem 0 !important;
}

.flatpickr-innerContainer {
  padding: 0.35rem !important;
}

.flatpickr-days {
  width: 100% !important;
}

.dayContainer {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  justify-content: space-around !important;
}

.flatpickr-day {
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: #1E293B !important;
  border-radius: 8px !important;
  margin: 1.5px !important;
  height: 34px !important;
  line-height: 34px !important;
  transition: all 0.15s ease !important;
  border: 1.5px solid transparent !important;
}

.flatpickr-day:hover {
  background: #E0F2FE !important;
  color: #0284C7 !important;
  border-color: #BAE6FD !important;
}

.flatpickr-day.today {
  border-color: #0284C7 !important;
  color: #0284C7 !important;
  font-weight: 700 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  border-color: #0284C7 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #CBD5E1 !important;
}

/* Calendar Input field styling */
.datepicker-input,
input.flatpickr-input {
  background-color: #FFFFFF !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230284C7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 16px 16px !important;
  padding-right: 2.3rem !important;
  cursor: pointer !important;
  font-family: inherit;
}

/* Custom Range Slider Theme */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  outline: none;
  transition: background 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284C7;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #0369A1;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284C7;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* ==========================================================================
   CLUSTER TAHAP TOOLTIP BADGE (+N)
   ========================================================================== */
.tahap-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tahap-pill-wrap .tahap-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E2E8F0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 12px;
  margin-left: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tahap-pill-wrap .tahap-count-badge:hover {
  background: #CBD5E1;
  color: #0F172A;
}

.tahap-pill-wrap .tahap-tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 150;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.tahap-pill-wrap .tahap-tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #0F172A transparent transparent transparent;
}

.tahap-pill-wrap:hover .tahap-tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==============================================================================
   LAPORAN (EXECUTIVE REPORT CENTER & 5 THEMED GROUPS)
   ============================================================================== */


/* Category Filter Pills */
.laporan-pills-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.45rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
}

.laporan-pill-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #64748B;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.laporan-pill-btn:hover {
  background: #FFFFFF;
  color: #0F172A;
}

.laporan-pill-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border-color: #CBD5E1;
}

.laporan-pill-count {
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 999px;
  background: #E2E8F0;
  color: #475569;
}

.laporan-pill-btn.active .laporan-pill-count {
  background: #0F172A;
  color: #FFFFFF;
}

/* Themed Report Tags in Table */
.laporan-tag-lahan {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.laporan-tag-konstruksi {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.laporan-tag-sales {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.laporan-tag-perizinan {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.laporan-tag-keuangan {
  background: #ECFEFF;
  color: #0E7490;
  border: 1px solid #A5F3FC;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}






