:root {
  --bg: #0a0a0a;
  --surface: #161616;
  --surface-elevated: #1f1f1f;
  --olive: #6b8e23;
  --olive-dark: #4f6a18;
  --olive-light: #8fbc3f;
  --text: #f0f0f0;
  --text-muted: #8a8a8a;
  --border: #2a2a2a;
  --danger: #c44c4c;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

header {
  background: #111;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--olive-light);
}

.menu {
  position: absolute;
  top: 70px;
  left: 16px;
  right: 16px;
  background: #161616;
  border-radius: 16px;
  border: 1px solid #2a2a2a;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
}

.menu.hidden {
  display: none;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 14px 18px;
  font-size: 1rem;
  border-bottom: 1px solid #222;
  cursor: pointer;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:active, .menu-item.active {
  background: var(--olive);
  color: #0a0a0a;
}

#tutorial {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-box {
  background: #161616;
  border-radius: 18px;
  padding: 24px 20px;
  margin: 20px;
  max-width: 320px;
  text-align: center;
  border: 1px solid #2a2a2a;
}

.tutorial-box p {
  margin-bottom: 18px;
  font-size: 1rem;
  line-height: 1.4;
}

main {
  padding: 16px 16px 40px;
  max-width: 680px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  border: 1px solid #222;
}

.firearm-card {
  padding: 14px;
}

.firearm-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.firearm-photo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
}

.placeholder-photo {
  background: #222;
  border: 1px dashed #444;
}

.firearm-info strong {
  font-size: 1.05rem;
  display: block;
}

.firearm-info small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.firearm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

button.primary.small {
  width: auto;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.list-item strong {
  font-weight: 600;
  font-size: 1rem;
}

.list-item small {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: block;
  margin-top: 2px;
}

input, select, textarea {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 12px;
  font-size: 0.96rem;
}

button.primary {
  background: var(--olive);
  border-radius: 14px;
  padding: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  margin-top: 4px;
}

.nav-btn {
  padding: 9px 16px;
  font-size: 0.88rem;
}

.nav-btn.active {
  background: var(--olive);
  color: #0a0a0a;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--olive-light);
}

input, select, textarea {
  width: 100%;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  margin-bottom: 10px;
  outline: none;
  transition: border 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--olive);
}

button.primary {
  background: var(--olive);
  color: #0a0a0a;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  font-size: 0.95rem;
  transition: opacity 0.15s;
}

button.primary:active {
  opacity: 0.85;
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}

.actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  border: 1px solid #222;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--olive-light);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.month-stats {
  display: flex;
  gap: 32px;
}

.activity-item {
  padding: 10px 0;
  border-bottom: 1px solid #222;
  font-size: 0.95rem;
}

.activity-item:last-child { border-bottom: none; }

.low-ammo-card {
  border-left: 3px solid #c44c4c;
}

.caliber-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #222;
  font-size: 0.95rem;
}
.caliber-row:last-child { border-bottom: none; }