:root {
  --silver: #9CA3AF;
  --charcoal: #484846;
  --platinum: #EDEEEE;
  --dim-grey: #666665;
  --carbon-black: #121519;
  --bg-dark: #121519;
  --bg-elev: #1A1E25;
  --surface: #1A1E25;
  --surface-2: #222731;
  --card-bg: #1A1E25;
  --card-border: #2B303B;
  --line: #2B303B;
  --text-main: #F3F4F6;
  --text: #F3F4F6;
  --text-muted: #9CA3AF;
  --accent: #FF6B00;
  --accent-hover: #E05D00;
  --accent-soft: #FF8A3D;
  --accent-glow: rgba(255, 107, 0, 0.32);
  --topbar-bg: rgba(18, 21, 25, 0.72);
  --nav-bg: rgba(34, 39, 49, 0.85);
  --on-accent: #1A0F05;
  --green: #34D399;
  --red: #F87171;
  --font: 'Barlow', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-d: 'Barlow Condensed', 'Barlow', system-ui, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

html[data-theme="day"] {
  --bg-dark: #EDEEEE;
  --bg-elev: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F5F6;
  --card-bg: #FFFFFF;
  --card-border: #DCDFE2;
  --line: #DCDFE2;
  --text-main: #18191A;
  --text: #18191A;
  --text-muted: #666665;
  --accent: #FF6B00;
  --accent-hover: #E05D00;
  --accent-soft: #E05D00;
  --accent-glow: rgba(255, 107, 0, 0.22);
  --topbar-bg: rgba(255, 255, 255, 0.78);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --on-accent: #FFFFFF;
  --green: #16A34A;
  --red: #DC2626;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font); }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
h1, h2, h3, .header-title, .brand { font-family: var(--font-d); letter-spacing: .01em; }
input, select, textarea { font-size: 16px; }

body {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(1200px 600px at 85% -15%, rgba(255, 107, 0, 0.09), transparent 60%),
    radial-gradient(900px 500px at -10% 115%, rgba(255, 107, 0, 0.06), transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }

/* Sidebar */
.sidebar { width: 240px; background-color: var(--surface-2); border-right: 1px solid var(--card-border); padding: 24px 16px; display: flex; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: bold; color: var(--text-main); }
.brand-logo { width: 36px; height: 36px; color: var(--on-accent); background: linear-gradient(140deg, var(--accent-soft), var(--accent)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: bold; box-shadow: 0 0 14px var(--accent-glow); }
.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-muted); text-decoration: none; border-radius: 10px; font-size: 0.95rem; transition: background .2s, color .2s; }
.nav-ico { width: 22px; text-align: center; font-size: 1.05rem; }
.nav-link:hover, .nav-link.active { background-color: var(--card-bg); color: var(--text-main); }
.nav-link.active { border-left: 3px solid var(--accent); color: var(--accent); box-shadow: inset 0 0 18px rgba(255,107,0,.06); }
.sidebar-footer { margin-top: auto; font-size: 0.8rem; color: var(--text-muted); }
.sf-user { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sf-name { color: var(--text-main); font-weight: 600; margin-bottom: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-av { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--card-border); color: var(--accent); font-weight: 700; font-size: .8rem; }
.sf-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top-av { border-color: var(--accent); }

/* Admin pregleda kao član */
.impersonate-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: linear-gradient(90deg, rgba(255,107,0,.16), rgba(255,107,0,.04)); border-bottom: 1px solid var(--accent); color: var(--text-main); font-size: .86rem; }
.impersonate-bar .btn-sm { margin-left: auto; }

/* Prekidač teme (dan / noć) */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--card-border); color: var(--text-main); padding: 9px 12px; border-radius: 10px; font-size: .84rem; font-weight: 600; cursor: pointer; margin-bottom: 12px; transition: border-color .2s, color .2s, background .2s; }
.theme-toggle .tt-ico { font-size: 1rem; line-height: 1; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.top-theme { padding: 0; width: 34px; height: 34px; justify-content: center; margin-bottom: 0; }

/* Main */
.main-content { flex: 1; padding: 32px; overflow-y: auto; overflow-x: hidden; min-width: 0; max-width: 100%; }
.header-title { background-image: url("fortis.png");  
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  height: 100%;
  font-size: 1.8rem; 
  margin-bottom: 24px; 
 /* background: linear-gradient(90deg, var(--text-main) 15%, var(--text-muted) 95%); 
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--accent); */ }

.card { background-color: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 20px; }
.card-title { font-size: 1.05rem; margin-bottom: 16px; color: var(--text-muted); font-weight: 600; }

/* Profile */
.dashboard-grid { display: grid; grid-template-columns: 280px 1fr 300px; gap: 20px; }
.profile-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--card-border); margin-bottom: 12px; object-fit: cover; }
.user-name { font-size: 1.2rem; font-weight: bold; margin-bottom: 4px; }
.user-rank { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }
.points-badge { background: rgba(255, 107, 0, 0.15); color: var(--accent); border: 1px solid var(--accent); padding: 10px 20px; border-radius: 20px; font-weight: bold; font-size: 1.1rem; width: 100%; box-shadow: 0 0 12px var(--accent-glow); }

