:root {
  --bg: #ffffff;
  --surface: #f9f7fb;
  --surface-2: #f1ecf7;
  --border: #e5dcf0;
  --text: #18181b;
  --text-sec: #6b7280;
  --accent: #e040fb;
  --accent-dark: #b800d8;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--surface); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 560px; margin: 0 auto; padding: 0 1.25rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.3rem; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font); font-size: .9rem; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text); transition: transform .1s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(224,64,251,.35); }
.btn-secondary { background: var(--bg); border-color: var(--border); }
.btn-danger { background: none; color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.btn-full { width: 100%; }

.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; flex: 1; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; color: var(--text); }
input, select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: .92rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }

.alert { padding: .7rem 1rem; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.hidden { display: none !important; }

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 380px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.auth-logo { text-align: center; font-size: 1.7rem; font-weight: 800; margin-bottom: 1.5rem; }
.auth-logo span { color: var(--accent); }
.tab-switch { display: flex; border: 1px solid var(--border); border-radius: 999px; margin-bottom: 1.25rem; overflow: hidden; }
.tab-btn { flex: 1; padding: .55rem; border: none; background: none; font-family: var(--font); font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--text-sec); }
.tab-btn.active { background: var(--accent); color: #fff; }
.auth-back { display: block; text-align: center; margin-top: 1.25rem; font-size: .82rem; color: var(--text-sec); }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--bg); }
.nav-logo { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: .5rem; align-items: center; }

/* Panel tabs */
.panel-tabs { display: flex; gap: .5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.panel-tab { padding: .75rem 1.1rem; border: none; background: none; font-family: var(--font); font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--text-sec); border-bottom: 2px solid transparent; }
.panel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Grid kartice profilov */
.profil-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 1.1rem; }
.profil-kartica { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.profil-kartica:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.profil-kartica-foto { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.profil-kartica-info { padding: .75rem .9rem; }
.profil-kartica-ime { font-weight: 700; font-size: .95rem; }
.profil-kartica-meta { font-size: .8rem; color: var(--text-sec); }

/* Promocijske kartice (Simple, Blind Magik, AI Trener) v mreži profilov */
.promo-kartica { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: block; transition: transform .15s, box-shadow .15s; }
.promo-kartica:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.promo-kartica-vizual { width: 100%; aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: #fff; }
.promo-kartica-info { padding: .75rem .9rem; }
.promo-kartica-naslov { font-weight: 700; font-size: .95rem; }
.promo-kartica-opis { font-size: .78rem; color: var(--text-sec); margin-top: .15rem; }

/* Foto upload sloti */
.foto-sloti { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.foto-slot { width: 110px; height: 140px; border: 2px dashed var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; overflow: hidden; background: var(--surface-2); }
.foto-slot img { width: 100%; height: 100%; object-fit: cover; }
.foto-slot span { font-size: 1.6rem; color: var(--text-sec); }

.chip-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--border); font-size: .82rem; cursor: pointer; background: var(--bg); }
.chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1.25rem; }
.filter-label { font-size: .8rem; font-weight: 600; color: var(--text-sec); }

.text-sec { color: var(--text-sec); }
.text-center { text-align: center; }

footer.copyright { text-align: center; padding: 2rem 1rem; color: var(--text-sec); font-size: .8rem; }

.spinner {
  width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite;
}
.btn-secondary .spinner, .btn-danger .spinner { border-color: rgba(0,0,0,.15); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

.ac-wrap { position: relative; }
.ac-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  background: var(--bg); border: 1px solid var(--accent); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 220px; overflow-y: auto; display: none;
}
.ac-item { padding: .5rem .75rem; cursor: pointer; font-size: .88rem; }
.ac-item:hover { background: var(--surface); }
