/* ═══════════════════════════════════════
   Umrlice – global stylesheet
   ═══════════════════════════════════════ */

:root {
  /* Topla, prigušena, žalobna paleta. Hladno-siva se bila sa tonom proizvoda. */
  --bg:            #f3f0e9;  /* topli papir umesto hladno-sive */
  --card:          #fdfcf9;  /* jedinstveno sa detalj-stranom */
  --text:          #24211c;  /* topli near-black */
  --muted:         #6b6459;  /* JEDINI muted; prolazi WCAG ~5:1 na svetlom */
  --border:        #d9d3c7;
  --primary:       #23201b;  /* topli ugalj umesto čistog crnog */
  --primary-hover: #100e0b;
  --danger:        #b0392b;
  --success:       #2e7d32;
  --radius:        14px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.13);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;   /* 15→16: publika je starija, sitan tekst je naporan */
  line-height: 1.6;
}

/* ── Layout ── */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 16px 40px;
}

.page--auth {
  align-items: center;
  justify-content: center;
  padding-top: 60px;
}

.container {
  width: min(1020px, 100%);
  margin: 0 auto;
}

/* ── Top navigation ── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
  height: 56px;
  background: var(--primary);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  margin-bottom: 28px;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.topnav__brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: 12px;
  padding: 6px 0;
  flex-shrink: 0;
}

.topnav__brand span {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .75rem;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: .04em;
}

.topnav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav__links::-webkit-scrollbar { display: none; }

.topnav a {
  text-decoration: none;
  color: rgba(255,255,255,.72);
  font-weight: 500;
  font-size: .875rem;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.topnav a:hover,
.topnav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.topnav__right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.topnav__user {
  color: rgba(255,255,255,.65);
  font-size: .85rem;
  font-weight: 600;
  padding: 6px 10px;
}

.topnav__logout {
  background: rgba(220,38,38,.18) !important;
  color: #fca5a5 !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  font-size: .85rem !important;
}

.topnav__logout:hover {
  background: rgba(220,38,38,.3) !important;
  color: #fff !important;
}

.topnav__debug {
  color: rgba(255,255,255,.4) !important;
  font-size: .75rem !important;
  padding: 4px 8px !important;
}

/* ── Page header ── */
.header {
  margin: 8px 0 24px;
}

.header h1 {
  margin: 0 0 4px;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.header p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 0 0 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

/* ── Buttons ── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  border: none;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  padding: 10px 22px;
  font-size: .9rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .01em;
  transition: background .2s, transform .15s, box-shadow .2s;
  line-height: 1.4;
}

.button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

.button:active { transform: translateY(0); }

.button--secondary {
  background: #e0ddd8;
  color: var(--text);
}

.button--secondary:hover {
  background: #ccc9c3;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.button--danger {
  background: var(--danger);
}

.button--danger:hover {
  background: #b91c1c;
  box-shadow: 0 6px 18px rgba(220,38,38,.28);
}

.button--sm {
  padding: 6px 14px;
  font-size: .8rem;
}

.button--lg {
  padding: 13px 28px;
  font-size: 1rem;
}

/* ── Forms ── */
.form label,
label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 16px 0 5px;
}

.form input,
.form select,
.form textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .95rem;
  font-family: inherit;
  background: #f9f9f7;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,.08);
  background: #fff;
}

textarea { resize: vertical; min-height: 90px; }

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Grid helper ── */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ── Alerts ── */
.alert {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: .9rem;
}

.alert ul { margin: 0; padding-left: 18px; }
.alert li { margin: 2px 0; }

.alert--danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* ── Stats bar ── */
.stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stats li {
  flex: 1 1 140px;
  background: linear-gradient(135deg, #f0efec 0%, #f5f4f1 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
}

.stats li strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1;
}

