@import url('fonts.css');
:root {
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --bg-dark: #080c14;
  --bg-sidebar: #0e1626;
  --bg-card: #141e33;
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --primary-color: #38bdf8;
  --primary-hover: #0284c7;
  --accent-color: #818cf8;
  --border-color: rgba(255, 255, 255, 0.1);
  --placeholder-bg: rgba(56, 189, 248, 0.08);
  --placeholder-border: rgba(56, 189, 248, 0.35);
  --radius-sm: 8px;
  --radius-md: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body.dashboard-body { font-family: var(--font-family); background-color: var(--bg-dark); color: var(--text-main); line-height: 1.6; height: 100vh; overflow: hidden; }

a { color: inherit; text-decoration: none; }

.app-layout { display: flex; height: 100vh; }

/* Sidebar */
.sidebar { width: 250px; background: var(--bg-sidebar); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; padding: 1.5rem 1rem; flex-shrink: 0; }
.sidebar-brand { font-size: 1.2rem; font-weight: 800; color: var(--primary-color); display: flex; align-items: center; gap: 0.6rem; margin-bottom: 2rem; padding: 0 0.5rem; }
.sidebar-menu { display: flex; flex-direction: column; gap: 0.4rem; flex-grow: 1; }
.menu-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: var(--radius-sm); color: var(--text-sub); font-size: 0.9rem; font-weight: 600; transition: all 0.2s ease; }
.menu-item:hover, .menu-item.active { background: rgba(56, 189, 248, 0.15); color: var(--primary-color); }
.sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--border-color); }
.back-link { font-size: 0.85rem; font-weight: 700; color: var(--primary-color); display: flex; align-items: center; gap: 0.5rem; }

/* Main Viewport */
.main-viewport { flex-grow: 1; display: flex; flex-direction: column; overflow-y: auto; }
.topbar { background: var(--bg-sidebar); border-bottom: 1px solid var(--border-color); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.search-box { position: relative; width: 350px; }
.search-box i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-sub); }
.search-box input { width: 100%; padding: 0.6rem 1rem 0.6rem 2.5rem; background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 20px; color: var(--text-main); font-family: inherit; font-size: 0.85rem; }
.topbar-user { display: flex; align-items: center; gap: 1.5rem; }
.notif-btn { background: none; border: none; color: var(--text-sub); font-size: 1.2rem; cursor: pointer; }
.user-profile { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; font-weight: 700; }
.avatar { width: 34px; height: 34px; background: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #000; font-size: 0.85rem; }

/* Content */
.dashboard-content { padding: 2rem; flex-grow: 1; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.dash-header h1 { font-size: 1.8rem; font-weight: 800; }
.dash-header p { color: var(--text-sub); font-size: 0.95rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.25rem; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.85rem; cursor: pointer; border: none; }
.btn-primary { background: var(--primary-color); color: #000; }

/* KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.kpi-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 1.5rem; }
.kpi-label { font-size: 0.8rem; font-weight: 700; color: var(--text-sub); }
.kpi-val { font-size: 2rem; font-weight: 800; margin: 0.4rem 0; color: var(--text-main); }
.kpi-trend { font-size: 0.75rem; font-weight: 700; }
.kpi-trend.positive { color: #4ade80; }
.kpi-trend.neutral { color: var(--primary-color); }

/* Split Section */
.dash-grid-split { display: grid; grid-template-columns: 1.8fr 1fr; gap: 1.5rem; }
.chart-container, .activity-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 1.5rem; }
.card-title h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }

.wireframe-image-placeholder {
  width: 100%; height: 100%; min-height: 240px;
  background: var(--placeholder-bg); border: 2px dashed var(--placeholder-border);
  border-radius: var(--radius-md); display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--primary-color);
  gap: 0.5rem; font-weight: 700; font-size: 0.85rem;
}
.wireframe-image-placeholder i { font-size: 2.5rem; opacity: 0.9; }

.activity-list { display: flex; flex-direction: column; gap: 1.25rem; }
.activity-item { display: flex; gap: 0.75rem; align-items: flex-start; }
.activity-item i { font-size: 1.2rem; margin-top: 0.15rem; }
.activity-item i.green { color: #4ade80; }
.activity-item i.blue { color: #38bdf8; }
.activity-item i.purple { color: #a855f7; }
.activity-item strong { display: block; font-size: 0.85rem; }
.activity-item span { font-size: 0.75rem; color: var(--text-sub); }

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-split { grid-template-columns: 1fr; }
  .sidebar { width: 70px; }
  .sidebar-brand span, .menu-item span, .sidebar-footer span { display: none; }
}

/* Global Mobile Viewport Overflow Protection */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
img, svg, video, iframe, canvas {
  max-width: 100%;
  height: auto;
}
