:root {
  --navy: #1A2E6E;
  --red-clinic: #CC1C1C;
  --green: #2E7D32;
  --green-bg: #E8F5E9;
  --red: #D32F2F;
  --red-bg: #FFEBEE;
  --blue: #1565C0;
  --bg: #F0F2F8;
  --card: #FFFFFF;
  --text: #212121;
  --muted: #757575;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 24px;
}

/* ===== HEADER ===== */
.main-header {
  background: var(--navy);
  color: #fff;
  padding: 16px 16px 14px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  box-shadow: 0 4px 12px rgba(26, 46, 110, 0.2);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-box {
  width: 52px;
  height: 40px;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.header-titles {
  flex: 1;
}

.header-titles h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.header-titles p {
  font-size: 12px;
  color: #B0C4F0;
}

.date-badge {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 6px 11px;
  text-align: center;
}

.date-badge span {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.date-badge small {
  font-size: 10px;
  color: #FFCCCC;
}

/* ===== APP SWITCHER ===== */
.app-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.switch-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #E3EBFF;
  border-radius: 12px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.switch-btn.active {
  background: #FFFFFF;
  color: var(--navy);
  border-color: #FFFFFF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.switch-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.switch-sub {
  display: block;
  font-size: 11px;
  opacity: 0.8;
  margin-top: 1px;
}

/* ===== PERIOD TABS (Bugun / Hafta / Oy) ===== */
.period-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.period-tab {
  height: 38px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.period-tab.active {
  background: #EEF1F8;
  color: var(--navy);
}

.sub-period {
  margin-top: 8px;
}

.sub-period .period-tab {
  height: 32px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.sub-period .period-tab.active {
  background: #FFFFFF;
  color: var(--navy);
}

/* ===== RECEIPTS & HISTORY CONTROLS ===== */
.receipts-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.control-input {
  border: 1px solid #DCE2F0;
  background: #FFFFFF;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.date-input {
  width: 136px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
}

.load-more-btn {
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--navy);
  background: #FFFFFF;
  color: var(--navy);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.kassa-4tabs {
  grid-template-columns: repeat(4, 1fr);
}

.kassa-4tabs .period-tab {
  font-size: 12px;
}

.stat-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.accent-blue   { border-left: 4px solid var(--blue); }
.accent-orange { border-left: 4px solid #E65100; }

.card-label {
  font-size: 11px;
  color: var(--muted);
}

.card-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 3px;
}

.card-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.navy-text   { color: var(--navy); }
.orange-text { color: #E65100; }

.alltime-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F4F7FF 100%);
  border-left: 4px solid var(--navy);
}

.alltime-patients {
  text-align: right;
}

.alltime-patients span {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.alltime-patients small {
  font-size: 11px;
  color: var(--muted);
}

.sec-detail-card {
  padding: 12px 14px;
}

.sec-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #EEF1F8;
  margin-bottom: 8px;
}

.svc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px dashed #F0F2F8;
}

.svc-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.svc-left {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}

.svc-name {
  font-weight: 600;
  color: var(--text);
}

.svc-meta {
  font-size: 11px;
  color: var(--muted);
}

.svc-rev {
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

.period-tabs-inline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.period-tab-inline {
  height: 38px;
  border: 1px solid #D5DCEB;
  border-radius: 10px;
  background: #EEF1F8;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.period-tab-inline.active {
  background: var(--navy);
  color: #FFFFFF;
  border-color: var(--navy);
}

.sec-detail-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.back-btn {
  border: none;
  background: var(--navy);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.sec-detail-title-wrap {
  flex: 1;
  min-width: 0;
}

.sec-card-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.sec-card-btn:active {
  transform: scale(0.99);
}

.sec-arrow {
  font-size: 20px;
  font-weight: 700;
  color: #9E9E9E;
  flex-shrink: 0;
}

.srv-index {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #EEF1F8;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.receipt-num-badge {
  display: inline-block;
  background: #EEF1F8;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  margin-right: 6px;
}

.queue-badge {
  display: inline-block;
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
}

/* ===== CONTENT ===== */
.content {
  padding: 14px 14px 0;
}

.hidden {
  display: none !important;
}

.period-label {
  font-size: 13px;
  color: #8896B3;
  margin-bottom: 10px;
  font-weight: 500;
}

/* ===== SUMMARY CARDS (1ga1 StatisticsActivity) ===== */
.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.summary-card {
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.navy-card {
  background: var(--navy);
}

.white-card {
  background: #FFFFFF;
}

.summary-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.light-kicker { color: rgba(255, 255, 255, 0.55); }
.dark-kicker  { color: #9E9E9E; }

.summary-patients {
  font-size: 34px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.15;
  margin-top: 2px;
}

.summary-revenue {
  font-size: 18px;
  font-weight: 700;
  color: var(--red-clinic);
  margin-top: 6px;
  margin-bottom: 4px;
}

.summary-unit {
  font-size: 11px;
}

.light-unit { color: rgba(255, 255, 255, 0.55); }
.dark-unit  { color: #9E9E9E; }

/* ===== STAT CARDS & CHARTS ===== */
.stat-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.stat-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 150px;
  padding-top: 20px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.bar-val {
  font-size: 10px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
  white-space: nowrap;
}

.bar-fill {
  width: 100%;
  max-width: 32px;
  border-radius: 6px 6px 2px 2px;
  min-height: 6px;
  transition: height 0.25s ease;
}

.bar-label {
  font-size: 10px;
  color: #666;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ===== SECTION BREAKDOWN ===== */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bd-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bd-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.bd-name {
  font-weight: 600;
  color: var(--text);
}

.bd-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}

.bd-track {
  width: 100%;
  height: 8px;
  background: #ECEFF6;
  border-radius: 99px;
  overflow: hidden;
}

.bd-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* ===== TOP 5 SERVICES ===== */
.top-services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F0F2F8;
}

.top-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.top-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #EEF1F8;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-info {
  flex: 1;
  min-width: 0;
}

.top-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-count {
  font-size: 11px;
  color: var(--muted);
}

.top-rev {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

/* ===== DAVOMAT ===== */
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.accent-green { border-left: 4px solid var(--green); }
.accent-red   { border-left: 4px solid var(--red); }
.accent-grey  { border-left: 4px solid #9E9E9E; }

.stat-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-mini {
  text-align: center;
  padding: 10px 6px;
}

.stat-mini .mini-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.stat-mini strong {
  font-size: 20px;
  font-weight: 700;
}

.green-bg { background: var(--green-bg); }
.red-bg   { background: var(--red-bg); }
.grey-bg  { background: #ECEFF1; }

.green-text { color: var(--green); }
.red-text   { color: var(--red); }
.grey-text  { color: var(--muted); }

.section-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin: 14px 0 8px;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.row-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.row-right {
  text-align: right;
  flex-shrink: 0;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.pill-green { background: var(--green-bg); color: var(--green); }
.pill-red   { background: var(--red-bg); color: var(--red); }
.pill-grey  { background: #EEEEEE; color: var(--muted); }

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-chip {
  border: 1px solid var(--green);
  background: transparent;
  color: var(--green);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip.active {
  background: var(--green);
  color: #fff;
}
