:root{
  --brand:#760128;
  --bg:#0f0f12;
  --card:#17171c;
  --muted:#9aa0a6;
  --text:#f2f3f5;
  --border:#2a2a33;
  --ok:#2ecc71;
  --warn:#f39c12;
  --danger:#e74c3c;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
  background:linear-gradient(180deg,#0d0d10 0%, #101018 100%);
  color:var(--text);
}

a{color:inherit}
.container{
  max-width:1200px;
  margin:0 auto;
  padding:20px;
}

.topbar{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:rgba(23,23,28,.85);
  border:1px solid var(--border);
  border-radius:16px;
  backdrop-filter: blur(8px);
}
.topbar img{width:42px;height:42px;}
.topbar h1{font-size:22px;margin:0;font-weight:700;letter-spacing:.2px;}
.topbar .spacer{flex:1}

.card{
  margin-top:14px;
  padding:16px;
  background:rgba(23,23,28,.85);
  border:1px solid var(--border);
  border-radius:16px;
  backdrop-filter: blur(8px);
}

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-end;
}

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background:var(--brand);
  color:white;
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:650;
  letter-spacing:.2px;
  transition: transform .05s ease, opacity .15s ease;
  text-decoration:none;
  display:inline-flex;
  gap:8px;
  align-items:center;
}
.btn:hover{opacity:.95}
.btn:active{transform: translateY(1px);}
.btn.secondary{
  background:transparent;
  border:1px solid rgba(255,255,255,.18);
}
.btn.danger{
  background:transparent;
  border:1px solid rgba(231,76,60,.5);
  color:#ffb3ad;
}

.kpi{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}
.kpi .box{
  min-width:240px;
  padding:14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(15,15,18,.55);
}
.kpi .label{color:var(--muted); font-size:12px;}
.kpi .value{font-size:24px; font-weight:750; margin-top:4px;}

label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px;}
input, select, textarea{
  width:100%;
  padding:10px 11px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(12,12,15,.75);
  color:var(--text);
  outline:none;
}
textarea{min-height:110px; resize:vertical;}
input[type="file"]{padding:8px;}
input::placeholder{color:rgba(154,160,166,.65);}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
}
.col-12{grid-column: span 12;}
.col-6{grid-column: span 6;}
.col-4{grid-column: span 4;}
.col-3{grid-column: span 3;}
.col-2{grid-column: span 2;}

@media (max-width: 900px){
  .col-6,.col-4,.col-3,.col-2{grid-column: span 12;}
  .kpi .box{min-width:unset; flex:1}
}

.tablewrap{overflow:auto; border-radius:14px; border:1px solid var(--border);}
.tablewrap.token-history-scroll{max-height:230px;}
.tablewrap.token-history-scroll thead th{position:sticky;top:0;z-index:1;}
.tablewrap.user-list-scroll{max-height:620px;}
.tablewrap.user-list-scroll thead th{position:sticky;top:0;z-index:1;}
table{
  width:100%;
  border-collapse:collapse;
  min-width:900px;
  background:rgba(12,12,15,.45);
}
th, td{
  padding:12px 10px;
  border-bottom:1px solid rgba(255,255,255,.06);
  text-align:left;
  vertical-align:middle;
}
th{font-size:12px; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.06em;}
td{font-size:14px;}
.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  font-size:12px;
  color:rgba(242,243,245,.92);
}
.muted{color:var(--muted);}

