/* ═══════════════════════════════════════════════
   PANZER IT — KUNDENPORTAL CSS
   Hybrid Layout: Sidebar (Desktop) + Bottom Nav (Mobile)
   ══════════════════════════════════════════════ */

:root {
  --cyan:     #00c2ff;
  --cyan-dim: #00c2ff22;
  --bg:       #0d1b2a;
  --bg-card:  #0a1628;
  --bg-input: #071220;
  --border:   #1e3050;
  --text:     #e2e8f0;
  --muted:    #8899aa;
  --green:    #00ff88;
  --orange:   #ffaa00;
  --red:      #ff4444;
  --sidebar-w: 200px;
  --bottom-h:  60px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── App Shell ─────────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar (Desktop) ─────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  padding: 0 0 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.sidebar-brand img { width: 28px; height: 28px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--cyan-dim); color: var(--text); }
.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-left: 3px solid var(--cyan);
  padding-left: 9px;
}

.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-logout {
  margin: 0 8px;
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: border-color 0.15s, color 0.15s;
}

.sidebar-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Main Content ──────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  max-width: 960px;
}

/* ── Bottom Nav (Mobile) ───────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.65rem;
  border: none;
  background: none;
  transition: color 0.15s;
}

.bottom-nav-item .nav-icon { font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--cyan); }

/* ── Mobile ────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  #main {
    margin-left: 0;
    padding: 16px 16px calc(var(--bottom-h) + 16px);
  }
}

/* ── Cards / Komponenten ───────────────────── */
.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.portal-card-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 12px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Badges ────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-active   { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid #00c2ff44; }
.badge-pending  { background: #ffaa0022;           color: var(--orange); border: 1px solid #ffaa0044; }
.badge-cancelled{ background: #ff444422;           color: var(--red);    border: 1px solid #ff444444; }
.badge-open     { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid #00c2ff44; }
.badge-in_progress { background: #ffaa0022;       color: var(--orange); border: 1px solid #ffaa0044; }
.badge-closed   { background: #ffffff11;           color: var(--muted);  border: 1px solid var(--border); }

/* ── Buttons ───────────────────────────────── */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-primary   { background: var(--cyan); color: #000; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-ghost     { background: var(--cyan-dim); color: var(--cyan); border: 1px solid #00c2ff44; }
.btn-danger    { background: #ff444422; color: var(--red); border: 1px solid #ff444444; }

/* ── Formular ──────────────────────────────── */
.portal-form-group { margin-bottom: 14px; }
.portal-label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 5px; }
.portal-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}
.portal-input:focus { outline: none; border-color: var(--cyan); }
.portal-input.error { border-color: var(--red); }

.portal-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.portal-textarea:focus { outline: none; border-color: var(--cyan); }

/* ── Banner ────────────────────────────────── */
.success-banner {
  background: linear-gradient(135deg, #00c2ff15, #00ff8815);
  border: 1px solid #00ff8844;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.success-banner-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.success-banner-title { color: var(--green); font-weight: 700; margin-bottom: 4px; }
.success-banner-text  { color: var(--muted); font-size: 0.875rem; }

/* ── Ticket Thread ─────────────────────────── */
.ticket-message {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 10px;
  max-width: 85%;
}

.ticket-message.customer {
  background: var(--cyan-dim);
  border: 1px solid #00c2ff33;
  margin-left: auto;
}

.ticket-message.admin {
  background: var(--border);
  margin-right: auto;
}

.ticket-message-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.ticket-message-text { font-size: 0.875rem; line-height: 1.5; }

/* ── Buchungs-Card ─────────────────────────── */
.booking-card { margin-bottom: 12px; }

.booking-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.booking-card-name { font-weight: 600; font-size: 0.95rem; }
.booking-card-price { color: var(--cyan); font-weight: 700; }

.booking-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.booking-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Page Header ───────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 1.4rem; font-weight: 700; }
.page-subtitle { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }

/* ── Login Page ────────────────────────────── */
#app.login-mode {
  justify-content: center;
  align-items: center;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo img { width: 40px; height: 40px; margin-bottom: 8px; }
.login-logo h1 { font-size: 1.1rem; color: var(--cyan); }
.login-logo p  { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ── Upgrade Modal ─────────────────────────── */
.portal-modal-overlay {
  position: fixed;
  inset: 0;
  background: #00000088;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.portal-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 440px;
  margin: 16px;
}

.portal-modal-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 16px; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row .stat-card:last-child { grid-column: span 2; }
  .booking-card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}


/* ── Portal Footer ───────────────────────────────────────── */
.portal-footer {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-left: var(--sidebar-w);
  flex-shrink: 0;
}

.portal-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.portal-footer a:hover { color: var(--cyan); }

/* Mobile: Footer über Bottom-Nav */
@media (max-width: 768px) {
  .portal-footer {
    margin-left: 0;
    justify-content: center;
    padding-bottom: calc(var(--bottom-h) + 0.75rem);
  }
}

/* ── Loading-Spinner ──────────────────────────────────────── */
.portal-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}

.portal-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: portal-spin 0.7s linear infinite;
}

@keyframes portal-spin {
  to { transform: rotate(360deg); }
}
