/* ==========================================
   DASHBOARD SCREEN SPECIFIC STYLES
   ========================================== */

:root {
  --sidebar-width: 260px;
  --bg-dash: #F5F7FA;
  --card-bg: #FFFFFF;
  --border-dash: #E4E8EE;
  
  --success: #2E7D32;
  --info: #0288D1;
  --warning: #F57C00;
  --danger: #D32F2F;
}

body.dashboard-body {
  background-color: var(--bg-dash);
  color: var(--dark);
  font-family: var(--font-body);
}

.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  line-height: 1.2;
}

.sidebar-logo span {
  font-size: 0.7rem;
  display: block;
  color: var(--cream);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
  padding: 1.5rem 0.75rem;
  flex-grow: 1;
}

.sidebar-menu-item {
  margin-bottom: 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition-fast);
  cursor: pointer;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--white);
  background-color: rgba(255, 255, 255, 0.15);
}

.sidebar-link.active {
  background-color: var(--primary-light);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar-user-info {
  font-size: 0.85rem;
}

.sidebar-user-name {
  font-weight: 600;
  color: var(--white);
  display: block;
}

.sidebar-user-role {
  color: var(--cream);
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.dashboard-header {
  background-color: var(--white);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-dash);
}

.dashboard-header-title h1 {
  font-size: 1.5rem;
  color: var(--primary);
}

.dashboard-header-title p {
  font-size: 0.85rem;
  color: var(--medium-gray);
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-dash);
  border-radius: 50px;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-dash);
  width: 250px;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding-left: 0.5rem;
  width: 100%;
}

.search-bar svg {
  color: var(--medium-gray);
  width: 18px;
  height: 18px;
}

.notifications-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
  position: relative;
  display: flex;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--white);
}

.btn-back-home {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
}

/* ==========================================
   DASHBOARD GRID & PANELS
   ========================================== */
.dashboard-viewport {
  padding: 2rem;
  flex-grow: 1;
}

/* Metrics row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-dash);
  transition: var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

.metric-details h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--medium-gray);
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.metric-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.trend-up {
  color: var(--success);
}

.trend-down {
  color: var(--danger);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon.green {
  background-color: rgba(46, 125, 50, 0.1);
  color: var(--success);
}

.metric-icon.blue {
  background-color: rgba(2, 136, 209, 0.1);
  color: var(--info);
}

.metric-icon.orange {
  background-color: rgba(245, 124, 0, 0.1);
  color: var(--warning);
}

.metric-icon.brown {
  background-color: rgba(121, 85, 72, 0.1);
  color: var(--accent);
}

/* Dashboard Core Content Grid */
.dash-grid-primary {
  display: grid;
  grid-template-columns: 1.7fr 1.3fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dash);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dash-card-title {
  font-size: 1.1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-card-actions {
  display: flex;
  gap: 0.5rem;
}

.chart-select {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-dash);
  font-family: var(--font-body);
  font-size: 0.8rem;
  background-color: var(--white);
  color: var(--dark);
}

.chart-container {
  position: relative;
  width: 100%;
  height: 280px;
}

/* Interactive Map Styling */
.indonesia-map-wrapper {
  background-color: #E3F2FD;
  border-radius: var(--radius-sm);
  padding: 1rem;
  height: 250px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.05);
}

.indonesia-map-svg {
  width: 100%;
  height: 100%;
}

.map-region {
  fill: #A5D6A7;
  stroke: #FFFFFF;
  stroke-width: 1.5;
  transition: all 0.3s ease;
  cursor: pointer;
}

.map-region:hover,
.map-region.active {
  fill: var(--primary-light);
  filter: drop-shadow(0px 3px 6px rgba(0,0,0,0.15));
}

.map-tooltip {
  position: absolute;
  background: var(--dark);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Secondary Dash Grid */
.dash-grid-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Activity feed / timeline */
.timeline-feed {
  list-style: none;
  padding: 0;
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  width: 2px;
  height: 100%;
  background-color: var(--border-dash);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--white);
  border: 3px solid var(--primary-light);
  z-index: 2;
}

.timeline-dot.success { border-color: var(--success); }
.timeline-dot.warning { border-color: var(--warning); }
.timeline-dot.info { border-color: var(--info); }

.timeline-time {
  font-size: 0.75rem;
  color: var(--medium-gray);
  display: block;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.15rem;
}

.timeline-desc {
  font-size: 0.82rem;
  color: #666;
}

/* Table Design for Supply Chain / Transactions */
.table-wrapper {
  overflow-x: auto;
}

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

.dash-table th {
  padding: 0.75rem 1rem;
  background-color: var(--bg-dash);
  color: var(--medium-gray);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-dash);
}

.dash-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-dash);
  color: #4A4A4A;
}

.dash-table tr:hover td {
  background-color: rgba(245, 247, 250, 0.6);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pill.success {
  background-color: rgba(46, 125, 50, 0.1);
  color: var(--success);
}

.status-pill.warning {
  background-color: rgba(245, 124, 0, 0.1);
  color: var(--warning);
}

.status-pill.info {
  background-color: rgba(2, 136, 209, 0.1);
  color: var(--info);
}

/* QRIS Section Mock */
.qris-section {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.qris-code {
  width: 130px;
  height: 130px;
  border: 1px solid var(--border-dash);
  padding: 0.5rem;
  background-color: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qris-details {
  text-align: left;
}

.qris-details h4 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: var(--primary);
}

.qris-details p {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

/* ==========================================
   RESPONSIVENESS (DASHBOARD)
   ========================================== */
@media (max-width: 1024px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dash-grid-primary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-wrapper {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
  }
  
  .sidebar-menu {
    display: none; /* Can be toggled on mobile dashboard */
  }
  
  .dashboard-header {
    padding: 1rem;
  }
  
  .dashboard-header-actions {
    gap: 0.75rem;
  }
  
  .search-bar {
    display: none; /* Hide on small screen header to save space */
  }
  
  .dashboard-viewport {
    padding: 1rem;
  }
  
  .metrics-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dash-grid-secondary {
    grid-template-columns: 1fr;
  }
  
  .qris-section {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .qris-details {
    text-align: center;
  }
}
