* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
}

/* Header */
.header {
  background: linear-gradient(135deg, #22A94B, #1a8a3c);
  padding: 20px 16px 16px;
  color: #fff;
  text-align: center;
}

.header-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
}

.header-sub {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

.header-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 0;
}

.header-phone {
  font-size: 15px;
  font-weight: 500;
}

.btn-logout {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.btn-logout:hover { background: rgba(255,255,255,0.3); }

/* Auth screens */
.auth-container {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.auth-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin-bottom: 16px;
  margin-top: 40px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: #22A94B;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 32px;
  text-align: center;
}

.form-group {
  width: 100%;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
  display: block;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #22A94B;
}

.form-input::placeholder {
  color: #bbb;
}

.sms-code-input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 12px;
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: #22A94B;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-primary:hover { background: #1a8a3c; }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: #22A94B;
  border: 1.5px solid #22A94B;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
}

.btn-secondary:hover { background: #f0faf3; }

.btn-link {
  background: none;
  border: none;
  color: #22A94B;
  font-size: 14px;
  cursor: pointer;
  margin-top: 12px;
  font-family: inherit;
}

.btn-link:hover { text-decoration: underline; }

.auth-footer {
  margin-top: 24px;
  text-align: center;
}

.auth-footer span { color: #888; font-size: 14px; }

.error-msg {
  background: #fff3f3;
  color: #e53935;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  width: 100%;
  text-align: center;
}

.success-msg {
  background: #f0faf3;
  color: #22A94B;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  width: 100%;
  text-align: center;
}

.timer {
  font-size: 13px;
  color: #888;
  margin-top: 8px;
  text-align: center;
}

.timer .resend { color: #22A94B; cursor: pointer; font-weight: 500; }

/* Main dashboard */
.dashboard {
  padding: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon { font-size: 20px; }

/* Children cards */
.child-card {
  background: #f8f9fa;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #22A94B;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.child-name { font-size: 15px; font-weight: 600; }
.child-card-num { font-size: 12px; color: #888; margin-top: 2px; }

/* Abonement cards */
.abon-card {
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.abon-card.expired {
  opacity: 0.6;
  border-color: #e0e0e0;
}

.abon-card.active {
  border-color: #22A94B;
}

.abon-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.abon-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  padding-right: 8px;
}

.abon-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.abon-badge.active { background: #e8f5e9; color: #22A94B; }
.abon-badge.expired { background: #fbe9e7; color: #e53935; }
.abon-badge.paid { background: #e3f2fd; color: #1976d2; }

.abon-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.abon-info strong { color: #333; }

.btn-pay {
  width: 100%;
  padding: 12px;
  background: #FFCC00;
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-pay:hover { background: #e6b800; }

/* Nav tabs */
.nav-tabs {
  display: flex;
  border-top: 1px solid #e8e8e8;
  background: #fff;
  position: sticky;
  bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-tab {
  flex: 1;
  padding: 10px 4px 8px;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: #999;
  font-size: 10px;
  transition: color 0.2s;
}

.nav-tab.active { color: #22A94B; }
.nav-tab .nav-icon { font-size: 22px; display: block; margin-bottom: 2px; }
.nav-tab .nav-label { display: block; }

/* Install app modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.modal-icon { font-size: 48px; margin-bottom: 12px; }

.modal h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal p {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

.store-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: opacity 0.2s;
}

.store-btn:hover { opacity: 0.9; }
.store-btn.android { background: #22A94B; }
.store-btn.ios { background: #333; }
.store-btn .store-icon { font-size: 22px; }

.modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
  font-family: inherit;
}

/* QR modal */
.qr-modal {
  text-align: center;
}

.qr-amount {
  font-size: 28px;
  font-weight: 700;
  color: #22A94B;
  margin: 12px 0;
}

.qr-image {
  width: 220px;
  height: 220px;
  margin: 16px auto;
  background: #f5f5f5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image img { width: 200px; height: 200px; }

.qr-status {
  font-size: 14px;
  color: #888;
  margin: 12px 0;
}

.qr-status.paid { color: #22A94B; font-weight: 600; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: #22A94B;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* Responsive */
@media (max-width: 480px) {
  #app { max-width: 100%; }
}
