/* SP Business-OS — Dashboard styles (Sprint 1: Shell + Login) */

:root {
  --os-bg:            #f4f1ea;
  --os-bg-card:       #ffffff;
  --os-bg-sidebar:    #1c2620;
  --os-bg-input:      #f8f6ef;
  --os-text:          #22282a;
  --os-text-muted:    #5f6a68;
  --os-text-invert:   #eef1ec;
  --os-text-invert-mut:#a8b3ad;
  --os-gold:          #b48b52;
  --os-gold-dark:     #8f6d3f;
  --os-line:          rgba(30, 40, 34, 0.10);
  --os-line-strong:   rgba(30, 40, 34, 0.22);
  --os-err:           #b0402f;
  --os-radius:        14px;
  --os-radius-sm:     10px;
  --os-shadow:        0 4px 20px -12px rgba(20, 30, 24, 0.35);
  --os-font-serif:    'Cormorant Garamond', 'Times New Roman', serif;
  --os-font-sans:     'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.os-body {
  font-family: var(--os-font-sans);
  color: var(--os-text);
  background: var(--os-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ═══════════════ LOGIN ═══════════════ */

.os-login-page {
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(180, 139, 82, 0.12), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(30, 60, 44, 0.08), transparent 60%),
    var(--os-bg);
}
.os-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.os-login__card {
  width: 100%;
  max-width: 420px;
  background: var(--os-bg-card);
  border-radius: var(--os-radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--os-shadow);
  border: 1px solid var(--os-line);
}
.os-login__brand {
  text-align: center;
  margin-bottom: 2rem;
}
.os-login__brand img {
  display: inline-block;
  height: 56px;
  width: auto;
}
.os-login__brand h1 {
  font-family: var(--os-font-serif);
  font-weight: 500;
  font-size: 1.65rem;
  margin: 0.9rem 0 0.25rem;
  letter-spacing: 0.01em;
}
.os-login__brand p {
  font-size: 0.8rem;
  color: var(--os-text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

/* ═══════════════ FORM ═══════════════ */

.os-form { display: flex; flex-direction: column; gap: 1.1rem; }
.os-field { display: flex; flex-direction: column; gap: 0.4rem; }
.os-field > span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--os-text-muted);
}
.os-field input {
  font: inherit;
  padding: 0.85rem 1rem;
  border-radius: var(--os-radius-sm);
  border: 1px solid var(--os-line-strong);
  background: var(--os-bg-input);
  color: var(--os-text);
  min-height: 48px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.os-field input:focus {
  outline: none;
  border-color: var(--os-gold);
  box-shadow: 0 0 0 3px rgba(180, 139, 82, 0.18);
}
.os-btn {
  border: 1px solid transparent;
  border-radius: var(--os-radius-sm);
  padding: 0.85rem 1.25rem;
  min-height: 48px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.05s;
}
.os-btn--primary {
  background: var(--os-gold);
  color: #fff;
}
.os-btn--primary:hover  { background: var(--os-gold-dark); }
.os-btn--primary:active { transform: translateY(1px); }
.os-btn[disabled] { opacity: 0.6; cursor: wait; }
.os-form__err {
  color: var(--os-err);
  font-size: 0.875rem;
  margin: 0;
  padding: 0.6rem 0.8rem;
  background: rgba(176, 64, 47, 0.08);
  border-radius: var(--os-radius-sm);
}

/* ═══════════════ APP SHELL ═══════════════ */

.os-app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100dvh;
}

.os-sidebar {
  background: var(--os-bg-sidebar);
  color: var(--os-text-invert);
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.os-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.os-brand img {
  filter: brightness(0) invert(1);
  width: 40px;
  height: 40px;
}
.os-brand__name {
  font-family: var(--os-font-serif);
  font-size: 1.15rem;
  font-weight: 500;
}
.os-brand__sub {
  font-size: 0.72rem;
  color: var(--os-text-invert-mut);
  margin-top: 2px;
  word-break: break-all;
}
.os-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.os-nav__link {
  padding: 0.75rem 0.9rem;
  border-radius: var(--os-radius-sm);
  color: var(--os-text-invert-mut);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.os-nav__link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--os-text-invert);
}
.os-nav__link.is-active {
  background: rgba(180, 139, 82, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--os-gold);
}
.os-sidebar__foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.os-logout-form { margin: 0; }
.os-logout-btn {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--os-radius-sm);
  color: var(--os-text-invert-mut);
  font-size: 0.85rem;
  text-align: left;
  transition: border-color 0.15s, color 0.15s;
  min-height: 40px;
}
.os-logout-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

