/* =========================================================
   site.css – FINAL 860px STABIL
   ========================================================= */

html{
  overflow-y:scroll;
}

:root{
  --ink:#111;
  --paper:#fff;

  --grid:#000;
  --bar:#d9d9d9;
  --stripe:#f3f3f3;

  --field:#fff;
  --field-border:#b9b9b9;

  --green:#4CAF50;
  --green-dark:#3e9e44;
  --gray:#7a7a7a;
  --blue:#4da3ff;

  --bg:#eeeeee;
  --border:#e6e6e6;
  --shadow:0 4px 16px rgba(0,0,0,.08);

  --btn-red:#b71c1c;
  --btn-blue:#0d47a1;
}

/* =========================================================
   BODY
   ========================================================= */

body{
  margin:0;
  background:var(--bg);
  font-family:Arial, Helvetica, sans-serif;
  color:var(--ink);
  font-size:14px;
  line-height:1.5;
}

/* =========================================================
   HEADER (860px FIX)
   ========================================================= */

.site-header{
  max-width:860px;
  margin:24px auto 0;
  background:var(--paper);
  border:1px solid var(--border);
  border-bottom:none;
  border-radius:12px 12px 0 0;
  overflow:hidden;
}

.site-header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  box-sizing:border-box;
  background:var(--paper);
}

/* Logo */
.header-logo img{
  display:block;
  max-height:54px;
  width:auto;
}

/* Navigation */
.site-nav{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  flex-wrap:nowrap;
  min-width:0;
}

.site-nav .nav-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-radius:10px;
  color:#2f2f2f;
  text-decoration:none;
  font-weight:700;
  font-size:16px;
  white-space:nowrap;
}

.site-nav .nav-link:hover{
  background:#f3f6f3;
  color:#1f5f2a;
}

.site-nav .nav-link.is-active{
  background:#edf7ee;
  color:#256628;
}

.site-nav .nav-icon{
  font-size:12px;
}

.header-right{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  margin-right:5px;
}

/* Button */
.btn-print,
.btn{
  padding:8px 14px;
  border:none;
  border-radius:14px;
  background:#4CAF50;
  color:#fff;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

.btn:hover,
.btn-print:hover{
  background:#3e9e44;
}

/* =========================================================
   PAGE
   ========================================================= */

.page{
  max-width:860px;
  margin:-1px auto 18px;
  background:var(--paper);
  padding:28px;
  box-sizing:border-box;
  border:1px solid var(--border);
  border-radius:0 0 12px 12px;
  box-shadow:var(--shadow);
}

/* =========================================================
   INPUTS
   ========================================================= */

.cell-input{
  width:100%;
  padding:6px 8px;
  border:1px solid var(--field-border);
  border-radius:6px;
  background:var(--field);
  font-size:12px;
}

.cell-input[readonly]{
  background:#f6f6f6;
}

/* =========================================================
   TABELLEN
   ========================================================= */

table:not(.study-table){
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  background:#fff;
  border:1px solid var(--grid);
}

table:not(.study-table) th,
table:not(.study-table) td{
  padding:8px;
  border:1px solid var(--grid);
}

table:not(.study-table) th{
  background:var(--bar);
  font-weight:700;
  text-align:center;
}

table:not(.study-table) tbody tr:nth-child(even){
  background:var(--stripe);
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer{
  max-width:860px;
  margin:0 auto 24px;
  background:#000;
  border-radius:12px;
}

.site-footer-inner{
  display:flex;
  justify-content:space-between;
  padding:14px 18px;
  color:#fff;
  font-size:14px;
  font-weight:600;
}

.site-footer a{
  color:#fff !important;
  text-decoration:none;
}

/* =========================================================
   PRINT DIALOG
   ========================================================= */

.print-dialog{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.25);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.print-dialog-box{
  width:min(320px, calc(100vw - 32px));
  background:#fff;
  border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,0.15);
  overflow:hidden;
}

.print-titlebar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
  border-bottom:1px solid #eee;
  font-weight:700;
}

.print-body{
  padding:16px;
}

.print-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.print-green{
  width:100%;
  padding:12px;
  border:none;
  border-radius:10px;
  background:#2e7d32;
  color:#fff;
  font-weight:700;
  cursor:pointer;
}

.print-cancel{
  width:100%;
  padding:4px 6px;
  font-size:16px;
  font-weight:700;
  border-radius:10px;
  border:1px solid #ccc;
  background:#eee;
  cursor:pointer;
  margin-top:16px;
}

/* =========================================================
   PRINT VIEW
   ========================================================= */

@media print{
  .nav-row,
  .btn,
  .btn-print,
  .print-dialog{
    display:none !important;
  }

  body{
    background:#fff !important;
  }

  .page{
    padding:18mm 16mm;
    border:none;
    box-shadow:none;
  }

  .legal-box{
    box-shadow:none;
    border:1px solid #ddd;
    background:#fff;
  }
}

/* =========================================================
   Rechtsseiten / Rechtstexte
   ========================================================= */

.legal-box{
  width:100%;
  max-width:none;
  margin:0 0 28px;
  padding:32px;
  background:#fcfcfc;
  border:1px solid #dcdcdc;
  border-radius:12px;
  box-shadow:0 4px 14px rgba(0,0,0,0.06);
  box-sizing:border-box;
}

.legal-box h1{
  margin-top:0;
  margin-bottom:18px;
  font-size:26px;
}

.legal-box h2{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:28px;
  margin-bottom:10px;
  padding-bottom:6px;
  border-bottom:1px solid #ececec;
  font-size:18px;
}

.legal-box h3{
  margin-top:18px;
  margin-bottom:6px;
  font-size:16px;
}

.legal-box p{
  margin:10px 0 14px;
  line-height:1.6;
}

.legal-box ul{
  margin:6px 0 16px 18px;
}

.legal-box li{
  margin-bottom:6px;
}

.legal-box hr{
  margin:30px 0 20px;
  border:none;
  border-top:1px solid #e6e6e6;
}

.legal-version{
  margin-top:30px;
  color:#666;
  font-size:14px;
}