:root {
  --ko-k: #1F4E79;
  --bg: #FFFFFF;
  --card-bg: #F2F5F9;
  --sariq: #FFD700;
  --yashil: #00B050;
  --qizil: #E63946;
  --oraliq: #FFC000;
  --text: #1A2733;
  --text-dim: #5B6B7A;
  --border: #DCE4EC;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

#app { min-height: 100vh; padding-bottom: 24px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--ko-k);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 18px; margin: 0; color: #fff; line-height: 0; }
.logo-img { height: 30px; display: block; }
.period-label { font-size: 12px; color: var(--sariq); }

.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex: 1 0 auto;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--sariq);
  color: #1a1a1a;
}

main { padding: 12px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.card .label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.card .value { font-size: 17px; font-weight: 700; }
.card .value.green { color: var(--yashil); }
.card .value.red { color: var(--qizil); }
.card .value.yellow { color: var(--sariq); }

canvas { max-width: 100%; margin-bottom: 14px; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: var(--ko-k);
  color: #fff;
  padding: 8px 6px;
  text-align: center;
  position: sticky;
  top: 0;
}
tbody td {
  padding: 7px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
tbody td:first-child, thead th:first-child { text-align: left; }
tbody tr:nth-child(even) { background: rgba(0,0,0,0.03); }

.pct-green { color: var(--yashil); font-weight: 700; }
.pct-yellow { color: var(--sariq); font-weight: 700; }
.pct-red { color: var(--qizil); font-weight: 700; }

.loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  z-index: 100;
}
.loader.hidden { display: none; }

.empty-msg {
  text-align: center;
  color: var(--text-dim);
  padding: 24px 8px;
  font-size: 13px;
}
