/* WeaponLog Theme - brushed gunmetal background, bronze highlights, light text */
:root{
  --bg: #1b1d20;
  --panel: rgba(40, 42, 46, 0.70);
  --panel-2: rgba(32, 34, 38, 0.85);
  --border: rgba(255,255,255,0.08);
  --text: rgba(240,243,255,0.92);
  --muted: rgba(240,243,255,0.70);
  --bronze: #b08d57;
  --bronze-2: #8f6c3a;
  --danger: #d9534f;
}

html, body { height: 100%; }
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(circle at 20% 10%, rgba(255,255,255,0.04), transparent 45%),
              radial-gradient(circle at 80% 30%, rgba(176,141,87,0.12), transparent 50%),
              linear-gradient(180deg, rgba(24,26,30,1) 0%, rgba(15,16,18,1) 100%);
  background-attachment: fixed;
  background-color: #0f1012;
  color: var(--text);
}

a { color: var(--bronze); text-decoration: none; }
a:hover { color: #d2b07a; }

.container { max-width: 1600px; margin: 0 auto; padding: 18px; }

/* Page header with title + action buttons */
.kicker {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 16px 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(176,141,87,0.35);
  background: linear-gradient(180deg, rgba(176,141,87,0.18), rgba(176,141,87,0.08));
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { border-color: rgba(176,141,87,0.65); }
.btn.secondary {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(176,141,87,0.65);
  box-shadow: 0 0 0 3px rgba(176,141,87,0.15);
}
label { color: var(--muted); font-size: 0.9rem; }

.kv { display:grid; grid-template-columns: 140px 1fr; gap: 8px 12px; }
.k { color: var(--muted); }
.v { color: var(--text); }

.muted { color: var(--muted); }

/* Auth pages (centered, industry-standard) */
.auth-center {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}
.auth-card { width: 560px; max-width: 92vw; }
.auth-form { width: 100%; }
.auth-form .field-wrap { width: 360px; max-width: 100%; margin: 0 auto 14px auto; }
.auth-form label { display:block; margin-bottom: 6px; }
.auth-form input, .auth-form select, .auth-form textarea { width: 100%; }
.auth-form .actions { display:flex; justify-content:center; margin-top: 6px; }

.auth-links{ text-align:center; margin-top: 12px; }


/* Layout: constrain main app width (auth pages without sidebar) */
.container, main.container {
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 900px) {
  .container, main.container {
    max-width: 98%;
  }
  .container { padding: 10px; }
  .card { padding: 0 10px 12px; }
}


/* =========================
   v26 Layout + Consistent Spacing
   ========================= */

/* Overall page container */
.page{ flex: 1; }
.content{
  margin:0 auto;
  padding:22px 0 48px;
}

/* Cards/panels spacing */
.card,
.panel,
.box{
  margin-top:18px;
}
.card + .card,
.panel + .panel,
.box + .box{margin-top:18px;}

/* Button bars should have breathing room from cards */
.actions,
.action-row,
.btn-row{margin:14px 0 16px;}

/* Standardized buttons (same height; similar widths) */
.btn,
button.btn,
a.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:0 16px;
  border-radius:14px;
  font-weight:600;
  line-height:1;
  white-space:nowrap;
}
button.btn{font:inherit;}

/* Give action buttons a consistent baseline width */
.btn-ghost,
.btn-secondary,
.btn-danger{
  min-width:92px;
}

/* Ensure inline forms don't distort button sizing */
form{margin:0;}

/* Responsive media (weapon photos, invoice previews, etc.) */
.weapon-photo img,
img.responsive-img{
  max-width:100%;
  height:auto;
  display:block;
  border-radius:14px;
}
/* Ensure the image inside behaves nicely */
.ammo-photo img{
  max-width:100%;
  height:auto;
  display:block;
  border-radius:14px;
}

/* Detail page: info left, photo right */
.weapon-detail {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.weapon-info {
  flex: 1;
  min-width: 0;
}
.weapon-photo {
  flex-shrink: 0;
  width: 300px;
}
.weapon-photo img {
  width: 300px;
  height: 225px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.weapon-photo img:hover {
  opacity: 0.85;
}
@media (max-width: 768px) {
  .weapon-detail {
    flex-direction: column-reverse;
  }
  .weapon-photo {
    width: 210px;
  }
  .weapon-photo img {
    width: 210px;
    height: 158px;
  }
}

/* Photo lightbox modal */
.photo-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.photo-lightbox.active {
  display: flex;
}
.photo-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  object-fit: contain;
}

/* If a photo is shown in a grid/card, keep it sane */
.media-frame{max-width:100%;}
.media-frame img{max-width:100%;height:auto;}

/* =========================
   Sidebar layout (v30)
   - Fixed sidebar on desktop
   - Slide-out drawer on mobile
   - Slim top bar for user controls
   ========================= */

/* ── App shell: sidebar + main ────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: rgba(20, 22, 26, 0.99);
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 60;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Sidebar border starts below topbar so they read as one surface */
.sidebar::after {
  content: '';
  position: fixed;
  top: 100px;
  left: 239px;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
  z-index: 61;
}

.sidebar__header {
  min-height: 100px;
  padding: 0 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar__brand {
  display: flex;
  justify-content: center;
  text-decoration: none;
}

.sidebar__logo {
  height: 64px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.sidebar__nav {
  flex: 1;
  padding: 10px 0 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 10px 4px;
  opacity: 0.7;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-right: 10px;
  border-radius: 10px;
  color: rgba(240,243,255,0.78);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.sidebar__link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.sidebar__link.active {
  background: rgba(176,141,87,0.15);
  color: #d2b07a;
  font-weight: 600;
  position: relative;
  margin-right: 0;
  border-radius: 10px 0 0 10px;
}
.sidebar__link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--bronze);
  border-radius: 0 2px 2px 0;
}

.sidebar__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

/* ── Sidebar overlay (mobile) ─────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 55;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
  display: block;
}

/* ── Main area (right of sidebar) ─────────────────────────────── */
.main-area {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ──────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 22, 26, 0.99);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  min-height: 100px;
}

/* Auth-only topbar: show logo and center */
.topbar--auth {
  justify-content: space-between;
  padding: 14px 28px;
}

.topbar__hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.topbar__hamburger:hover {
  background: rgba(255,255,255,0.06);
}

/* Mobile logo in topbar — hidden on desktop, shown when sidebar is off-screen */
.topbar__mobile-brand {
  display: none;
  text-decoration: none;
  margin-right: auto;
}
.topbar__mobile-logo {
  height: 36px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,0.3));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  height: 60px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.35));
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Content area adjustments ─────────────────────────────────── */
.main-area .content {
  padding: 22px 32px 48px;
}

