:root {
  --bg:          #0e0a08;
  --bg-2:        #16100d;
  --bg-card:     #1e1612;
  --border:      #3a2a20;
  --border-light:#4d3828;
  --burgundy:    #7b1f35;
  --burgundy-2:  #9b2844;
  --gold:        #c9973f;
  --gold-light:  #e4b86a;
  --cream:       #f0e8d8;
  --cream-dim:   #b8a890;
  --red-alert:   #c0392b;
  --green:       #2ecc71;
  --text:        #f0e8d8;
  --text-muted:  #8a7060;
  --radius:      6px;
  --radius-lg:   12px;
  --shadow:      0 4px 24px rgba(0,0,0,.5);
  --trans:       all .25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  line-height: 1.2;
  color: var(--cream);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.4rem; }

a { color: var(--gold); text-decoration: none; transition: var(--trans); }
a:hover { color: var(--gold-light); }

.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 2rem;
  background: rgba(14,10,8,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.nav-brand { display: flex; align-items: center; gap: 1rem; }
.nav-logos { display: flex; align-items: center; gap: .6rem; }
.logo-img { height: 34px; width: auto; object-fit: contain; filter: brightness(1.1); }
.logo-site { height: 38px; }
.brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem; font-weight: 600; letter-spacing: .05em;
  color: var(--gold); text-decoration: none;
}
.brand-name:hover { color: var(--gold-light); }
.nav-links {
  display: flex; align-items: center; gap: .3rem;
  list-style: none;
}
.nav-links a {
  padding: .45rem .9rem;
  font-size: .82rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--cream-dim);
  border-radius: var(--radius);
  transition: var(--trans);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold); background: rgba(201,151,63,.08);
}
.nav-user { display: flex; align-items: center; gap: .6rem; margin-left: .6rem; }
.user-badge {
  font-size: .8rem; color: var(--text-muted);
  padding: .3rem .7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
}
.btn-logout {
  font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em;
  padding: .38rem .85rem;
  background: transparent;
  color: var(--red-alert) !important;
  border: 1px solid var(--red-alert);
  border-radius: var(--radius);
}
.btn-logout:hover { background: var(--red-alert); color: #fff !important; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--cream); border-radius: 2px;
  transition: var(--trans);
}

.main-content { flex: 1; padding: 2.5rem 2rem; max-width: 1400px; margin: 0 auto; width: 100%; }

.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { margin-bottom: .4rem; }
.page-subtitle { color: var(--text-muted); font-size: .9rem; }

.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  position: relative; overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(123,31,53,.18) 0%, transparent 70%);
  pointer-events: none;
}
.auth-container {
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow), 0 0 60px rgba(123,31,53,.15);
  position: relative;
  animation: fadeUp .5s ease;
}
.auth-logos {
  display: flex; justify-content: center; align-items: center; gap: 1rem;
  margin-bottom: 2rem;
}
.auth-logos img { height: 40px; width: auto; filter: brightness(1.1); }
.auth-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem; font-weight: 300; text-align: center;
  color: var(--cream); margin-bottom: .4rem;
}
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: .85rem; margin-bottom: 2rem; }

.tab-group {
  display: flex; margin-bottom: 1.8rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.tab-btn {
  flex: 1; padding: .65rem;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); transition: var(--trans);
}
.tab-btn.active { background: var(--burgundy); color: #fff; }

.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block; font-size: .78rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .45rem;
}
.form-control, .form-select {
  width: 100%; padding: .7rem 1rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: .9rem;
  transition: var(--trans); outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,151,63,.15);
}
.form-select option { background: var(--bg-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.4rem;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  transition: var(--trans); white-space: nowrap; text-decoration: none;
}
.btn-primary {
  background: var(--burgundy); color: #fff;
}
.btn-primary:hover { background: var(--burgundy-2); color: #fff; transform: translateY(-1px); }
.btn-gold {
  background: var(--gold); color: var(--bg);
}
.btn-gold:hover { background: var(--gold-light); color: var(--bg); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--cream-dim);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger {
  background: transparent; color: var(--red-alert);
  border: 1px solid var(--red-alert);
}
.btn-danger:hover { background: var(--red-alert); color: #fff; }
.btn-sm { padding: .38rem .85rem; font-size: .75rem; }
.btn-full { width: 100%; justify-content: center; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: var(--trans);
}
.card:hover { border-color: var(--border-light); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1.1rem; color: var(--cream); }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem; margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative; overflow: hidden;
  transition: var(--trans);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--burgundy), var(--gold));
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.stat-icon { font-size: 1.6rem; margin-bottom: .7rem; }
.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem; font-weight: 300; color: var(--gold);
  line-height: 1;
}
.stat-label { font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); margin-top: .4rem; }

