/* ============================================================
   PG-HOTEL  –  Hauptstyles
   Farbpalette: Tiefblau #1a3a5c  |  Gold #c9a84c  |  Hellgrau #f5f7fa
   ============================================================ */

:root {
  --pgh-blue:     #1a3a5c;
  --pgh-blue-lt:  #2255880;
  --pgh-gold:     #c9a84c;
  --pgh-gold-lt:  #e8d5a0;
  --pgh-bg:       #f0f2f5;
  --pgh-card:     #ffffff;
  --pgh-border:   #dee2e6;
  --pgh-text:     #2c3e50;
  --pgh-muted:    #6c757d;
  --sidebar-w:    240px;
  --topbar-h:     56px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.pgh-body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--pgh-bg);
  color: var(--pgh-text);
  margin: 0;
  font-size: 0.9rem;
}

/* ── Topbar ───────────────────────────────────────────────── */
.pgh-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--pgh-blue);
  z-index: 1030;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.pgh-topbar .navbar-brand { font-size: 1.1rem; letter-spacing: .5px; }
.text-gold { color: var(--pgh-gold) !important; }

/* ── Layout ───────────────────────────────────────────────── */
.pgh-layout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Sidebar ──────────────────────────────────────────────── */
.pgh-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: linear-gradient(180deg, #1a3a5c 0%, #0f2540 100%);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
  z-index: 1020;
}
.pgh-sidebar::-webkit-scrollbar { width: 4px; }
.pgh-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.pgh-nav { flex: 1; padding: .5rem 0; }
.pgh-nav-section { padding: .25rem 0; }
.pgh-nav-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: .6rem 1rem .2rem;
}
.pgh-nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .88rem;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.pgh-nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.pgh-nav-item.active {
  background: rgba(201,168,76,.15);
  color: var(--pgh-gold);
  border-left-color: var(--pgh-gold);
  font-weight: 600;
}
.pgh-nav-item i { width: 18px; text-align: center; flex-shrink: 0; }

.pgh-sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Main ─────────────────────────────────────────────────── */
.pgh-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  overflow-x: hidden;
}
.pgh-content {
  padding: 1.5rem;
  max-width: 1600px;
}

/* ── Page header ─────────────────────────────────────────── */
.pgh-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.pgh-page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pgh-blue);
  margin: 0;
}
.pgh-page-header h1 i { color: var(--pgh-gold); margin-right: .4rem; }

/* ── KPI Cards ───────────────────────────────────────────── */
.kpi-card {
  background: var(--pgh-card);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid var(--pgh-gold);
  transition: transform .15s;
}
.kpi-card:hover { transform: translateY(-2px); }
.kpi-card .kpi-icon {
  width: 50px; height: 50px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.kpi-card .kpi-val {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--pgh-blue);
}
.kpi-card .kpi-label { font-size: .78rem; color: var(--pgh-muted); margin-top: .15rem; }
.kpi-blue   { border-left-color: var(--pgh-blue);  }
.kpi-blue .kpi-icon   { background: rgba(26,58,92,.12); color: var(--pgh-blue); }
.kpi-gold   { border-left-color: var(--pgh-gold);  }
.kpi-gold .kpi-icon   { background: rgba(201,168,76,.15); color: var(--pgh-gold); }
.kpi-green  { border-left-color: #28a745; }
.kpi-green .kpi-icon  { background: rgba(40,167,69,.12); color: #28a745; }
.kpi-orange { border-left-color: #fd7e14; }
.kpi-orange .kpi-icon { background: rgba(253,126,20,.12); color: #fd7e14; }

/* ── Cards ───────────────────────────────────────────────── */
.pgh-card {
  background: var(--pgh-card);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  overflow: hidden;
}
.pgh-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--pgh-border);
  background: #fafbfc;
}
.pgh-card-header h5 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--pgh-blue);
  margin: 0;
}
.pgh-card-body { padding: 1.25rem; }