/* ── Mobile: sidebar becomes slide-out drawer ─────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .sidebar::after {
    display: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0,0,0,0.5);
  }
  .main-area {
    margin-left: 0;
  }
  .topbar__hamburger {
    display: flex;
  }
  .topbar__mobile-brand {
    display: flex;
  }
  .topbar {
    justify-content: flex-start;
    gap: 12px;
    min-height: 60px;
    padding: 0 14px;
  }
  .topbar-right {
    margin-left: auto;
  }
  .main-area .content {
    padding: 14px 14px 40px;
  }
}

/* Touch devices: same drawer behavior */
@media (pointer: coarse) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar::after {
    display: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0,0,0,0.5);
  }
  .main-area {
    margin-left: 0;
  }
  .topbar__hamburger {
    display: flex;
  }
  .topbar__mobile-brand {
    display: flex;
  }
  .topbar {
    justify-content: flex-start;
    gap: 12px;
    min-height: 60px;
    padding: 0 14px;
  }
  .topbar-right {
    margin-left: auto;
  }
}

/* Add breathing room above the dashboard button row */
.card .btn {
  margin-top: 10px;
  margin-bottom: 5px;
}
/* No extra margins for buttons inside tables or inline popovers */
.table .btn,
td .btn,
details .btn,
summary.btn {
  margin-top: 0;
  margin-bottom: 0;
}
/* Reset summary default browser styling when used as button */
summary.btn::-webkit-details-marker { display: none; }
summary.btn { list-style: none; }