/* Pristup (access validity) – istaknuta traka */
.access-banner {
  width: 100%;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.access-banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: currentColor; opacity: .9; }
.access-banner .ab-ico { font-size: 1.7rem; line-height: 1; }
.access-banner .ab-body { flex: 1; text-align: left; min-width: 0; }
.access-banner .ab-label { font-size: .72rem; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); }
.access-banner .ab-date { font-size: 1.35rem; font-weight: 800; color: var(--text-main); letter-spacing: .5px; }
.access-banner .ab-days { text-align: center; font-weight: 800; font-size: 1.4rem; line-height: 1; display: flex; flex-direction: column; }
.access-banner .ab-days span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .85; margin-top: 2px; }
.access-banner.access-ok { color: var(--green); box-shadow: 0 0 22px rgba(34, 197, 94, .14); }
.access-banner.access-soon { color: var(--accent); box-shadow: 0 0 22px var(--accent-glow); animation: ab-pulse 1.8s ease-in-out infinite; }
.access-banner.access-expired { color: var(--red); box-shadow: 0 0 22px rgba(239, 68, 68, .18); }
@keyframes ab-pulse { 0%, 100% { box-shadow: 0 0 18px var(--accent-glow); } 50% { box-shadow: 0 0 30px var(--accent-glow); } }