/* ── Tables ──────────────────────────────────────────────── */
.pgh-table { width: 100%; border-collapse: collapse; }
.pgh-table th {
  background: #f0f4f8;
  color: var(--pgh-blue);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .6rem .9rem;
  border-bottom: 2px solid var(--pgh-border);
  white-space: nowrap;
}
.pgh-table td {
  padding: .65rem .9rem;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
  font-size: .88rem;
}
.pgh-table tr:hover td { background: #f8f9fb; }
.pgh-table tr:last-child td { border-bottom: none; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-gold {
  background: var(--pgh-gold);
  border-color: var(--pgh-gold);
  color: #fff;
  font-weight: 600;
}
.btn-gold:hover { background: #b8963c; border-color: #b8963c; color: #fff; }
.btn-pgh-primary {
  background: var(--pgh-blue);
  border-color: var(--pgh-blue);
  color: #fff;
  font-weight: 600;
}
.btn-pgh-primary:hover { background: #15304e; color: #fff; }

/* ── Forms ───────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .82rem; color: var(--pgh-text); margin-bottom: .25rem; }
.form-control, .form-select {
  border-color: #d0d7de;
  font-size: .88rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--pgh-gold);
  box-shadow: 0 0 0 .2rem rgba(201,168,76,.2);
}
.required-star { color: #dc3545; }

/* ── Belegungsplan ───────────────────────────────────────── */
.belegung-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.belegung-table {
  border-collapse: collapse;
  min-width: 900px;
  background: #fff;
}
.belegung-table th, .belegung-table td {
  border: 1px solid #e0e4ea;
  padding: 0;
}
.belegung-room-col {
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--pgh-blue);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .4rem .6rem;
  min-width: 110px;
  white-space: nowrap;
}
.belegung-date-header {
  background: #f0f4f8;
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--pgh-blue);
  min-width: 36px;
  padding: .3rem .2rem;
  white-space: nowrap;
}
.belegung-date-header.today {
  background: var(--pgh-gold);
  color: #fff;
}
.belegung-date-header.weekend { background: #e8edf3; }
.belegung-cell {
  min-width: 36px;
  height: 44px;
  position: relative;
  cursor: pointer;
  transition: background .1s;
}
.belegung-cell:hover { background: rgba(201,168,76,.1); }
.belegung-cell.today-col { background: rgba(201,168,76,.05); }

/* Booking blocks */
.belegung-booking {
  position: absolute;
  top: 4px; bottom: 4px;
  left: 1px; right: 1px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: .72rem;
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
  transition: filter .15s;
  z-index: 5;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.belegung-booking:hover { filter: brightness(1.1); }
.bk-reserviert   { background: #2980b9; color: #fff; }
.bk-eingecheckt  { background: #27ae60; color: #fff; }
.bk-ausgecheckt  { background: #95a5a6; color: #fff; }
.bk-storniert    { background: #e74c3c; color: #fff; text-decoration: line-through; }

/* ── Calendar nav ─────────────────────────────────────────── */
.belegung-nav {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.belegung-nav .month-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--pgh-blue);
  min-width: 140px;
  text-align: center;
}

/* ── Room status indicator ────────────────────────────────── */
.room-status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: .3rem;
}
.dot-available  { background: #28a745; }
.dot-occupied   { background: #dc3545; }
.dot-maintenance{ background: #ffc107; }
.dot-blocked    { background: #6c757d; }

/* ── Guest avatar ─────────────────────────────────────────── */
.guest-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--pgh-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .78rem;
  flex-shrink: 0;
}

/* ── Invoice ──────────────────────────────────────────────── */
.invoice-preview {
  background: #fff;
  border: 1px solid var(--pgh-border);
  border-radius: 8px;
  padding: 2rem;
  max-width: 760px;
  margin: 0 auto;
}
.invoice-preview .inv-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.invoice-preview .inv-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--pgh-blue);
  letter-spacing: -1px;
}
.invoice-preview .inv-nr { color: var(--pgh-gold); }
.invoice-items-table th { font-size: .8rem; }
.invoice-total-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

/* ── Stats ────────────────────────────────────────────────── */
.chart-container { position: relative; height: 280px; }

/* ── Modals ───────────────────────────────────────────────── */
.modal-header { background: var(--pgh-blue); color: #fff; }
.modal-header .btn-close { filter: invert(1); }
.modal-title i { color: var(--pgh-gold); margin-right: .4rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .pgh-sidebar {
    transform: translateX(-100%);
  }
  .pgh-sidebar.open {
    transform: translateX(0);
  }
  .pgh-main {
    margin-left: 0;
  }
  .pgh-content { padding: 1rem; }
}

/* ── Utilities ────────────────────────────────────────────── */
.text-blue { color: var(--pgh-blue) !important; }
.bg-blue    { background: var(--pgh-blue) !important; }
.border-gold{ border-color: var(--pgh-gold) !important; }
.fw-600 { font-weight: 600; }
.fs-sm  { font-size: .82rem; }
.fs-xs  { font-size: .72rem; }

/* Print */
@media print {
  .pgh-topbar, .pgh-sidebar, .btn, .no-print { display: none !important; }
  .pgh-main { margin-left: 0; }
  .pgh-content { padding: 0; }
  .invoice-preview { border: none; }
}

/* Spinner overlay */
.pgh-loading {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