/* Left-align all table content */
table th,
table td {
  text-align: left !important;
}
.table th:not(:last-child),
.table td:not(:last-child){
  padding-right: 20px;
}

/* Responsive tables — horizontal scroll on small screens */
.card .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.card {
  overflow-x: auto;
}
@media (max-width: 768px) {
  .table th:not(:last-child),
  .table td:not(:last-child){
    padding-right: 10px;
  }
}

/* Dashboard stat grid */
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 10px 0 18px;
}

/* 3 columns on desktop, collapses to 2 then 1 */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 10px 0 18px;
}

/* 4 columns on desktop, collapses to 2 then 1 */
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 10px 0 18px;
}

.grid5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 10px 0 18px;
}

@media (max-width: 1100px) {
  .grid3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .grid3 {
    grid-template-columns: 1fr;
  }
  .grid4 {
    grid-template-columns: 1fr;
  }
  .grid5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .grid5 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.dash-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 3px solid var(--bronze);
  background: linear-gradient(165deg, rgba(30, 32, 36, 0.95) 0%, rgba(20, 22, 26, 0.9) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 160, 73, 0.35);
  border-top-color: var(--bronze);
}

.dash-card--empty {
  visibility: hidden;
  min-height: 0;
}

@media (max-width: 1100px) {
  .dash-card--empty {
    display: none;
  }
}