.pro-module-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:12px;
}
.pro-module{
  min-height:150px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(12,12,15,.42);
}
.pro-module h3{
  margin:0;
  font-size:16px;
}
.pro-module p{
  margin:10px 0 14px 0;
  color:rgba(242,243,245,.82);
  line-height:1.45;
}
.pro-module.is-disabled{
  opacity:.72;
}
.pro-module.is-enabled{
  border-color:rgba(46,204,113,.34);
  background:rgba(46,204,113,.055);
}
.pro-feature-checks{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:8px 12px;
  margin-top:12px;
}
.pro-feature-checks label{
  display:flex;
  gap:8px;
  align-items:flex-start;
  margin:0;
  color:rgba(242,243,245,.9);
  font-size:13px;
}
.pro-feature-checks input{
  width:auto;
  margin-top:2px;
}
.pro-wine-config-table{
  min-width:1320px;
}
.inline-check{
  display:flex;
  gap:8px;
  align-items:center;
  margin:0 0 8px 0;
  color:rgba(242,243,245,.92);
  font-size:13px;
}
.inline-check input{
  width:auto;
}
.pro-price-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(74px,1fr));
  gap:6px;
}
.pro-btg-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(82px,1fr));
  gap:6px;
}
.pro-price-grid input,
.pro-btg-grid input{
  padding:8px;
  border-radius:8px;
}
.wine-menu-section{
  margin-top:18px;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.12);
}
.wine-menu-section h3{
  margin:0 0 10px 0;
  font-size:20px;
}
.wine-menu-section h4{
  margin:16px 0 8px 0;
  color:var(--muted);
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.wine-menu-line{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.07);
}
.wine-menu-line strong{
  display:block;
  font-size:16px;
}
.wine-menu-line span{
  color:rgba(242,243,245,.72);
}
.wine-menu-prices{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:flex-start;
  font-weight:700;
}
.wine-menu-prices span{
  color:rgba(242,243,245,.95);
  white-space:nowrap;
}
@media (max-width: 700px){
  .wine-menu-line{grid-template-columns:1fr;}
  .wine-menu-prices{justify-content:flex-start;}
}

.notice{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(242,243,245,.9);
}
.notice.ok{border-color: rgba(46,204,113,.35); background: rgba(46,204,113,.08);}
.notice.err{border-color: rgba(231,76,60,.35); background: rgba(231,76,60,.08);}

