:root {
  /* Colors */
  --wf-primary: #F97316; /* Orange */
  --wf-primary-hover: #EA580C;
  --wf-secondary: #1E293B; /* Dark Blue/Charcoal */
  --wf-bg: #F3F4F6;
  --wf-surface: #FFFFFF;
  --wf-border: #E2E8F0;
  --wf-text-main: #1E293B;
  --wf-text-muted: #64748B;
  
  /* Status Colors */
  --wf-success: #10B981;
  --wf-success-bg: #D1FAE5;
  --wf-warning: #F59E0B;
  --wf-warning-bg: #FEF3C7;
  --wf-error: #EF4444;
  --wf-error-bg: #FEE2E2;
  --wf-info: #3B82F6;
  --wf-info-bg: #DBEAFE;

  /* Spacing */
  --wf-space-xs: 4px;
  --wf-space-sm: 8px;
  --wf-space-md: 16px;
  --wf-space-lg: 24px;
  --wf-space-xl: 32px;

  /* Typography */
  --wf-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Radii */
  --wf-radius-sm: 6px;
  --wf-radius-md: 12px;
  --wf-radius-lg: 16px;
  
  /* Shadows */
  --wf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --wf-shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --wf-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--wf-font-sans);
  background-color: var(--wf-bg);
  color: var(--wf-text-main);
  margin: 0;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--wf-space-sm) 0;
  color: var(--wf-secondary);
}

h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }

p {
  margin: 0 0 var(--wf-space-md) 0;
  line-height: 1.5;
  color: var(--wf-text-muted);
}

/* Layout */
.layout-wrapper {
  display: flex;
  width: 100%;
}

.sidebar {
  width: 260px;
  background-color: var(--wf-secondary);
  color: #fff;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents overflow in flex items */
  height: 100vh;
  overflow-y: auto;
}

.top-bar {
  height: 64px;
  background: var(--wf-surface);
  border-bottom: 1px solid var(--wf-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--wf-space-lg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.content-area {
  padding: var(--wf-space-lg);
  flex: 1;
}

/* Components: Sidebar */
.brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--wf-space-lg);
  font-weight: 700;
  font-size: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  letter-spacing: 0.5px;
}
.brand span { color: var(--wf-primary); margin-left: 4px; }

.nav-links {
  padding: var(--wf-space-md) var(--wf-space-sm);
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #94A3B8;
  text-decoration: none;
  border-radius: var(--wf-radius-sm);
  margin-bottom: 2px;
  transition: all 0.2s;
}

.nav-item:hover {
  background-color: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-item.active {
  background-color: var(--wf-primary);
  color: #fff;
}

.nav-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Icons (Placeholders using CSS masks conceptually, but here just colored blocks for wireframe) */
.icon-dashboard { background-color: currentColor; border-radius: 2px; }

/* Components: Top Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--wf-bg);
  border-radius: var(--wf-radius-sm);
  padding: 8px 16px;
  width: 320px;
}
.search-input {
  border: none;
  background: transparent;
  margin-left: 8px;
  outline: none;
  width: 100%;
  font-size: 14px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--wf-space-md);
}

.avatar {
  width: 36px;
  height: 36px;
  background-color: var(--wf-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

/* Components: Cards */
.card {
  background: var(--wf-surface);
  border-radius: var(--wf-radius-md);
  padding: var(--wf-space-lg);
  box-shadow: var(--wf-shadow-card);
  border: 1px solid var(--wf-border);
  margin-bottom: var(--wf-space-lg);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--wf-shadow-hover);
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--wf-space-lg); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--wf-space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--wf-space-lg); }