.dash-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.dash-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.dash-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Secondary text in value (like "Rounds" or "/Year") */
.dash-value .dash-secondary {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.trend-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.trend-arrow.up {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.trend-arrow.down {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.trend-arrow.flat {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.dash-empty {
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.08);
  min-height: 72px;
}

/* =========================
   USER DROPDOWN (TOP RIGHT)
   ========================= */

.user-menu {
  position: relative;
  display: inline-block;
}

.user-menu__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-menu__dropdown {
  display: none; /* hidden by default */
  position: absolute;
  right: 10px;
  top: calc(100% + 8px);
  min-width: 190px;
  z-index: 999;
  border-radius: 14px;
  border: 1px solid rgba(212, 160, 73, 0.22);
  background: rgba(18, 18, 18, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.user-menu.is-open .user-menu__dropdown,
.user-menu[open] .user-menu__dropdown {
  display: block;
}

/* <details>/<summary> dropdown marker + layout */
.user-menu > summary {
  list-style: none;
}
.user-menu > summary::-webkit-details-marker {
  display: none;
}

.user-menu__item,
.user-menu__form button.user-menu__item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  display: block;
  border: 0;
  background: transparent;
  color: rgba(240, 243, 255, 0.95);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.user-menu__item:hover {
  background: rgba(212, 160, 73, 0.10);
}

.user-menu__item--danger {
  color: rgba(255, 120, 120, 0.95);
}

.user-menu__item--danger:hover {
  background: rgba(255, 120, 120, 0.10);
}

/* -------------------------
   Modal (Profile)
-------------------------- */
.wl-modal-open { overflow: hidden; }

.wl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  z-index: 999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ensure the HTML [hidden] attribute always wins (so the modal doesn't auto-show) */
.wl-modal-backdrop[hidden] {
  display: none !important;
}

.wl-modal {
  width: min(720px, 100%);
  max-height: none;
  margin: auto 0;
  border-radius: 16px;
  border: 1px solid rgba(212, 160, 73, 0.25);
  background: rgba(22, 22, 22, 0.95);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  overflow: visible;
  flex-shrink: 0;
}

.wl-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(212, 160, 73, 0.15);
  position: sticky;
  top: 0;
  background: rgba(22, 22, 22, 0.98);
  border-radius: 16px 16px 0 0;
  z-index: 10;
}

.wl-modal__title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wl-modal__close {
  padding: 6px 10px;
}

.wl-modal__body {
  padding: 14px;
}

/* Mobile modal adjustments */
@media (max-width: 600px) {
  .wl-modal-backdrop {
    padding: 16px 10px;
    align-items: flex-start;
  }
  
  .wl-modal {
    width: 100%;
    margin: 0;
    border-radius: 14px;
  }
  
  .wl-modal__header {
    border-radius: 14px 14px 0 0;
  }
  
  .wl-modal__body {
    padding: 12px;
  }
  
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-grid .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-grid label {
  font-size: 12px;
  color: rgba(240, 243, 255, 0.75);
}

.profile-grid input[type="text"],
.profile-grid input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(240, 243, 255, 0.95);
}

.profile-grid .full {
  grid-column: 1 / -1;
}

.profile-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: rgba(240, 243, 255, 0.95);
}

.profile-share__text {
  font-size: 14px;
  color: rgba(240, 243, 255, 0.95);
}

.profile-share input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.profile-delete-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  justify-content: flex-end;
}

.profile-consent {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(212, 160, 73, 0.10);
  border: 1px solid rgba(212, 160, 73, 0.18);
}

/* -------------------------
   Spinner and Progress Bar
-------------------------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(212, 160, 73, 0.25);
  border-top-color: var(--bronze);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--bronze-2), var(--bronze));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-bar.indeterminate {
  width: 30% !important;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { margin-left: 0; }
  50% { margin-left: 70%; }
  100% { margin-left: 0; }
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -------------------------
   Collapsible Profile Sections
-------------------------- */
.profile-section {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.profile-section:first-child {
  margin-top: 0;
}

.profile-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease;
  list-style: none;
}

.profile-section__header::-webkit-details-marker {
  display: none;
}

.profile-section__header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.profile-section__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.profile-section__chevron {
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.profile-section[open] .profile-section__header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.profile-section[open] .profile-section__chevron {
  transform: rotate(180deg);
}

.profile-section__content {
  padding: 14px;
}

.profile-section--danger {
  border-color: rgba(255, 100, 100, 0.15);
  background: rgba(255, 100, 100, 0.05);
  padding: 12px 14px;
}

/* =========================
   NOTIFICATION SYSTEM
   ========================= */

/* Notification Menu (Envelope Icon) */
.notif-menu {
  position: relative;
  display: inline-block;
}

.notif-menu > summary {
  list-style: none;
}

.notif-menu > summary::-webkit-details-marker {
  display: none;
}

.notif-menu__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.notif-menu__btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(176, 141, 87, 0.25);
}

.notif-menu[open] .notif-menu__btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(176, 141, 87, 0.35);
}

/* Envelope Icon States */
.notif-icon {
  transition: color 0.2s ease, transform 0.2s ease;
}

.notif-icon--inactive {
  color: rgba(240, 243, 255, 0.5);
}

.notif-icon--active {
  color: var(--bronze);
}

.notif-icon--pulse {
  animation: notif-pulse 0.5s ease-in-out 3;
}

@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Badge */
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--bronze);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Dropdown - matches user menu style */
.notif-menu__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 280px;
  max-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 999;
  border-radius: 14px;
  border: 1px solid rgba(212, 160, 73, 0.22);
  background: rgba(18, 18, 18, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.notif-menu[open] .notif-menu__dropdown {
  display: block;
}

.notif-dropdown__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.notif-dropdown__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px;
  color: var(--muted);
}

.notif-dropdown__empty-icon {
  font-size: 28px;
  opacity: 0.6;
}

.notif-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  text-decoration: none;
  color: rgba(240, 243, 255, 0.95);
  transition: background 0.1s ease;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.notif-dropdown__item:hover {
  background: rgba(212, 160, 73, 0.10);
}

.notif-dropdown__item--unread {
  background: rgba(212, 160, 73, 0.05);
}

.notif-dropdown__category {
  flex-shrink: 0;
  font-size: 14px;
}

.notif-dropdown__title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-dropdown__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bronze);
  flex-shrink: 0;
}