/* Badges */
.badges-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.badge-box { background: var(--surface-2); border: 1px solid var(--card-border); border-radius: 10px; padding: 16px 12px; text-align: center; transition: all 0.2s; }
.badge-box.unlocked { border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); }
.badge-icon { font-size: 1.8rem; margin-bottom: 8px; display: block; }
.badge-box.locked .badge-icon { filter: grayscale(100%); opacity: 0.3; }
.badge-name { font-size: 0.85rem; font-weight: bold; }
.badge-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--card-border); border-radius: 10px; padding: 14px; text-align: center; }
.stat-value { font-size: 1.4rem; font-weight: bold; color: var(--accent); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Visits */
.visits-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.visit-item { display: flex; justify-content: space-between; font-size: 0.85rem; padding-bottom: 8px; border-bottom: 1px solid var(--card-border); }
.visit-item:last-child { border-bottom: none; }

/* Winners */
.winners-list { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.winner-item { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; padding-bottom: 8px; border-bottom: 1px solid var(--card-border); }

/* Forms / buttons */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.form-control { width: 100%; background: var(--surface-2); border: 1px solid var(--card-border); color: var(--text-main); padding: 12px 14px; border-radius: 12px; font-size: 1rem; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-primary { background: var(--accent); color: var(--on-accent); border: none; width: 100%; padding: 12px; font-weight: bold; cursor: pointer; border-radius: 12px; font-size: 0.95rem; transition: background 0.2s; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--card-border); color: var(--text-main); width: 100%; padding: 10px; border-radius: 12px; cursor: pointer; margin-top: 10px; font-weight: bold; text-decoration: none; display: inline-block; text-align: center; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; width: auto; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 16px; }
.alert-error { background: rgba(239, 68, 68, 0.12); border: 1px solid var(--red); color: var(--red); }
.alert-success { background: rgba(34, 197, 94, 0.12); border: 1px solid var(--green); color: #86efac; }
.alert-info { background: rgba(255, 107, 0, 0.10); border: 1px solid var(--accent); color: #ffb27a; }

/* Auth */
.auth-wrap { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 100vh; padding: 24px; }
.auth-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 32px; width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-brand img { display: block; width: 100%; max-width: 262px; height: auto; border-radius: 10px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

/* Admin table */
.table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--card-border); white-space: nowrap; }
table.admin-table th { color: var(--text-muted); font-weight: 600; }
table.admin-table tr:hover td { background: var(--surface-2); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.72rem; background: var(--surface-2); border: 1px solid var(--card-border); color: var(--text-muted); }
.pill-grant { background: rgba(255, 107, 0, .12); border-color: rgba(255, 107, 0, .45); color: #ffb27a; font-weight: 600; }
.pill-ok { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .45); color: #86efac; font-weight: 600; }
.pill-warn { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .45); color: var(--red); font-weight: 600; }
.muted { color: var(--text-muted); }
.small { font-size: 0.8rem; }
.mt-20 { margin-top: 20px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.avatar-xs { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--card-border); vertical-align: middle; }

/* Mobile chrome (skriveno na desktopu) */
.mobile-topbar { display: none; }
.bottom-nav { display: none; }

/* Suptilni hover na desktopu */
@media (min-width: 901px) {
  .card { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
  .card:hover { transform: translateY(-2px); border-color: #3a4150; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
}

/* Tablet */
@media (max-width: 1000px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .badges-container { grid-template-columns: repeat(2, 1fr); }
}

/* Mobitel */
@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { display: none; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: var(--topbar-bg);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid var(--card-border);
  }
  .mobile-topbar .brand { font-size: 1.05rem; gap: 10px; }
  .mobile-topbar .brand-logo { width: 30px; height: 30px; font-size: 1rem; }
  .topbar-right { display: flex; align-items: center; gap: 10px; }
  .top-chip { font-size: .72rem; font-weight: 700; color: var(--accent); background: rgba(255,107,0,.12); border: 1px solid rgba(255,107,0,.35); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
  .top-logout { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--card-border); text-decoration: none; color: var(--text-muted); font-size: 1rem; }

  .main-content { padding: 18px 16px; padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .header-title { font-size: 1.5rem; margin-bottom: 18px; }

  /* Donja navigacija – plutajuće kartice */
  .bottom-nav {
    display: flex;
    gap: 6px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 50;
    padding: 8px;
    border-radius: 22px;
    background: var(--nav-bg);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .bn-item {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 4px 8px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-muted);
    transition: transform .18s ease, background .2s ease, color .2s ease;
  }
  .bn-item:active { transform: scale(.93); }
  .bn-ico { font-size: 1.25rem; line-height: 1; transition: transform .18s ease; }
  .bn-label { font-size: .66rem; font-weight: 600; letter-spacing: .2px; }
  .bn-item.active {
    color: var(--text-main);
    background: linear-gradient(180deg, rgba(255,107,0,.16), rgba(255,107,0,.04));
    box-shadow: inset 0 0 0 1px rgba(255,107,0,.45), 0 0 18px var(--accent-glow);
  }
  .bn-item.active .bn-ico { transform: translateY(-1px) scale(1.12); }
  .bn-item.active::after {
    content: "";
    position: absolute;
    top: 5px;
    width: 22px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
  }
}

@media (max-width: 480px) {
  .badges-container { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { gap: 14px; }
}

/* Promo – admin */
.grid-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start; }
.grid-2col > * { min-width: 0; }
.grid-2col > .card { height: auto; align-self: start; }
.row-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; padding-bottom: 12px; }
textarea.form-control { resize: vertical; }
.btn-danger { background: transparent; border: 1px solid var(--red); color: var(--red); padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; cursor: pointer; font-weight: bold; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.12); }

.promo-admin-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.promo-admin-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; background: var(--surface-2); border: 1px solid var(--card-border); border-radius: 14px; padding: 12px 14px; }
.pa-thumb { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px; background: var(--bg-dark) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; border: 1px solid var(--card-border); }
.pa-body { flex: 1 1 260px; min-width: 220px; }
.pa-title { font-weight: 700; font-size: 0.95rem; display: block; line-height: 1.35; overflow-wrap: break-word; }
.pa-title .pill { display: inline-block; vertical-align: middle; margin-left: 6px; }
.pa-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.pa-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pa-chip { font-size: .74rem; color: var(--text-muted); background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pa-chip-accent { color: var(--accent-soft); background: rgba(255,107,0,.12); border-color: rgba(255,107,0,.35); }
.pa-actions { flex: 1 1 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--card-border); }
.pa-actions form { margin: 0; }
.pa-actions .btn-outline, .pa-actions .btn-primary, .pa-actions .btn-danger { margin-top: 0; width: auto; }
.pa-actions .check-line { padding-bottom: 0; font-size: .74rem; }

/* Birač ikone bedža */
.icon-picker-wrap { display: flex; gap: 12px; align-items: flex-start; }
.icon-preview { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--card-border); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; }
.icon-picker { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; max-height: 136px; overflow-y: auto; padding: 8px; background: var(--bg-dark); border: 1px solid var(--card-border); border-radius: 12px; }
.icon-choice { aspect-ratio: 1; width: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; border-radius: 9px; border: 1px solid transparent; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.icon-choice:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-choice.is-active { background: rgba(255,107,0,.16); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.icon-custom { grid-column: 1 / -1; width: 100%; margin-top: 2px; padding: 8px 10px; border-radius: 9px; border: 1px dashed var(--card-border); background: var(--surface-2); color: var(--text-main); font-size: .85rem; text-align: center; }
.icon-custom:focus { outline: none; border-color: var(--accent); border-style: solid; }

/* Promo – član */
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.promo-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.promo-card:hover { transform: translateY(-3px); border-color: #3a4150; box-shadow: 0 14px 40px rgba(0, 0, 0, .4); }
.promo-card.is-claimed { border-color: rgba(255, 107, 0, .5); }
.promo-media { position: relative; height: 150px; background: linear-gradient(135deg, var(--card-bg), var(--bg-dark)) center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.promo-media-ico { font-size: 2.6rem; opacity: .85; }
.promo-benefit { position: absolute; top: 12px; left: 12px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: .8rem; padding: 5px 12px; border-radius: 999px; box-shadow: 0 0 16px var(--accent-glow); }
.promo-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.promo-title { font-size: 1.1rem; }
.promo-sub { font-size: .82rem; color: var(--text-muted); }
.promo-desc { font-size: .85rem; color: #cbd2dc; line-height: 1.45; }
.promo-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.promo-card .btn-primary { margin-top: 6px; }
.promo-claimed { display: flex; align-items: center; justify-content: space-between; background: rgba(255, 107, 0, .1); border: 1px solid rgba(255, 107, 0, .4); border-radius: 10px; padding: 8px 12px; margin-top: 6px; }

.code-chip { font-family: 'Consolas', monospace; font-weight: 700; letter-spacing: 1px; color: var(--accent); background: rgba(255, 107, 0, .12); border: 1px solid rgba(255, 107, 0, .4); padding: 4px 10px; border-radius: 8px; font-size: .85rem; white-space: nowrap; }

.promo-teaser { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--card-border); border-radius: 12px; padding: 10px 12px; text-decoration: none; margin-bottom: 8px; transition: border-color .2s, transform .2s; }
.promo-teaser:hover { border-color: var(--accent); transform: translateX(2px); }
.pt-ico { width: 40px; height: 40px; flex: 0 0 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255, 107, 0, .12); border: 1px solid rgba(255, 107, 0, .3); font-size: .9rem; font-weight: 800; color: var(--accent); text-align: center; }
.pt-txt { display: flex; flex-direction: column; min-width: 0; }
.pt-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.claims-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.claim-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--card-border); }
.claim-item:last-child { border-bottom: none; padding-bottom: 0; }
.claim-title { font-weight: 600; font-size: .9rem; }

/* Nagradne igre (giveaway) – član */
.win-banner { border-color: rgba(255, 107, 0, .5); background: linear-gradient(135deg, rgba(255, 107, 0, .12), rgba(255, 107, 0, .02)); }
.winner-name { font-weight: 700; font-size: .88rem; }

.giveaway-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.giveaway-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.giveaway-card:hover { transform: translateY(-3px); border-color: #3a4150; box-shadow: 0 14px 40px rgba(0, 0, 0, .4); }
.giveaway-card.is-won { border-color: rgba(255, 107, 0, .6); box-shadow: 0 0 0 1px rgba(255, 107, 0, .25), 0 14px 40px rgba(0, 0, 0, .4); }
.giveaway-media { position: relative; height: 160px; background: linear-gradient(135deg, var(--card-bg), var(--bg-dark)) center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.giveaway-media-ico { font-size: 3rem; opacity: .85; }
.giveaway-status { position: absolute; top: 12px; right: 12px; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, .55); border: 1px solid var(--card-border); color: #fff; backdrop-filter: blur(4px); }
.giveaway-status.status-open { background: rgba(34, 197, 94, .9); border-color: rgba(34, 197, 94, 1); }
.giveaway-status.status-drawn { background: rgba(255, 107, 0, .9); border-color: rgba(255, 107, 0, 1); }
.giveaway-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.giveaway-title { font-size: 1.1rem; }
.giveaway-prize { font-weight: 700; color: var(--accent); font-size: .9rem; }
.giveaway-body .btn-primary { margin-top: 6px; }

.entered-tag { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .45); color: #86efac; font-weight: 600; font-size: .82rem; padding: 6px 14px; border-radius: 999px; }
.win-tag { background: rgba(255, 107, 0, .14); border: 1px solid rgba(255, 107, 0, .5); color: #ffb27a; font-weight: 700; font-size: .85rem; padding: 10px 14px; border-radius: 10px; }
.winners-box { border-top: 1px solid var(--card-border); margin-top: 6px; padding-top: 12px; }
.winners-box-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.winners-box .winners-list { margin-top: 0; gap: 8px; }

.video-wrap { margin-top: 12px; }
.video-player { width: 100%; border-radius: 12px; background: #000; border: 1px solid var(--card-border); display: block; }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; border-radius: 12px; overflow: hidden; border: 1px solid var(--card-border); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Video kontent – član */
.video-group { margin-bottom: 32px; }
.video-group-title { font-size: 1.15rem; margin-bottom: 14px; color: var(--text); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.video-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s ease, box-shadow .2s ease; }
.video-card:hover { border-color: #3a4150; box-shadow: 0 14px 40px rgba(0, 0, 0, .4); }
.video-card-player { background: #000; }
.video-card-player .video-embed { border: 0; border-radius: 0; }
.video-card-player .video-player { border: 0; border-radius: 0; }
.video-card-body { padding: 16px 18px; }
.video-card-title { font-size: 1rem; margin-bottom: 6px; }

/* Admin – odabir članova za pristup */
.member-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 6px 16px; max-height: 340px; overflow-y: auto; border: 1px solid var(--card-border); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.mp-item { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; padding: 4px 0; }
.mp-item input { accent-color: var(--accent); }

/* Loto izvlačenje */
.loto-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.loto-stage { position: relative; background: #0f1218; border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; }
.loto-stage canvas { display: block; width: 100%; height: auto; }
.loto-rec { position: absolute; top: 12px; left: 14px; color: #ff4d4d; font-weight: 800; font-size: .8rem; letter-spacing: .08em; animation: ab-pulse 1s infinite; }
.loto-side { display: flex; flex-direction: column; gap: 16px; }
.loto-info-title { font-size: 1.05rem; font-weight: 700; }
.loto-btn { width: 100%; font-size: 1.05rem; padding: 14px; }
.loto-btn:disabled { opacity: .6; cursor: not-allowed; }
.loto-progress { height: 8px; background: var(--surface-2); border: 1px solid var(--card-border); border-radius: 999px; margin-top: 12px; overflow: hidden; }
.loto-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #FF6B00, #FFA24D); transition: width .1s linear; }

@media (max-width: 1000px) {
  .loto-wrap { grid-template-columns: 1fr; }
}

.meal-editor { min-height: 260px; font-size: .95rem; }

/* Alatna traka i pregled uživo (admin) */
.meal-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.meal-toolbar .btn-sm { padding: 4px 10px; }
.meal-preview-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-muted, #ACABAB); cursor: pointer; }
.meal-preview { margin-top: 14px; border: 1px dashed var(--card-border, var(--card-border)); border-radius: 14px; padding: 14px 16px; background: rgba(255,255,255,.015); }
.meal-preview-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted, #ACABAB); margin-bottom: 10px; }

/* Pregled plana (član) */
.meal-doc { margin-top: 4px; }
.meal-overview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 16px; padding: 10px 12px; border-radius: 12px; background: rgba(255,107,0,.06); border: 1px solid rgba(255,107,0,.2); }
.meal-overview-lbl { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-soft); }
.meal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.meal-chip { font-size: .78rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--card-border, var(--card-border)); color: var(--text, #EDEEEE); text-decoration: none; transition: background .15s, border-color .15s; }
.meal-chip:hover { background: rgba(255,107,0,.16); border-color: rgba(255,107,0,.4); color: var(--accent-soft); }
.plan-day { scroll-margin-top: 80px; }

/* Plan prehrane */
.meal-list { display: flex; flex-direction: column; gap: 20px; }
.meal-card { background: var(--card-bg, var(--card-bg)); border: 1px solid var(--card-border, var(--card-border)); border-radius: 16px; padding: 22px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.meal-title { font-size: 1.2rem; font-weight: 800; margin: 0; }
.meal-head-actions { display: flex; align-items: center; gap: 12px; }
.meal-content { color: var(--text, #EDEEEE); line-height: 1.7; white-space: pre-wrap; }
.meal-editor { min-height: 260px; font-size: .95rem; }

/* Strukturirani plan (tjedni meni + lista za kupovinu) */
.plan { display: flex; flex-direction: column; gap: 18px; }
.plan-h { font-size: 1.05rem; font-weight: 800; margin: 4px 0 0; color: var(--text, #EDEEEE); }
.plan-p { margin: 0; color: var(--text, #EDEEEE); line-height: 1.7; }
.plan-day { border: 1px solid var(--card-border, var(--card-border)); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.02); }
.plan-day-title { margin: 0; padding: 12px 16px; font-size: 1rem; font-weight: 800; background: linear-gradient(90deg, rgba(255,107,0,.16), transparent); border-bottom: 1px solid var(--card-border, var(--card-border)); color: var(--accent-soft); }
.plan-meal { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.04); }
.plan-meal:first-of-type { border-top: 0; }
.plan-meal-label { font-weight: 700; color: var(--text-muted, #ACABAB); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.plan-meal-body p { margin: 0 0 6px; color: var(--text, #EDEEEE); line-height: 1.6; }
.plan-macros { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.plan-macros i { font-style: normal; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: rgba(255,107,0,.14); color: var(--accent-soft); border: 1px solid rgba(255,107,0,.3); }
.plan-list { margin: 0; padding-left: 20px; color: var(--text, #EDEEEE); line-height: 1.8; }
.plan-shopping { border: 1px solid rgba(255,107,0,.35); border-radius: 14px; padding: 16px; background: rgba(255,107,0,.05); }
.plan-shopping-title { margin: 0 0 12px; font-size: 1rem; font-weight: 800; color: var(--accent-soft); }
.plan-shop-title { font-size: .95rem; font-weight: 700; margin: 12px 0 6px; color: var(--text, #EDEEEE); }
.plan-shop-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.plan-shop-item label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 8px; line-height: 1.5; }
.plan-shop-item label:hover { background: rgba(255,255,255,.04); }
.plan-shop-item input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.plan-shop-item.is-done span { text-decoration: line-through; opacity: .5; }
@media (max-width: 560px) {
  .plan-meal { grid-template-columns: 1fr; gap: 4px; }
}

/* Članstvo nije aktivno */
.membership-block { max-width: 480px; margin: 8vh auto 0; text-align: center; background: var(--card-bg, var(--card-bg)); border: 1px solid var(--card-border, var(--card-border)); border-radius: 16px; padding: 40px 28px; }
.membership-block .mb-ico { font-size: 3rem; margin-bottom: 8px; }
.membership-block .header-title { margin-bottom: 10px; }
.membership-block p { margin: 8px 0; }
.mb-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

/* --- Profil: statistika posjeta ------------------------- */
.stat-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stat-bar-row { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 8px; }
.stat-bar-label { font-size: 12px; color: var(--text-muted, #9aa4b2); white-space: nowrap; }
.stat-bar-track { display: block; height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.stat-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); border-radius: 6px; }
.stat-bar-val { font-size: 12px; text-align: right; color: var(--text-muted, #9aa4b2); }

/* --- Profil: sparkline ---------------------------------- */
.spark-wrap { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 16px; }
.spark-row { display: flex; align-items: center; gap: 12px; }
.spark-label { font-size: 12px; color: var(--text-muted, #9aa4b2); width: 58px; white-space: nowrap; }
.spark-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 600; margin: 6px 0 2px; }
svg.spark { width: 100%; height: 48px; display: block; background: var(--surface-2); border-radius: 8px; }

/* --- Profil: napredak građe ----------------------------- */
.progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.prog-item { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--card-border); border-left-width: 3px; }
.prog-item.prog-down { border-left-color: var(--green); }
.prog-item.prog-up { border-left-color: var(--accent); }
.prog-item.prog-flat { border-left-color: var(--card-border); }
.prog-label { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 600; }
.prog-values { font-size: .95rem; color: var(--text-main); }
.prog-values strong { color: var(--text-main); }
.prog-delta { font-size: .78rem; font-weight: 700; color: var(--text-muted); }
.prog-item.prog-down .prog-delta { color: var(--green); }
.prog-item.prog-up .prog-delta { color: var(--accent); }

/* --- Profil: povijest ulazaka --------------------------- */
.visit-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.visit-month { background: var(--surface-2); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 14px; }
.visit-month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: .9rem; color: var(--text-main); }
.visit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.visit-list li { font-size: .82rem; color: var(--text-muted); padding: 5px 0; border-bottom: 1px solid var(--card-border); }
.visit-list li:last-child { border-bottom: none; }

/* --- Profil: građa (vodi admin) ------------------------- */
.build-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.build-item { background: var(--surface-2); border: 1px solid var(--card-border, var(--card-border)); border-radius: 10px; padding: 10px 12px; }
.build-date { font-size: 12px; color: var(--text-muted, #9aa4b2); margin-bottom: 4px; }
.build-vals { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.build-note { margin-top: 6px; font-size: 13px; color: var(--text, #e6e8ec); }
.build-circ { margin-top: 5px; font-size: 12px; color: var(--text-muted, #9aa4b2); }

/* --- Obimi (admin) -------------------------------------- */
.circ-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.circ-grid .form-label { font-size: 12px; }
.form-narrow { max-width: 720px; }
.circ-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 340px; }
.circ-chip { font-size: .72rem; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--card-border); color: var(--text-muted); white-space: nowrap; }
.admin-table td.note-cell { white-space: normal; min-width: 160px; max-width: 260px; }

/* --- Program treninga ----------------------------------- */
.training-body { white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--text, #e6e8ec); }

/* --- Admin: responzivni raspored kartica ----------------- */
@media (max-width: 1240px) {
  .grid-2col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
}
/* ---- Plan prehrane: budžet u listi za kupovinu ---- */
.plan-shop-budget {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

/* ---- Admin: katalog namirnica (Hercegovina) + okvirni budžet ---- */
.food-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface-2);
}
.food-total-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px 0;
}
.food-total-bar strong { color: var(--accent); }
.food-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
.food-cat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.food-cat-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 2px 6px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.food-row {
  display: grid;
  grid-template-columns: 18px 1fr 58px auto 66px auto 18px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
}
.food-row.is-on { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.food-chk input { accent-color: var(--accent); }
.fi-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-qty, .fi-price {
  width: 100%;
  min-width: 0;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-main);
  font-size: 12px;
}
.fi-unit { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.fi-line { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; min-width: 76px; text-align: right; }
.food-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.food-actions .btn-primary { width: auto; }
@media (max-width: 640px) {
  .food-row { grid-template-columns: 18px 1fr 54px auto 58px; }
  .fi-line { display: none; }
}

@media (max-width: 1080px) {
  .grid-2col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .promo-admin-item { flex-wrap: wrap; }
  .pa-actions { width: 100%; justify-content: flex-start; }
  .pa-actions .btn-outline, .pa-actions .btn-primary, .pa-actions .btn-danger { flex: 1 1 auto; text-align: center; }
}
@media (max-width: 520px) {
  .row-form { grid-template-columns: 1fr; }
  .circ-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Namirnice: vlastite stavke (dodavanje/brisanje po kategorijama) ---- */
.fi-del {
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  width: 18px;
  height: 18px;
}
.fi-del:hover { color: #ef4444; background: rgba(239, 68, 68, .14); }
.fi-del.is-off { visibility: hidden; }
.food-add {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.food-add .form-control { padding: 4px 6px; font-size: 12px; height: auto; min-width: 0; }
.food-add .fa-name { flex: 1 1 auto; }
.food-add .fa-unit { flex: 0 0 52px; text-align: center; }
.food-add .fa-price { flex: 0 0 56px; }
.food-add .fa-btn { padding: 2px 9px; line-height: 1.5; }

/* ---- Modal: dodjela pristupa (video / prehrana) ---- */
.access-launch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.am-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 8, 14, .72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.am-backdrop.open { display: flex; }
.am-card {
  width: 100%;
  max-width: 680px;
  max-height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.am-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.am-title { font-size: 1.02rem; font-weight: 700; }
.am-sub { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.am-x { border: 0; background: none; color: var(--text-muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.am-x:hover { color: var(--text-main); }
.am-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.am-tools { display: flex; gap: 8px; align-items: center; padding: 0 20px; }
.am-tools .form-control { flex: 1 1 auto; }
.am-list { flex: 1 1 auto; margin: 12px 20px; max-height: none; }
.mp-item.is-hidden { display: none !important; }
.am-empty { grid-column: 1 / -1; }
.am-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.am-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  z-index: 90;
  background: var(--surface-2);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: .85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.am-toast.show { opacity: 1; transform: translate(-50%, 0); }
html.am-open, html.am-open body { overflow: hidden; }
@media (max-width: 560px) {
  .am-backdrop { padding: 10px; align-items: flex-end; }
  .am-card { max-height: 92vh; border-radius: 14px; }
  .am-tools { flex-wrap: wrap; }
  .am-foot { flex-direction: column; align-items: stretch; }
  .am-foot .btn-primary { width: 100%; }
}


/* ---- Prehrana (admin): širi lijevi box, uži desni, čitljiv katalog namirnica ---- */
.grid-2col.meal-grid { grid-template-columns: minmax(0, 2.3fr) minmax(300px, 1fr); }
@media (max-width: 1100px) {
  .grid-2col.meal-grid { grid-template-columns: 1fr; }
}

/* Katalog: kartice kategorija po 340px, više visine za pregled */
.meal-grid .food-cats {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  max-height: 640px;
}

/* Redak namirnice u dva reda: gore puni naziv (zalama se), dolje količina, jedinica, cijena, iznos */
.meal-grid .food-row {
  grid-template-columns: 22px 64px auto 72px minmax(0, 1fr) 22px;
  grid-template-areas:
    "chk  name name  name name del"
    ".    qty  unit  price line .";
  row-gap: 4px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
}
.meal-grid .food-row:last-child { border-bottom: 0; }
.meal-grid .food-chk   { grid-area: chk; }
.meal-grid .fi-name    { grid-area: name; white-space: normal; overflow: visible; text-overflow: clip; font-size: 14px; line-height: 1.35; font-weight: 600; }
.meal-grid .fi-qty     { grid-area: qty; }
.meal-grid .fi-unit    { grid-area: unit; }
.meal-grid .fi-price   { grid-area: price; }
.meal-grid .fi-line    { grid-area: line; min-width: 0; }
.meal-grid .fi-del     { grid-area: del; }
@media (max-width: 640px) {
  .meal-grid .food-row { grid-template-columns: 22px 64px auto 72px minmax(0, 1fr) 22px; }
  .meal-grid .fi-line { display: block; }
}