.stats li span {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Details list ── */
.details {
  display: grid;
  gap: 12px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.details dt {
  font-weight: 700;
  font-size: .82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.details dd {
  margin: 2px 0 10px;
  color: var(--text);
  font-size: .95rem;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  background: #f4f3f0;
}

th:first-child { border-radius: 8px 0 0 0; }
th:last-child  { border-radius: 0 8px 0 0; }

td {
  padding: 10px 12px;
  border-bottom: 1px solid #eeece8;
  vertical-align: middle;
  color: var(--text);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: #f5f4f1; }

/* ── Auth pages ── */
.auth-wrap {
  width: min(440px, 100%);
  margin: 0 auto;
  padding-top: 20px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo a {
  text-decoration: none;
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.auth-logo p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

/* ── Dashboard nav menu ── */
.menu-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  box-shadow: var(--shadow);
}

.menu-item:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  transform: translateY(-2px);
}

.menu-item__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.menu-item__sub {
  font-size: .78rem;
  font-weight: 400;
  color: var(--muted);
}

.menu-item--admin {
  border-color: #fde68a;
  background: #fffbeb;
}
.menu-item--admin:hover {
  border-color: #f59e0b;
  box-shadow: 0 6px 20px rgba(245,158,11,.15);
}

/* ── User info pill ── */
.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1c1c1c 0%, #2e2e2e 100%);
  border-radius: 12px;
  color: #fff;
  margin-bottom: 18px;
}

.user-pill__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
}

.user-pill__name {
  font-weight: 700;
  font-size: 1rem;
}

.user-pill__meta {
  font-size: .8rem;
  opacity: .7;
}

.user-pill__badge {
  margin-left: auto;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0 24px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.pagination a { background: var(--primary); color: #fff; }
.pagination a:hover { background: var(--primary-hover); }
.pagination span { background: #e4e2de; color: var(--muted); }

/* ── Misc helpers ── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.mt-0 { margin-top: 0; }

.highlight {
  animation: highlight-anim 2s ease-in-out;
}

@keyframes highlight-anim {
  0%   { background-color: rgba(255,221,0,.4); }
  70%  { background-color: rgba(255,221,0,.2); }
  100% { background-color: transparent; }
}

/* ── Footer ── */
.footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
}

/* ── Public nav (index.php) ── */
.pub-nav {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 58px;
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.28);
}

.pub-nav__brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-right: 16px;
  flex-shrink: 0;
}

.pub-nav__tabs {
  display: flex;
  gap: 2px;
  flex: 1;
}

.pub-nav__tab {
  text-decoration: none;
  color: rgba(255,255,255,.6);
  font-weight: 600;
  font-size: .875rem;
  padding: 7px 16px;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.pub-nav__tab:hover { background: rgba(255,255,255,.1); color: #fff; }

.pub-nav__tab--active {
  background: rgba(255,255,255,.16);
  color: #fff;
}

.pub-nav__auth {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.pub-nav__auth a {
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s;
}

.pub-nav__auth .btn-login { color: rgba(255,255,255,.75); }
.pub-nav__auth .btn-login:hover { background: rgba(255,255,255,.1); color: #fff; }

.pub-nav__auth .btn-register {
  background: #fff;
  color: var(--primary);
}
.pub-nav__auth .btn-register:hover { opacity: .9; }

/* ── Hero strip ── */
.hero-strip {
  background: linear-gradient(135deg, #1c1c1c 0%, #3a3a3a 100%);
  color: #fff;
  padding: 32px 0 28px;
  margin-bottom: 28px;
}

.hero-strip .container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.hero-strip h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-strip p {
  margin: 0;
  opacity: .7;
  font-size: .9rem;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stat {
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.filter-bar label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: block;
  margin-bottom: 4px;
}

.filter-bar select,
.filter-bar input[type="search"] {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .9rem;
  background: #f9f9f7;
  min-width: 150px;
  outline: none;
  transition: border-color .2s;
}

.filter-bar select:focus,
.filter-bar input[type="search"]:focus { border-color: var(--primary); }

/* ── Section label ── */
.section-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #c8c5c0;
}

/* ── Obituary card grid ── */
.obit-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 24px;
}

/* ── Obituary card — traditional notice style ── */
.obit-card {
  background: #fff;
  border: 1px solid #b0aaA0;
  outline: 5px solid #fff;
  outline-offset: -7px;
  box-shadow: 0 0 0 7px #b0aaa0, 0 4px 18px rgba(0,0,0,.12);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 20px;
  text-align: center;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  font-family: Georgia, "Times New Roman", serif;
}

.obit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 7px #888, 0 12px 32px rgba(0,0,0,.2);
}

.obit-card--muslim {
  border-color: #2e7d32;
  box-shadow: 0 0 0 7px #2e7d32, 0 4px 18px rgba(0,0,0,.12);
}
.obit-card--muslim:hover {
  box-shadow: 0 0 0 7px #1b5e20, 0 12px 32px rgba(0,0,0,.2);
}

.obit-card__symbol {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 14px;
  color: #111;
}

.obit-card--muslim .obit-card__symbol { color: #1b5e20; }

.obit-card__photo-wrap {
  width: 96px;
  height: 120px;
  border: 1.5px solid #888;
  overflow: hidden;
  background: #ccc;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.obit-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(100%);
  display: block;
}

.obit-card__no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c8c0b0;
  color: #888;
  font-size: .65rem;
  font-family: Georgia, serif;
}

.obit-card__name {
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #0d0d0d;
  margin: 0 0 4px;
  line-height: 1.3;
}

.obit-card__years {
  font-size: .8rem;
  color: #555;
  letter-spacing: 2px;
  margin: 0 0 10px;
}

.obit-card__desc {
  font-size: .78rem;
  color: #333;
  line-height: 1.65;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.obit-card__location {
  font-size: .72rem;
  color: #888;
  margin-top: auto;
  font-family: system-ui, sans-serif;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}

.empty-state__icon { font-size: 2.8rem; margin-bottom: 12px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .page { padding: 0 10px 32px; }
  .topnav { padding: 0 12px; }
  .topnav a { padding: 6px 10px; font-size: .8rem; }
  .card { padding: 16px; }
  .header h1 { font-size: 1.4rem; }
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .topnav__brand span { display: none; }
  .pub-nav { padding: 0 12px; }
  .pub-nav__brand { font-size: 1rem; }
  .pub-nav__auth .btn-login { display: none; }
  .hero-strip { padding: 22px 0 18px; }
  .obit-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

@media (max-width: 400px) {
  .obit-grid { grid-template-columns: 1fr; }
}