.notif-dropdown__footer {
  padding: 10px 12px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.notif-dropdown__view-all {
  font-size: 13px;
  color: var(--bronze);
  text-decoration: none;
}

.notif-dropdown__view-all:hover {
  text-decoration: underline;
}

/* -------------------------
   Notification Modal
-------------------------- */
.wl-modal--wide {
  width: min(900px, 95vw);
}

.wl-modal__body--no-pad {
  padding: 0;
}

.notif-modal__split {
  display: flex;
  min-height: 400px;
  max-height: 70vh;
}

.notif-modal__list {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.15);
}

.notif-modal__list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  font-size: 14px;
}

.notif-modal__list-items {
  flex: 1;
  overflow-y: auto;
}

.notif-modal__list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s ease;
}

.notif-modal__list-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-modal__list-item--selected {
  background: rgba(212, 160, 73, 0.12);
}

.notif-modal__list-item--unread {
  background: rgba(212, 160, 73, 0.06);
}

.notif-modal__checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.notif-modal__list-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.notif-modal__list-category {
  flex-shrink: 0;
  font-size: 13px;
}

.notif-modal__list-title {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-modal__list-title--unread {
  font-weight: 700;
}

.notif-modal__list-date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
}

.notif-modal__list-actions {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.1);
}

.notif-modal__list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--muted);
  flex: 1;
}

.notif-modal__empty-icon {
  font-size: 40px;
  opacity: 0.5;
}

/* Right Content Pane */
.notif-modal__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
}

.notif-modal__content-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--muted);
}

/* Message Container - wraps the actual message content */
.notif-modal__message-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

