/* {{APP_NAME}} — System (Auto) Theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-color: #f8fafc;
  --text-color: #334155;
  --header-bg: #e2e8f0;
  --header-text: #0f172a;
  --sub-text: #64748b;
  --panel-bg: white;
  --border-color: #cbd5e1;
  --btn-bg: #3b82f6;
  --btn-hover: #2563eb;
  --link-color: #0ea5e9;
  --table-th-bg: #f1f5f9;
  --table-th-border: #94a3b8;
  --table-tr-hover: #f8fafc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --header-bg: #1e293b;
    --header-text: #f8fafc;
    --sub-text: #94a3b8;
    --panel-bg: #1e293b;
    --border-color: #334155;
    --btn-bg: #2563eb;
    --btn-hover: #1d4ed8;
    --table-th-bg: #334155;
    --table-th-border: #475569;
    --table-tr-hover: #1e293b;
  }
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
}

.app-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header h1 { font-size: 16px; font-weight: 700; color: var(--header-text); letter-spacing: -0.01em; }
.app-subtitle   { font-size: 11px; color: var(--sub-text); text-transform: uppercase; font-weight: 600; }

.app-container { display: flex; height: calc(100vh - 43px); }

.app-sidebar {
  width: 240px;
  background: var(--panel-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.sidebar-group { margin-bottom: 24px; }
.sidebar-group label { display: block; font-size: 11px; font-weight: 700; color: var(--sub-text); text-transform: uppercase; margin-bottom: 8px; }
.sidebar-group select { width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 13px; background: var(--bg-color); color: var(--text-color); }

.sidebar-footer { margin-top: auto; }

.app-main { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg-color); }

.kpi-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.kpi-label { font-size: 11px; font-weight: 600; color: var(--sub-text); text-transform: uppercase; margin-bottom: 4px; }
.kpi-value { font-size: 20px; font-weight: 700; color: var(--btn-bg); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

.chart-section, .table-section {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
}

.section-title { font-size: 14px; font-weight: 600; color: var(--header-text); margin-bottom: 16px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }

.chart-img { width: 100%; height: auto; border-radius: 4px; background: var(--bg-color); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: var(--table-th-bg); padding: 12px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border-color); color: var(--text-color); }
td { padding: 12px; border-bottom: 1px solid var(--border-color); color: var(--text-color); opacity: 0.9; }
tr:hover td { background: var(--table-tr-hover); }

.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--btn-bg);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--btn-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.app-footer { margin-top: 32px; border-top: 1px solid var(--border-color); padding-top: 16px; text-align: right; }
.status-label { font-size: 11px; color: var(--sub-text); text-transform: uppercase; letter-spacing: 0.05em; }