.announcement{
  display:block;
  margin-top:14px;
  padding:14px 16px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  border-left-width:5px;
  color:var(--text);
  text-decoration:none;
  box-shadow:0 8px 22px rgba(0,0,0,.14);
}
.announcement h3{margin:0;font-size:16px;line-height:1.35;}
.announcement-body{white-space:normal;line-height:1.5;}
.announcement-meta{display:block;color:rgba(242,243,245,.72);font-size:12px;margin-bottom:4px;}
.announcement-compact{margin-top:0;}
.announcement-compact strong{display:block;margin:0;font-size:15px;line-height:1.35;}
.announcement-compact span:last-child{display:block;color:rgba(242,243,245,.88);line-height:1.45;}
.announcement-green{border-color:rgba(46,204,113,.45);border-left-color:#2ecc71;background:linear-gradient(90deg,rgba(46,204,113,.16),rgba(46,204,113,.065));}
.announcement-yellow{border-color:rgba(243,156,18,.50);border-left-color:#f39c12;background:linear-gradient(90deg,rgba(243,156,18,.18),rgba(243,156,18,.07));}
.announcement-red{border-color:rgba(231,76,60,.50);border-left-color:#e74c3c;background:linear-gradient(90deg,rgba(231,76,60,.17),rgba(231,76,60,.065));}
.announcement-blue{border-color:rgba(52,152,219,.50);border-left-color:#3498db;background:linear-gradient(90deg,rgba(52,152,219,.17),rgba(52,152,219,.065));}
.announcement-pill{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  font-size:12px;
}
.announcement-pill-green{border-color:rgba(46,204,113,.42);background:rgba(46,204,113,.10);}
.announcement-pill-yellow{border-color:rgba(243,156,18,.45);background:rgba(243,156,18,.11);}
.announcement-pill-red{border-color:rgba(231,76,60,.45);background:rgba(231,76,60,.10);}
.announcement-pill-blue{border-color:rgba(52,152,219,.45);background:rgba(52,152,219,.10);}

.footer{
  color:rgba(154,160,166,.75);
  font-size:12px;
  margin-top:20px;
  text-align:center;
}

.pagination{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}
.pagination .pages{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
}
.pagination .meta{
  color:rgba(154,160,166,.85);
  font-size:12px;
}
th a{color:inherit; text-decoration:none;}
th a:hover{text-decoration:underline;}
.sort-ind{opacity:.8; margin-left:6px; font-size:11px;}


/* Nr groß + System-ID klein daneben (kein Umbruch) */
.idpair{white-space:nowrap;}
.idpair .muted{margin-left:6px;font-size:.82em;opacity:.65;}

/* -----------------------------
   Responsive Navigation
   ----------------------------- */
.brand{display:flex;align-items:center;gap:12px;min-width:240px;}
.brand-text{display:flex;flex-direction:column;gap:2px;}
.userline{display:flex;gap:8px;align-items:center;color:rgba(154,160,166,.9);font-size:12px;}

.nav-links{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.nav-toggle{display:none;}
.language-switch{display:inline-flex;align-items:center;gap:4px;padding:0 4px;}
.language-switch a{color:var(--text);font-size:12px;font-weight:700;text-decoration:none;opacity:.65;padding:6px 5px;border-radius:8px;}
.language-switch a:hover,.language-switch a.active{opacity:1;background:rgba(255,255,255,.08);}

/* Screenreader-only text */
.sr-only{
  position:absolute !important;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* Hamburger icon */
.hamburger{display:inline-block;position:relative;width:18px;height:14px;}
.hamburger::before{
  content:'';position:absolute;left:0;right:0;top:0;height:2px;
  background:currentColor;border-radius:2px;
  box-shadow:0 6px 0 currentColor;
}
.hamburger::after{
  content:'';position:absolute;left:0;right:0;top:12px;height:2px;
  background:currentColor;border-radius:2px;
}

@media (max-width: 900px){
  .container{padding:14px;}
  .topbar{flex-wrap:wrap;}
  .brand{flex:1 1 auto;}

  .nav-toggle{display:inline-flex;margin-left:auto;}
  .nav-links{width:100%;display:none;flex-direction:column;align-items:stretch;margin-left:0;}
  .nav-links.open{display:flex;}
  .nav-links a{width:100%;justify-content:center;}
  .nav-links .language-switch{justify-content:center;width:100%;}
  .nav-links .language-switch a{width:auto;}
}

/* -----------------------------
   Responsive Tables (Card-View)
   - apply to tables with class .table-cards and td[data-label]
   ----------------------------- */
@media (max-width: 900px){
  table.table-cards{min-width:unset;}
  table.table-cards thead{display:none;}
  table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td{display:block;width:100%;}
  table.table-cards tr{
    border:1px solid rgba(255,255,255,.10);
    border-radius:14px;
    padding:10px 12px;
    margin:10px 0;
    background:rgba(12,12,15,.40);
  }
  table.table-cards td{
    border:0;
    padding:8px 0;
    display:flex;
    justify-content:space-between;
    gap:12px;
  }
  table.table-cards td::before{
    content: attr(data-label);
    color:var(--muted);
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.06em;
    flex:0 0 auto;
  }
  table.table-cards td[data-label="Aktion"]{display:block;}
  table.table-cards td[data-label="Aktion"]::before{display:none;}
  table.table-cards td[data-label="Aktion"] .row{flex-wrap:wrap !important;}
}
.badge.stock-zero{
  border:0;
  padding:0 6px;
  background:#ffb3ad !important;
  border-color:transparent !important;
  color:#111 !important;
}
input.stock-zero{
  background:#ffb3ad !important;
}

.lightbox-open{overflow:hidden;}
.cellario-lightbox{
  position:fixed;
  inset:0;
  z-index:2147483647;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.86);
  padding:22px;
}
.cellario-lightbox.open{display:flex;}
.cellario-lightbox-frame{
  position:relative;
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cellario-lightbox img{
  max-width:calc(100vw - 44px);
  max-height:calc(100vh - 44px);
  object-fit:contain;
  border-radius:10px;
  box-shadow:0 20px 60px rgba(0,0,0,.55);
  background:#fff;
}
.cellario-lightbox button{
  position:absolute;
  appearance:none;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(15,15,18,.72);
  color:#fff;
  cursor:pointer;
  border-radius:999px;
  width:46px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  line-height:1;
  backdrop-filter:blur(8px);
}
.cellario-lightbox button:hover{background:rgba(118,1,40,.9);}
.cellario-lightbox-close{top:12px;right:12px;}
.cellario-lightbox-prev{left:12px;top:50%;transform:translateY(-50%);}
.cellario-lightbox-next{right:12px;top:50%;transform:translateY(-50%);}
.cellario-lightbox-count{
  position:absolute;
  left:50%;
  bottom:12px;
  transform:translateX(-50%);
  color:rgba(242,243,245,.86);
  background:rgba(15,15,18,.72);
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
}
@media (max-width: 760px){
  .cellario-lightbox{padding:10px;}
  .cellario-lightbox img{
    max-width:calc(100vw - 20px);
    max-height:calc(100vh - 20px);
    border-radius:8px;
  }
  .cellario-lightbox button{
    width:42px;
    height:42px;
    font-size:26px;
  }
  .cellario-lightbox-close{top:10px;right:10px;}
  .cellario-lightbox-prev{left:10px;}
  .cellario-lightbox-next{right:10px;}
}