.hero-slider {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  height: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: 2.5rem 3rem;
  opacity: 0; transition: opacity .8s ease;
}
.slide.active { opacity: 1; }
.slide-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.slide:nth-child(1) .slide-bg { background: radial-gradient(ellipse at 80% 50%, rgba(123,31,53,.4) 0%, transparent 70%); }
.slide:nth-child(2) .slide-bg { background: radial-gradient(ellipse at 20% 50%, rgba(201,151,63,.2) 0%, transparent 70%); }
.slide:nth-child(3) .slide-bg { background: radial-gradient(ellipse at 60% 50%, rgba(46,78,50,.3) 0%, transparent 70%); }
.slide-content { position: relative; z-index: 1; }
.slide-eyebrow {
  font-size: .72rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .5rem;
}
.slide-title {
  font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 300;
  color: var(--cream); margin-bottom: .5rem;
}
.slide-text { color: var(--text-muted); font-size: .88rem; max-width: 380px; }
.slider-dots {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: .5rem; z-index: 10;
}
.slider-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border-light); cursor: pointer; transition: var(--trans);
  border: none;
}
.slider-dot.active { background: var(--gold); width: 20px; border-radius: 3px; }

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
table {
  width: 100%; border-collapse: collapse;
  font-size: .85rem;
}
thead {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
th {
  padding: .9rem 1rem;
  text-align: left;
  font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--gold); }
th .sort-icon { margin-left: .3rem; opacity: .4; }
th.sort-asc .sort-icon::after { content: ' ▲'; opacity: 1; color: var(--gold); }
th.sort-desc .sort-icon::after { content: ' ▼'; opacity: 1; color: var(--gold); }
td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--cream-dim);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(201,151,63,.04); }
.td-highlight { color: var(--cream); font-weight: 500; }
.badge {
  display: inline-block; padding: .2rem .65rem;
  font-size: .72rem; font-weight: 500; letter-spacing: .04em;
  border-radius: 20px;
}
.badge-biele    { background: rgba(201,151,63,.15); color: var(--gold-light); }
.badge-cervene  { background: rgba(123,31,53,.3);   color: #e07090; }
.badge-ruzove   { background: rgba(200,100,120,.15); color: #e8a0b0; }
.badge-default  { background: rgba(255,255,255,.05); color: var(--cream-dim); }

.filters-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: .8rem; margin-bottom: 1.5rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.filter-group { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 140px; }
.filter-label { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.filter-control { padding: .55rem .85rem; }
.filters-actions { display: flex; gap: .5rem; align-items: flex-end; padding-bottom: 0; }

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem; width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp .25s ease;
  position: relative;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.8rem;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.4rem; line-height: 1;
  transition: var(--trans);
}
.modal-close:hover { color: var(--cream); }

.pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: .4rem; margin-top: 1.2rem;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 .6rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  font-size: .8rem; color: var(--cream-dim);
  transition: var(--trans); text-decoration: none;
}
.page-btn:hover, .page-btn.active {
  border-color: var(--gold); color: var(--gold);
}
.page-btn.active { background: rgba(201,151,63,.1); }

.stat-section { margin-bottom: 3rem; }
.stat-section h2 { margin-bottom: 1.4rem; }
.chart-bar-wrap {
  display: flex; flex-direction: column; gap: .7rem;
}
.chart-bar-row { display: flex; align-items: center; gap: .8rem; }
.chart-bar-label { min-width: 140px; font-size: .82rem; color: var(--cream-dim); text-align: right; }
.chart-bar-track {
  flex: 1; height: 22px;
  background: var(--bg-2);
  border-radius: 3px; overflow: hidden; position: relative;
}
.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--burgundy), var(--gold));
  border-radius: 3px;
  transition: width 1s ease;
  position: relative;
}
.chart-bar-val {
  min-width: 60px; font-size: .8rem;
  color: var(--gold); text-align: right;
}
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem;
  border-top: 2px solid var(--gold);
}
.kpi-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem; color: var(--gold); line-height: 1;
}
.kpi-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-top: .4rem; }

.alert {
  padding: .8rem 1.2rem; border-radius: var(--radius);
  font-size: .85rem; margin-bottom: 1rem;
  border-left: 3px solid;
}
.alert-error   { background: rgba(192,57,43,.12); border-color: var(--red-alert); color: #e07070; }
.alert-success { background: rgba(46,204,113,.1);  border-color: var(--green);    color: #80e0a0; }

.footer {
  border-top: 1px solid var(--border);
  padding: 1.8rem 2rem;
  background: var(--bg-2);
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.footer-logos { display: flex; gap: .8rem; }
.footer-logos img { height: 28px; width: auto; opacity: .6; filter: grayscale(.4); }
.footer-text { color: var(--text-muted); font-size: .82rem; flex: 1; }
.footer-copy  { color: var(--border-light); font-size: .75rem; }

@keyframes fadeUp  { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }

.fade-up { animation: fadeUp .5s ease both; }
.fade-up-1 { animation-delay: .1s; }
.fade-up-2 { animation-delay: .2s; }
.fade-up-3 { animation-delay: .3s; }
.fade-up-4 { animation-delay: .4s; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .7rem 1rem; }
  .nav-user { flex-direction: column; align-items: flex-start; }
  .navbar { position: relative; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .main-content { padding: 1.5rem 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-slider { height: 180px; }
  .slide { padding: 1.5rem; }
  .slide-title { font-size: 1.4rem; }
  .filters-bar { flex-direction: column; }
  .filter-group { min-width: 100%; }
  .modal { margin: 1rem; max-width: calc(100% - 2rem); }
}

.admin-badge {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}