/* Components: KPI Stats */
.kpi-card {
  display: flex;
  flex-direction: column;
}
.kpi-label {
  font-size: 13px;
  color: var(--wf-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  margin: var(--wf-space-xs) 0;
  color: var(--wf-secondary);
}
.kpi-trend {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.trend-up { color: var(--wf-success); }
.trend-down { color: var(--wf-error); }

/* Components: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--wf-radius-sm);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--wf-primary);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3);
}
.btn-primary:hover {
  background-color: var(--wf-primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--wf-border);
  color: var(--wf-text-main);
}
.btn-outline:hover {
  background-color: var(--wf-bg);
  border-color: #cbd5e1;
}

.btn-danger {
  background-color: var(--wf-error);
  color: white;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* Components: Tables */
.table-container {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  text-align: left;
  padding: 12px 16px;
  background-color: var(--wf-bg);
  color: var(--wf-text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--wf-border);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--wf-border);
  color: var(--wf-text-main);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background-color: #F8FAFC; }

/* Components: Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success { background-color: var(--wf-success-bg); color: #065F46; }
.badge-warning { background-color: var(--wf-warning-bg); color: #92400E; }
.badge-error { background-color: var(--wf-error-bg); color: #991B1B; }
.badge-info { background-color: var(--wf-info-bg); color: #1E40AF; }
.badge-neutral { background-color: var(--wf-bg); color: var(--wf-text-muted); }

/* Components: Forms */
.form-group {
  margin-bottom: var(--wf-space-md);
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--wf-secondary);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  font-size: 14px;
  background: white;
}
.form-input:focus {
  border-color: var(--wf-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

/* Components: Timeline */
.timeline {
  position: relative;
  padding-left: 20px;
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
  padding-left: 20px;
  border-left: 2px solid var(--wf-border);
}
.timeline-item:last-child { border-left: none; }
.timeline-dot {
  position: absolute;
  left: -7px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--wf-bg);
  border: 2px solid var(--wf-text-muted);
}
.timeline-item.active .timeline-dot {
  background: var(--wf-primary);
  border-color: var(--wf-primary);
}
.timeline-content h4 { margin: 0; font-size: 14px; }
.timeline-content span { font-size: 12px; color: var(--wf-text-muted); }

/* Components: Charts (Placeholder) */
.chart-placeholder {
  width: 100%;
  height: 250px;
  background-color: #F8FAFC;
  border-radius: var(--wf-radius-sm);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--wf-border);
}

/* Bar Chart */
.chart-bar-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100%;
  padding: 20px 10px 0;
}
.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 24px;
  background-color: var(--wf-primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}
.bar.secondary { background-color: var(--wf-secondary); }
.bar-label { font-size: 11px; color: var(--wf-text-muted); margin-top: 4px; }

/* Stacked Bar */
.stacked-bar-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  height: 100%;
}
.stacked-bar-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stacked-bar-label { width: 60px; font-size: 12px; color: var(--wf-text-muted); }
.stacked-bar-track {
  flex: 1;
  height: 24px;
  background: var(--wf-bg);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}
.sb-segment { height: 100%; }
.sb-val { font-size: 11px; color: white; display: flex; align-items: center; justify-content: center; height: 100%; }

/* Line Chart */
.line-chart-container {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 20px;
}
.line-path {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  clip-path: polygon(0 100%, 0 60%, 20% 50%, 40% 70%, 60% 40%, 80% 50%, 100% 20%, 100% 100%);
}
.line-stroke {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.line-point {
  width: 8px;
  height: 8px;
  background: white;
  border: 2px solid var(--wf-primary);
  border-radius: 50%;
  position: absolute;
  z-index: 2;
}

/* Donut Chart */
.donut-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.donut-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(
    var(--wf-primary) 0deg 120deg,
    var(--wf-secondary) 120deg 240deg,
    var(--wf-success) 240deg 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut-hole {
  width: 110px;
  height: 110px;
  background: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Heatmap */
.heatmap-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 20px;
  height: 100%;
}
.heatmap-cell {
  background: var(--wf-primary);
  border-radius: 2px;
  position: relative;
}
.heatmap-cell:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

/* Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 16px; }
.gap-2 { gap: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-0 { padding: 0 !important; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-sm { font-size: 14px; }
.text-muted { color: var(--wf-text-muted); }
.font-bold { font-weight: 700; }

/* Login Page Specific */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background-color: #F3F4F6;
}
.login-card {
  width: 400px;
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Detail Page Specifics */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--wf-space-lg);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.gallery-item {
  aspect-ratio: 4/3;
  background-color: #E2E8F0;
  border-radius: var(--wf-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wf-text-muted);
  font-size: 12px;
}

.map-placeholder {
  width: 100%;
  height: 200px;
  background-color: #CBD5E1;
  border-radius: var(--wf-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}
