/* ==========================================================================
   FormFlow THV – zentrale Stylesheet (Django static)
   --------------------------------------------------------------------------
   Layout- und UI-CSS, bisher inline in templates/base.html.
   Theme-Variablen (--color-*, --ff-*) werden serverseitig per
   Context-Processor (settingsmgr) als :root-Variablen in base.html
   gesetzt – die static CSS referenziert diese Variablen nur.
   Stilistische Orientierung: clubrox / bescheidmodul-Design-Linie.
   ========================================================================== */

/* ---------- Grundgerüst ---------- */
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  min-height: 100%;
  background: var(--content-bg);
  color: var(--content-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky; top: 0; left: 0;
  height: 100dvh;
  width: var(--sb-width-collapsed);
  background: var(--sb-bg);
  color: var(--sb-fg);
  border-right: 1px solid var(--sb-border);
  transition: width .2s ease;
  z-index: 1000;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.sidebar .brand {
  display: flex; align-items: center; gap: .6rem;
  padding: .9rem .9rem;
  white-space: nowrap;
}
.sidebar .brand .logo {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--sb-accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .08) inset;
}
.sidebar .brand .title {
  opacity: 0; transition: opacity .18s ease;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.sidebar nav {
  padding: .3rem .3rem 1rem;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
}

.nav-section {
  color: var(--sb-fg-dim);
  font-size: .8rem;
  margin: .6rem .9rem .25rem;
  white-space: nowrap;
  opacity: .9;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: .9rem;
  padding: .55rem .75rem;
  color: var(--sb-fg);
  text-decoration: none;
  border-radius: 10px;
  margin: .15rem .35rem;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); }
.nav-item .icon { width: 20px; height: 20px; flex: 0 0 20px; opacity: .95; }
.nav-item .label { opacity: 0; transition: opacity .18s ease; }

/* ===== Sidebar Footer (Version) ===== */
.sidebar-footer {
  margin-top: auto;
  padding: .7rem .6rem .9rem;
  border-top: 1px solid var(--sb-border);
  color: var(--sb-fg-dim);
  font-size: .82rem;
  text-align: center;
  white-space: nowrap;
}
.sidebar-footer .ver-label {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
}

/* ===== Content ===== */
.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px;
  max-width: 100%;
  transition: margin-left .2s ease;
}

/* ===== Desktop: Hover klappt auf (kein Klick) ===== */
@media (hover: hover) and (pointer: fine) {
  .sidebar:hover { width: var(--sb-width-expanded); }
  .sidebar:hover .brand .title,
  .sidebar:hover .nav-item .label { opacity: 1; }
}

/* ===== Mobile: Toggle (Tap) ===== */
@media (max-width: 1024px) {
  body { overflow-x: hidden; }
  .sidebar {
    position: fixed; transform: translateX(-100%);
    width: var(--sb-width-expanded);
    transition: transform .22s ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar .brand .title,
  .sidebar .nav-item .label { opacity: 1; }

  .sidebar-toggle {
    position: fixed; left: .6rem; top: .6rem; z-index: 1100;
    background: #fff; color: #111;
    border: 1px solid #e5e7eb; border-radius: 10px;
    padding: .5rem .65rem; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  }
  .backdrop {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(0, 0, 0, .35);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .backdrop.is-open { opacity: 1; pointer-events: auto; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===== FormFlow UI-Utilities (aus base.html, zweiter Style-Block) ===== */
/* Schriftfarbe der Inhalte. Die zugehörigen Theme-Variablen (--ff-*) werden
   serverseitig inline in base.html gesetzt. */
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ff-text); }

.ff-card { background: #fff; border: 1px solid rgba(0, 0, 0, .08); border-radius: 10px; }
.ff-card-header { padding: 14px 16px; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.ff-card-body { padding: 16px; }
.ff-card-title { margin: 0; font-size: 1.05rem; font-weight: 650; }

.ff-btn { display: inline-block; padding: .45rem .85rem; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .18); text-decoration: none; cursor: pointer; line-height: 1.2; }
.ff-btn:hover { text-decoration: none; }
.ff-btn-primary { background: var(--ff-primary); border-color: var(--ff-primary); color: #fff; }
.ff-btn-secondary { background: #f8fafc; color: #111827; }
.ff-btn-danger { background: #dc3545; border-color: #dc3545; color: #fff; }
.ff-btn-warning { background: #f59e0b; border-color: #f59e0b; color: #111827; }
.ff-btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.ff-btn-disabled { opacity: .55; pointer-events: none; cursor: not-allowed; }

.ff-badge { display: inline-block; padding: .22rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 650; border: 1px solid transparent; }
.ff-badge-draft { background: #f3f4f6; border-color: #e5e7eb; color: #111827; }
.ff-badge-submitted { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.ff-badge-review { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.ff-badge-correction { background: #fef9c3; border-color: #fde68a; color: #854d0e; }
.ff-badge-approved { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }
.ff-badge-rejected { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.ff-table { width: 100%; border-collapse: collapse; }
.ff-table th,
.ff-table td { border-bottom: 1px solid rgba(0, 0, 0, .06); padding: 10px 10px; vertical-align: top; }
.ff-table th { font-weight: 650; color: #111827; text-align: left; white-space: nowrap; }
.ff-muted { color: #6b7280; }

/* ===== Authentifizierung (Login / Registrierung) ===== */
.login-card label.form-label {
  display: block; text-align: left; margin-bottom: 6px;
}
.login-card input,
.login-card select,
.login-card textarea {
  width: 100% !important; box-sizing: border-box;
}

.register-card label {
  display: block; font-weight: 500; margin-bottom: 4px; text-align: left;
}
.register-card input,
.register-card select,
.register-card textarea {
  width: 100% !important; box-sizing: border-box;
}
.register-card .section-title {
  font-weight: 600; margin: 20px 0 10px;
}