/* ===========================
   Grundlayout & Theme
   =========================== */

:root {
  --primary-color: #004080;
  --secondary-color: #0066cc;
  --background-color: #f3f4f7;
  --card-background: #ffffff;
  --hover-background: #f0f4ff;
  --text-color: #1a1a1a;
  --muted-text: #6b7280;
  --border-soft: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top left, #e5efff 0, #f3f4f7 40%, #f3f4f7 100%);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===========================
   Navbar
   =========================== */

.navbar {
  background: linear-gradient(90deg, var(--primary-color), #002552);
  color: white;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.navbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
  background: transparent;
  filter: brightness(0) invert(1);
}

.navbar-titleblock {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.navbar-left h1 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.navbar-subtitle {
  font-size: 0.8rem;
  opacity: 0.9;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;
  line-height: 1.25;
}

.navbar-user-label {
  opacity: 0.8;
}

.navbar-user-name {
  font-weight: 600;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255,255,255,0.12);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.navbar a:hover {
  background-color: rgba(255,255,255,0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-decoration: none;
}

/* ===========================
   Seitenlayout & Cards
   =========================== */

.page {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.4rem;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--muted-text);
  max-width: 650px;
}

.card {
  background: var(--card-background);
  border-radius: 0.9rem;
  box-shadow: 0 2px 8px rgba(15,23,42,0.08);
  border: 1px solid var(--border-soft);
  padding: 1.5rem 1.5rem 1.2rem;
}

.card-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
  margin-bottom:1rem;
}

.card-title {
  font-weight:600;
  font-size:1.1rem;
  color:var(--primary-color);
}

.card-sub {
  font-size:0.9rem;
  color:var(--muted-text);
}

/* ===========================
   Buttons & Links
   =========================== */

.btn {
  background: var(--primary-color);
  color: #fff;
  padding: .45rem .9rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--primary-color);
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  cursor:pointer;
}

.btn.secondary {
  background: #ffffff;
  color: var(--primary-color);
}

.btn.small {
  font-size:0.8rem;
  padding:.3rem .7rem;
}

.btn + .btn {
  margin-left:.4rem;
}

.btn:hover {
  background: var(--secondary-color);
  color:#fff;
  text-decoration:none;
}

.btn.secondary:hover {
  background:#f0f4ff;
  color:var(--primary-color);
}

.link-inline {
  color: var(--secondary-color);
  text-decoration:none;
  font-size:0.9rem;
}

.link-inline:hover {
  text-decoration:underline;
}


/* ===========================
   Hinweise / Notes / Messages
   =========================== */

.note {
  padding:.6rem .8rem;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:0.7rem;
  margin-top:.8rem;
  font-size:0.9rem;
  color:#4b5563;
}

.note.info {
  background:#EEF6FF;
  border-color:#BFE6FF;
}

.note.vorgriff {
  background:#F6FBFF;
  border-color:#99C9FF;
}

.small {
  font-size:0.8rem;
  color:#6b7280;
}

.medium {
  font-size:0.9rem;
  color:#333;
  line-height:1.4;
}

.msg {
  margin: 0.6rem 0;
  padding: 0.65rem 0.85rem;
  border-radius: 0.7rem;
  font-size:0.9rem;
}

.msg.ok {
  background:#e8f6ee;
  border:1px solid #bfe5cf;
  color:#14532d;
}

.msg.err {
  background:#fdecea;
  border:1px solid #f5c2c0;
  color:#7f1d1d;
}

/* ===========================
   Meta-Infos (MMZ-Stammdaten)
   =========================== */

.meta-wrap { 
  display:flex; 
  flex-wrap:wrap; 
  gap:16px; 
  align-items:stretch; 
  margin:10px 0 18px 0; 
}

.meta-card { 
  border:1px solid #ddd; 
  border-radius:10px; 
  padding:10px 12px; 
  min-width:280px; 
  flex:1 1 320px; 
  background:#fff; 
}

.meta-card table { 
  width:100%; 
  border-collapse:collapse; 
}

.meta-card th, 
.meta-card td { 
  padding:6px 8px; 
  border-bottom:1px solid #eee; 
  vertical-align:top; 
  text-align:left; 
  font-size:.95rem; 
}

.meta-card th.label { 
  width:60%; 
  font-weight:600; 
  white-space:nowrap; 
}

.meta-title { 
  font-weight:700; 
  margin:0 0 6px 0; 
  font-size:1.05rem; 
  color:var(--primary-color);
}

/* ===========================
   Tabellen (Jahresübersicht & Co.)
   =========================== */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.8rem;
}

table.year{
  border-collapse:collapse;
  width:100%;
  background:#fff;
  border-radius:0.6rem;
  overflow:hidden;
}

table.year thead th{
  border-bottom:1px solid #e5e7eb;
  padding:.45rem .4rem;
  text-align:left;
  font-size:0.9rem;
  background:#f9fafb;
  color:#374151;
}

table.year tbody td{
  border-bottom:1px solid #e5e7eb;
  padding:.45rem .4rem;
  font-size:0.9rem;
  vertical-align:top;
}

table.year tr:last-child td {
  border-bottom:none;
}

/* Speziell für MMZ-Tabelle: RJU-Spalte & besondere Zeilen */
table.year thead th:nth-child(11), 
table.year tbody td:nth-child(11){
  background:#fffbe6; 
  font-weight:700;
}

.num {
  text-align:right;
}

tr.final-rju td{ 
  background:#fff3c4 !important; 
  font-weight:800; 
  border-top:2px solid #f0c36d; 
}

tr.plan-row td{ 
  color:#777; 
}

tr.initrest td {
  background:#f9fafb;
}

/* ===========================
   Badges / Rollen-Flex
   =========================== */

.badge {
  display:inline-block;
  padding:2px 7px;
  border-radius: 999px;
  background:#e5e7eb;
  font-size: 0.75rem;
  color:#374151;
}

.badge-taken {
  background:#fee2e2;
  color:#991b1b;
}

.badge-free {
  background:#dcfce7;
  color:#166534;
}

.role {
  display:flex;
  gap:0.5rem;
  align-items:center;
  flex-wrap:wrap;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
  .navbar { 
    padding:0.7rem 1rem; 
    flex-wrap:wrap; 
    gap:0.5rem; 
  }

  .navbar-left { 
    flex:1 0 100%; 
  }

  .navbar-subtitle { 
    display:none; 
  }

  .navbar-right { 
    width:100%; 
    justify-content:space-between; 
  }

  .navbar-user { 
    align-items:flex-start; 
  }

  .page { 
    padding:1.5rem 1rem 2.5rem; 
  }

  .card { 
    padding:1.2rem 1rem; 
  }

  /* Card-Header: Buttons untereinander/zentriert */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header > div:last-child {
    width: 100%;
    margin-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .card-header .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  table.year { 
    font-size:0.85rem; 
  }

  table.year thead th, 
  table.year tbody td { 
    padding:0.35rem 0.3rem; 
  }
}

@media (max-width: 600px) {
  .table-wrapper::before {
    content: "Tabelle seitlich scrollbar →";
    display: block;
    font-size: 0.75rem;
    color: var(--muted-text);
    margin-bottom: 0.25rem;
  }
}

