/* Roto Immobilien – Design System (an Logo: schwarz / weiß / elegant) */
:root {
  --roto-black: #0a0a0a;
  --roto-ink: #141414;
  --roto-charcoal: #2a2a2a;
  --roto-slate: #4a4a4a;
  --roto-muted: #6b6b6b;
  --roto-line: #e4e4e4;
  --roto-line-strong: #cfcfcf;
  --roto-soft: #f6f5f3;
  --roto-cream: #faf9f7;
  --roto-white: #ffffff;
  --roto-gold: #9a8458;
  --roto-gold-soft: #f3efe6;

  --ok: #1f6b45;
  --ok-bg: #eaf5ef;
  --err: #9b2c2c;
  --err-bg: #f9ecec;
  --warn: #8a6a1f;
  --warn-bg: #f8f1de;

  --bg: var(--roto-soft);
  --panel: var(--roto-white);
  --ink: var(--roto-ink);
  --muted: var(--roto-muted);
  --line: var(--roto-line);
  --brand: var(--roto-black);
  --brand-2: var(--roto-charcoal);
  --shadow: 0 10px 30px rgba(10, 10, 10, 0.06);
  --shadow-sm: 0 2px 8px rgba(10, 10, 10, 0.04);
  --radius: 10px;
  --sidebar-w: 260px;
  /* Klare, gut lesbare System-/UI-Schrift (kein filigranes Serif) */
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: var(--font-ui);
  --text-base: 15px;
  --text-sm: 13.5px;
  --leading: 1.5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(154, 132, 88, 0.08), transparent 55%),
    linear-gradient(180deg, #f8f7f5 0%, var(--roto-soft) 100%);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--roto-charcoal); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { color: var(--roto-black); border-bottom-color: var(--roto-gold); }

/* ── Sidebar (hell, passend zu Roto-Logo) ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #ffffff 0%, #f7f6f3 100%);
  color: var(--roto-ink);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--roto-line);
  box-shadow: 4px 0 24px rgba(10, 10, 10, 0.03);
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  padding: 1.5rem 1.25rem 1.15rem;
  border-bottom: 1px solid var(--roto-line);
  text-align: center;
  background: #fff;
}
.brand-logo {
  width: 100%;
  max-width: 168px;
  height: auto;
  display: block;
}
.brand-fallback {
  font-family: var(--font-ui);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
  color: var(--roto-black);
}
.brand-sub {
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--roto-muted);
  font-weight: 500;
}
.brand-app {
  margin-top: .2rem;
  font-size: .88rem;
  color: var(--roto-slate);
  letter-spacing: .01em;
  font-weight: 600;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1.1rem .85rem;
  flex: 1;
  overflow-y: auto;
}
.sidebar nav a {
  color: var(--roto-slate);
  padding: .78rem .95rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: 0;
  border-bottom: none;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar nav a:hover {
  background: rgba(154, 132, 88, 0.1);
  color: var(--roto-black);
  text-decoration: none;
  border-bottom: none;
}
.sidebar nav a.active {
  background: var(--roto-gold-soft);
  color: var(--roto-black);
  font-weight: 700;
  border-left-color: var(--roto-gold);
}
.sidebar-footer {
  padding: 1rem 1.15rem 1.25rem;
  border-top: 1px solid var(--roto-line);
  font-size: .75rem;
  color: var(--roto-muted);
  letter-spacing: .02em;
  line-height: 1.4;
  background: #fff;
}

/* ── Content shell + main ────────────────────────────────────────────────── */
.content-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main {
  flex: 1;
  padding: 1.75rem 2.25rem 1.5rem;
  min-width: 0;
}

/* ── VistaSquare footer ──────────────────────────────────────────────────── */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem 1.35rem;
  border-top: 1px solid var(--roto-line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--roto-muted);
  font-size: .88rem;
  font-weight: 500;
}
.app-footer-text {
  letter-spacing: 0.01em;
}
.app-footer .heart {
  color: #c44b3c;
  font-size: 1rem;
  margin: 0 .1rem;
  vertical-align: -1px;
}
.app-footer-logo {
  height: 22px;
  width: auto;
  display: block;
  opacity: .92;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--roto-black);
  line-height: 1.25;
}
.topbar-actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }

.flash-wrap { margin-bottom: 1rem; }
.flash {
  padding: .8rem 1rem;
  border-radius: 8px;
  margin-bottom: .5rem;
  font-size: .9rem;
  border: 1px solid transparent;
}
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: #cfe5d8; }
.flash-error { background: var(--err-bg); color: var(--err); border-color: #eccfcf; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--roto-gold);
  opacity: .85;
}
.card .label {
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: .4rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.card .value {
  font-family: var(--font-ui);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--roto-black);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.card .sub { color: var(--muted); font-size: .85rem; margin-top: .3rem; line-height: 1.4; }

/* ── Panels ──────────────────────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}
.panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--roto-black);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  line-height: 1.45;
}
th, td {
  padding: .7rem .7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  font-size: .8rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--roto-charcoal);
  background: var(--roto-cream);
  position: sticky;
  top: 0;
  font-weight: 700;
  border-bottom: 1px solid var(--roto-line-strong);
}
tr:hover td { background: #fcfbfa; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .22rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: 0;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-no { background: var(--err-bg); color: var(--err); }
.badge-neutral { background: #efeeec; color: var(--roto-slate); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid var(--roto-line-strong);
  background: #fff;
  color: var(--ink);
  padding: .58rem 1.05rem;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
  letter-spacing: 0;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover {
  background: var(--roto-cream);
  border-color: #bdbdbd;
  text-decoration: none;
  border-bottom: 1px solid #bdbdbd;
}
.btn-primary {
  background: var(--roto-black);
  border-color: var(--roto-black);
  color: #fff;
}
.btn-primary:hover {
  background: var(--roto-charcoal);
  border-color: var(--roto-charcoal);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.btn-danger {
  background: #fff;
  border-color: #e0c4c4;
  color: var(--err);
}
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .5rem;
  margin-bottom: 1rem;
}
.week-day {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .7rem .55rem;
  background: #fff;
  border: 1px solid var(--roto-line-strong);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.week-day span { font-size: .75rem; color: var(--roto-charcoal); }
.week-day strong { font-size: 1.15rem; }
.week-day em { font-style: normal; font-size: .75rem; color: #666; }
.week-day.is-on { border-color: var(--roto-black); box-shadow: inset 0 0 0 1px var(--roto-black); }
.week-day.is-empty em { color: #b0b0b0; }
.week-day.is-weekend { background: var(--roto-cream); }
.day-form select[size] { width: 100%; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.form-row { display: flex; flex-direction: column; gap: .35rem; }
.form-row.full { grid-column: 1 / -1; }
label {
  font-size: .85rem;
  color: var(--roto-charcoal);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
input, select, textarea {
  box-sizing: border-box;
  height: 44px;
  border: 1px solid var(--roto-line-strong);
  border-radius: 8px;
  padding: 0 .8rem;
  margin: 0;
  font: inherit;
  font-size: .95rem;
  line-height: 1.2;
  background-color: #fff;
  color: var(--ink);
  vertical-align: middle;
  transition: border-color .15s, box-shadow .15s;
}
select:not([size]):not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 L6 6.5 L11 1.5' fill='none' stroke='%23141414' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: 12px 8px;
}
select[size], select[multiple], textarea {
  height: auto;
  padding: .45rem .7rem;
  line-height: 1.45;
  background-image: none;
}
.hours-input { font-size: 1rem; }
.day-form .form-grid { grid-template-columns: 1fr 1fr; }
.filters .form-row { flex: 1 1 160px; }
.filters .btn,
.period-form select,
.topbar-actions .btn {
  height: 44px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--roto-black);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, .08);
}
textarea { min-height: 90px; resize: vertical; }
.form-actions {
  display: flex;
  gap: .6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1.15rem;
  padding: 1rem;
  background: var(--roto-cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filters .form-row { min-width: 120px; }
.filters .form-row-action { min-width: 140px; }
.filters .btn-filter {
  width: 100%;
  min-height: 42px;
  padding: .65rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.muted { color: var(--muted); }
.row-green { background: #f3f8f5 !important; }
.row-red { background: #fbf4f4 !important; }
.totals-row td {
  font-weight: 700;
  background: var(--roto-cream) !important;
  border-top: 1px solid var(--roto-line-strong);
}

.period-form {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.period-form select {
  min-width: 110px;
  background: #fff;
}

.help {
  font-size: .9rem;
  color: var(--roto-slate);
  line-height: 1.55;
}

.empty {
  padding: 2.25rem 1.5rem;
  text-align: center;
  color: var(--roto-slate);
  font-size: 1rem;
  line-height: 1.5;
}

/* ── Dashboard status ────────────────────────────────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.status-col {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem;
  background: var(--roto-cream);
}
.status-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .85rem;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.status-title.status-ok { color: var(--ok); }
.status-title.status-missing { color: var(--err); }

.subpanel {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.subpanel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.subpanel h3 {
  margin: 0 0 .35rem;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Gold accent line under section titles */
.panel h2::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  background: var(--roto-gold);
  margin-top: .45rem;
  opacity: .9;
}

@media (max-width: 960px) {
  .status-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .brand { padding: 1rem; }
  .brand-logo { max-width: 120px; }
  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: .75rem;
  }
  .sidebar nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: .55rem .7rem;
  }
  .sidebar nav a.active {
    border-left-color: transparent;
    border-bottom-color: var(--roto-gold);
  }
  .sidebar-footer { display: flex; flex-direction: row; flex-wrap: wrap; gap: .6rem; align-items: center; }
  .main { padding: 1rem; }
  .topbar h1 { font-size: 1.35rem; }
  .content-shell { min-height: auto; }
  .app-footer {
    padding: .85rem 1rem 1.1rem;
    font-size: .82rem;
  }
  .app-footer-logo { height: 18px; }
}

body.login-page {
  display: block;
  background: #f3efe6;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.login-card {
  width: min(420px, 100%);
  background: #fffdf8;
  border: 2px solid #1c1915;
  border-radius: 16px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.login-card h1 { margin: 0; font-size: 1.4rem; }
.login-logo { width: 120px; height: auto; }
.who { font-weight: 700; }
.who-role { color: var(--muted); font-size: .8rem; text-transform: capitalize; margin-bottom: .4rem; }
.sidebar-footer form { margin-top: .5rem; }
.inline-user { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.inline-user input, .inline-user select { width: auto; height: 36px; }
details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary h2 { margin: 0; }

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .45rem;
}
.cal-name {
  font-size: .78rem;
  font-weight: 700;
  color: var(--roto-slate);
  padding: 0 .2rem .2rem;
}
.cal-day {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-height: 7.2rem;
  padding: .45rem .5rem;
  background: #fff;
  border: 1px solid var(--roto-line-strong);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}
.cal-day:hover { border-color: var(--roto-black); text-decoration: none; }
.cal-num { font-weight: 700; }
.cal-day strong { font-size: .82rem; }
.cal-day em {
  font-style: normal;
  font-size: .72rem;
  line-height: 1.25;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-day.is-out { opacity: .38; }
.cal-day.is-weekend { background: var(--roto-cream); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--roto-black); }
.cal-day.has-time { background: #f3f8f5; }
@media (max-width: 860px) {
  .cal-day { min-height: 4.6rem; }
  .cal-day em { display: none; }
}
