:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-shadow: rgba(37, 99, 235, 0.3);
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(0, 0, 0, 0.08);
  --success-color: #10b981;
  --danger-color: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "IRANSans", "IRANSansX", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-color);
  color: var(--text-main);
  padding-bottom: 90px;
}

.top-bar {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar .brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
}

.top-bar .user-badge {
  font-size: 0.8rem;
  background-color: #e0e7ff;
  color: #3730a3;
  padding: 5px 12px;
  border-radius: 9999px;
  font-weight: 700;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* Bottom Navigation (Native App Style) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 72px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: 9999;
  padding: 0 10px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
  direction: rtl;
}

.bottom-nav .nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-decoration: none;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, color 0.2s ease;
}

.bottom-nav .nav-item:active {
  transform: scale(0.96);
}

.bottom-nav .nav-item.active {
  color: #ffffff;
}

.nav-label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  transition: all 0.2s ease;
}

.bottom-nav .nav-item.active .nav-label {
  background: var(--primary-color);
  box-shadow: 0 4px 14px var(--primary-shadow);
}

@media (max-width: 640px) {
  .bottom-nav {
    height: 66px;
  }

  .nav-label {
    min-width: 42px;
    min-height: 40px;
    padding: 0 10px;
    font-size: 12.5px;
  }
}

/* Modal Scanner */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  padding: 18px;
  position: relative;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

#reader {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000000;
}