.notif-modal__content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.notif-modal__content-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.notif-modal__content-category--news {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.notif-modal__content-category--feature {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.notif-modal__content-category--maintenance {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

.notif-modal__content-category--tips {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.notif-modal__content-date {
  font-size: 12px;
  color: var(--muted);
}

.notif-modal__content-title {
  margin: 0 0 16px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notif-modal__content-body {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(240, 243, 255, 0.85);
}

.notif-modal__content-body p {
  margin: 0 0 12px 0;
}

.notif-modal__content-body p:last-child {
  margin-bottom: 0;
}

.notif-modal__content-image {
  margin-top: 16px;
}

.notif-modal__content-image img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Small buttons */
.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 700px) {
  .notif-menu__dropdown {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    width: auto;
    min-width: unset;
    max-width: none;
  }

  .notif-modal__split {
    flex-direction: column;
    max-height: none;
  }

  .notif-modal__list {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 200px;
  }

  .notif-modal__content {
    min-height: 250px;
  }

  .wl-modal--wide {
    width: 100%;
  }
}

/* -------------------------
   Weapon List Sections
-------------------------- */
.weapon-section {
  margin-top: 18px;
}

.weapon-section__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.weapon-section__summary::-webkit-details-marker {
  display: none;
}

.weapon-section__summary::before {
  content: "▸";
  display: inline-block;
  color: var(--bronze);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.weapon-section[open] > .weapon-section__summary::before {
  transform: rotate(90deg);
}

.weapon-section__summary:hover {
  background: rgba(212, 160, 73, 0.08);
  border-color: rgba(212, 160, 73, 0.25);
}

.weapon-section .table {
  margin-top: 12px;
}

/* -------------------------
   Membership Info (Simple Layout)
-------------------------- */
.membership-info {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.membership-info__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.membership-info__row:last-child {
  border-bottom: none;
}

.membership-info__label {
  color: var(--muted);
  font-size: 0.9rem;
}

.membership-info__value {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

/* ── Transfer / Sell modal form helpers ────────────────────────── */
.field-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 8px 0 3px 0;
}
.field-label:first-child { margin-top: 0; }
.form-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  font-size: 0.9rem;
}
.form-input:focus {
  border-color: rgba(176,141,87,0.65);
  box-shadow: 0 0 0 3px rgba(176,141,87,0.15);
}
@media (max-width: 600px) {
  #transferStep1 > div:first-child {
    grid-template-columns: 1fr !important;
  }
}

/* ── Mobile responsive utilities ──────────────────────────────── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  /* Detail tables: let th shrink on mobile */
  .table th[style*="width"] {
    width: auto !important;
    min-width: 90px;
  }
  /* Stack 2-col form grids on mobile */
  .maint-form-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}


/* =========================================================
   Missing definitions — used across templates
   ========================================================= */

/* ── Selection color (bronze to match theme) ──────────────── */
::selection {
  background: rgba(176,141,87,0.35);
  color: #fff;
}

/* ── Primary action button ────────────────────────────────── */
.btn-primary,
button.btn-primary,
a.btn-primary {
  background: linear-gradient(180deg, #c9a35e 0%, #9a7540 100%);
  color: #111;
  border: 1px solid rgba(176,141,87,0.5);
  font-weight: 700;
}
.btn-primary:hover {
  background: linear-gradient(180deg, #d4b06a 0%, #a67f48 100%);
  color: #111;
  border-color: rgba(212,176,106,0.7);
  box-shadow: 0 4px 16px rgba(176,141,87,0.3);
}
.btn-primary:active {
  transform: scale(0.97);
}

/* ── Danger button ────────────────────────────────────────── */
.btn-danger,
button.btn-danger,
a.btn-danger {
  background: linear-gradient(180deg, rgba(220,38,38,0.85) 0%, rgba(180,30,30,0.85) 100%);
  color: #fff;
  border: 1px solid rgba(239,68,68,0.4);
  font-weight: 700;
}
.btn-danger:hover {
  background: linear-gradient(180deg, rgba(239,68,68,0.95) 0%, rgba(200,40,40,0.95) 100%);
  border-color: rgba(239,68,68,0.6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239,68,68,0.25);
}
.btn-danger:active {
  transform: scale(0.97);
}

/* ── Small button variant ─────────────────────────────────── */
.btn-small,
button.btn-small,
a.btn-small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
  border-radius: 10px;
}

/* ── Button active/tap state (mobile feedback) ────────────── */
.btn:active,
button.btn:active,
a.btn:active {
  transform: scale(0.97);
  transition: transform 0.08s;
}

/* ── Badge (pill labels for dates, counts, statuses) ──────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(176,141,87,0.15);
  color: #d2b07a;
  white-space: nowrap;
}

/* ── Section divider (hr.sep) ─────────────────────────────── */
hr.sep,
.sep {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 20px 0;
}

/* ── Table links (clickable item names in lists) ──────────── */
.table-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.table-link:hover {
  color: var(--bronze);
}

/* ── form-control alias (unifies with form-input) ─────────── */
.form-control {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  font-size: 0.9rem;
}
.form-control:focus {
  border-color: rgba(176,141,87,0.65);
  box-shadow: 0 0 0 3px rgba(176,141,87,0.15);
}

/* ── Kicker stacked variant (detail page headers) ─────────── */
.kicker--stacked {
  display: block;
}

/* ── Empty state (reusable pattern for empty lists) ───────── */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
}
.empty-state__icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.5;
}
.empty-state__title {
  font-size: 1rem;
  margin-bottom: 6px;
}
.empty-state__subtitle {
  font-size: 0.88rem;
}

/* ── Delete confirmation card styling ─────────────────────── */
.confirm-delete {
  max-width: 600px;
}
.confirm-delete .actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ── Smooth focus transitions on all inputs ───────────────── */
input, select, textarea, .form-input, .form-control {
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* ── Safe area padding for iOS standalone mode ────────────── */
@supports (padding-top: env(safe-area-inset-top)) {
  .topbar {
    padding-top: env(safe-area-inset-top);
  }
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