/* ═══════════════ MAIN ═══════════════ */

.os-main { padding: 2.5rem 3rem; }
.os-page-head { margin-bottom: 2.5rem; max-width: 720px; }
.os-eyebrow {
  font-size: 0.75rem;
  color: var(--os-gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 0.6rem;
  font-weight: 600;
}
.os-h1 {
  font-family: var(--os-font-serif);
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 500;
  margin: 0 0 0.6rem;
  letter-spacing: 0.005em;
}
.os-lead {
  color: var(--os-text-muted);
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0;
}
.os-grid { display: grid; gap: 1.25rem; }
.os-grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.os-card {
  background: var(--os-bg-card);
  border-radius: var(--os-radius);
  padding: 1.5rem;
  border: 1px solid var(--os-line);
}
.os-card__label {
  font-size: 0.72rem;
  color: var(--os-gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 0 0 0.65rem;
  font-weight: 600;
}
.os-card__title {
  font-family: var(--os-font-serif);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}
.os-card__body {
  color: var(--os-text-muted);
  font-size: 0.925rem;
  line-height: 1.55;
  margin: 0;
}

/* ═══════════════ MOBILE ═══════════════ */

@media (max-width: 900px) {
  .os-app { grid-template-columns: 1fr; }
  .os-sidebar {
    position: fixed;
    inset: auto 0 0 0;
    height: auto;
    padding: 0.6rem 0.5rem calc(0.6rem + env(safe-area-inset-bottom));
    flex-direction: row;
    gap: 0.25rem;
    z-index: 20;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .os-brand, .os-sidebar__foot { display: none; }
  .os-nav {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    gap: 0;
  }
  .os-nav__link {
    flex: 1;
    justify-content: center;
    padding: 0.55rem 0.35rem;
    font-size: 0.78rem;
    text-align: center;
    box-shadow: none;
    min-height: 48px;
  }
  .os-nav__link.is-active {
    box-shadow: inset 0 3px 0 var(--os-gold);
    background: rgba(180, 139, 82, 0.10);
  }
  .os-main {
    padding: 1.25rem 1rem calc(6rem + env(safe-area-inset-bottom));
  }
  .os-h1 { font-size: 1.85rem; }
}

/* ═════════════════════════════════════════════════════════════════
   Sprint 2: Objekt-Liste + Formular
   ═════════════════════════════════════════════════════════════════ */

.os-page-head--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  max-width: none;
}

.os-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.os-btn--primary {
  background: #2a4a3a;
  color: #f5f2ec;
  border-color: #2a4a3a;
}
.os-btn--primary:hover { background: #1f3729; border-color: #1f3729; }
.os-btn--gold {
  background: #b8935a;
  color: #ffffff;
  border-color: #b8935a;
}
.os-btn--gold:hover { background: #a0803f; border-color: #a0803f; }
.os-btn--ghost {
  background: transparent;
  color: #5a4b3d;
  border-color: rgba(90, 75, 61, 0.35);
}
.os-btn--ghost:hover { background: rgba(90, 75, 61, 0.08); }

.os-linkbtn {
  background: none;
  border: 0;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  color: #5a4b3d;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}
.os-linkbtn:hover { color: #2a4a3a; background: rgba(42, 74, 58, 0.06); }
.os-linkbtn--danger { color: #a04030; }
.os-linkbtn--danger:hover { color: #7a2f22; background: rgba(160, 64, 48, 0.08); }

.os-empty {
  border: 1px dashed rgba(90, 75, 61, 0.35);
  border-radius: 12px;
  padding: 3rem 1.5rem;
  text-align: center;
  background: #f5f2ec;
}
.os-empty__title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; color: #2a4a3a; margin: 0; }
.os-empty__sub { color: #6b5c4e; margin: 0.5rem auto 1.75rem; max-width: 32rem; }

.os-table-wrap { overflow-x: auto; border: 1px solid rgba(90, 75, 61, 0.15); border-radius: 12px; background: #ffffff; }
.os-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.os-table thead { background: #f5f2ec; }
.os-table th,
.os-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(90, 75, 61, 0.1);
}
.os-table thead th {
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b5c4e;
}
.os-table tbody tr:last-child td,
.os-table tbody tr:last-child th { border-bottom: 0; }
.os-table tbody tr:hover { background: rgba(184, 147, 90, 0.05); }
.os-table__actions { text-align: right; white-space: nowrap; }

.os-table__link {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}
.os-table__initial {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5f2ec;
  color: #b8935a;
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.5rem;
}
.os-table__title { display: block; font-weight: 500; color: #2a4a3a; }
.os-table__slug { display: block; font-size: 0.75rem; color: #6b5c4e; margin-top: 0.15rem; }

.os-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(90, 75, 61, 0.1);
  color: #5a4b3d;
}
.os-badge + .os-badge { margin-left: 0.4rem; }
.os-badge--status-verfuegbar { background: rgba(184, 147, 90, 0.15); color: #7a5d2f; }
.os-badge--status-reserviert { background: rgba(214, 158, 62, 0.15); color: #7a5a2f; }
.os-badge--status-vermietet,
.os-badge--status-verkauft { background: rgba(90, 75, 61, 0.15); color: #4a3d31; }
.os-badge--status-entwurf { background: rgba(200, 200, 200, 0.25); color: #6b5c4e; }
.os-badge--published { background: rgba(42, 74, 58, 0.12); color: #2a4a3a; }
.os-badge--draft { background: rgba(200, 150, 90, 0.15); color: #7a5d2f; }

/* Formular */
.os-form { max-width: 820px; }
.os-fieldset {
  border: 1px solid rgba(90, 75, 61, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0 0 1.5rem;
  background: #ffffff;
}
.os-fieldset > legend {
  padding: 0 0.6rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: #2a4a3a;
}
.os-grid--2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.os-field { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
.os-field + .os-field { margin-top: 1rem; }
.os-fieldset .os-grid + .os-field { margin-top: 1rem; }
.os-field > span {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b5c4e;
}
.os-field small { font-size: 0.75rem; color: #7a6b5d; line-height: 1.4; }
.os-field input,
.os-field select,
.os-field textarea {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: #2a2a2a;
  background: #ffffff;
  border: 1px solid rgba(90, 75, 61, 0.25);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.os-field input:focus,
.os-field select:focus,
.os-field textarea:focus {
  outline: none;
  border-color: #b8935a;
  box-shadow: 0 0 0 3px rgba(184, 147, 90, 0.18);
}
.os-field textarea { resize: vertical; min-height: 96px; }

.os-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0;
  flex-wrap: wrap;
}
.os-form-actions__right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.os-form-msg {
  margin: 1rem 0 0;
  min-height: 1.5em;
  font-size: 0.875rem;
  color: #6b5c4e;
}
.os-form-msg[data-kind="ok"] { color: #2a4a3a; }
.os-form-msg[data-kind="error"] { color: #a04030; }
.os-form-msg[data-kind="pending"] { color: #6b5c4e; font-style: italic; }

.os-back { color: #b8935a; text-decoration: none; }
.os-back:hover { color: #a0803f; }

/* Mobile */
@media (max-width: 720px) {
  .os-main { padding: 1.25rem 1rem 6rem; }
  .os-page-head--split { flex-direction: column; align-items: stretch; }
  .os-table thead { display: none; }
  .os-table, .os-table tbody, .os-table tr, .os-table th, .os-table td {
    display: block;
    width: 100%;
    text-align: left;
  }
  .os-table tr {
    padding: 1rem;
    border-bottom: 1px solid rgba(90, 75, 61, 0.12);
  }
  .os-table tr:last-child { border-bottom: 0; }
  .os-table th, .os-table td { padding: 0.25rem 0; border: 0; }
  .os-table__actions { text-align: left; padding-top: 0.5rem; }
  .os-form-actions { flex-direction: column; align-items: stretch; }
  .os-form-actions__right { justify-content: stretch; }
  .os-form-actions__right > * { flex: 1; text-align: center; }
}
