/* Penwelope Studio Prototyp - Branding-Tokens */
:root {
  --penwelope-bg: #faf7f2;
  --penwelope-surface: #ffffff;
  --penwelope-border: #e6dfd4;
  --penwelope-border-strong: #c9beae;
  --penwelope-text: #2c2a26;
  --penwelope-text-muted: #6b675f;
  --penwelope-accent: #1d9e75;
  --penwelope-accent-soft: #e6f4ee;
  --penwelope-warning: #d85a30;
  --penwelope-warning-soft: #fce8df;
  --penwelope-info: #5b7bb5;
  --penwelope-info-soft: #e7eef8;
  --penwelope-shadow: 0 1px 2px rgba(44, 42, 38, 0.04), 0 4px 12px rgba(44, 42, 38, 0.04);
  --penwelope-shadow-lift: 0 4px 16px rgba(44, 42, 38, 0.08);
}

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap");

*, *::before, *::after {
  box-sizing: border-box;
}

/* Scrollbar dezent: unsichtbar, aber Scrollen weiter moeglich */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
*::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

html, body {
  background: var(--penwelope-bg);
  color: var(--penwelope-text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-feature-settings: "rlig" 1, "calt" 1;
  margin: 0;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Tailwind-Reset-Ergänzung für nicht-getailwindete HTML */
button { font: inherit; }

/* Touch-Targets für Tablet */
.touch { min-height: 44px; min-width: 44px; }

/* Sidebar-Navigation */
.pw-sidebar {
  background: var(--penwelope-surface);
  border-right: 1px solid var(--penwelope-border);
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.pw-sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--penwelope-border);
}
.pw-sidebar-logo h1 {
  font-size: 24px;
  color: var(--penwelope-text);
  letter-spacing: 0.02em;
}
.pw-sidebar-logo p {
  font-size: 11px;
  color: var(--penwelope-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-top: 2px;
}
.pw-sidebar-nav {
  padding: 12px;
  flex: 1;
}
.pw-sidebar-nav.pw-sidebar-nav-bottom {
  flex: 0 0 auto;
  border-top: 1px solid var(--penwelope-border);
  padding-top: 12px;
}
.pw-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--penwelope-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 120ms;
  margin-bottom: 2px;
}
.pw-sidebar-nav a:hover { background: var(--penwelope-bg); }
.pw-sidebar-nav a.active {
  background: var(--penwelope-accent-soft);
  color: var(--penwelope-accent);
}
.pw-sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.pw-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--penwelope-border);
  font-size: 13px;
  color: var(--penwelope-text-muted);
}

/* Topbar */
.pw-topbar {
  background: var(--penwelope-surface);
  border-bottom: 1px solid var(--penwelope-border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.pw-topbar-left { display: flex; align-items: center; gap: 16px; }
.pw-topbar-context {
  background: var(--penwelope-accent-soft);
  color: var(--penwelope-accent);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.pw-topbar-right { display: flex; align-items: center; gap: 12px; }

/* Layout shell */
.pw-shell {
  display: flex;
  min-height: 100vh;
}
.pw-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pw-content {
  padding: 32px;
  flex: 1;
}

/* Cards */
.pw-card {
  background: var(--penwelope-surface);
  border: 1px solid var(--penwelope-border);
  border-radius: 12px;
  box-shadow: var(--penwelope-shadow);
}
.pw-card-padded { padding: 24px; }

/* Buttons */
.pw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 120ms;
  min-height: 44px;
}
.pw-btn-primary {
  background: var(--penwelope-accent);
  color: white;
}
.pw-btn-primary:hover { background: #198a64; }
.pw-btn-outline {
  background: var(--penwelope-surface);
  color: var(--penwelope-text);
  border-color: var(--penwelope-border);
}
.pw-btn-outline:hover { background: var(--penwelope-bg); }
.pw-btn-ghost {
  background: transparent;
  color: var(--penwelope-text);
}
.pw-btn-ghost:hover { background: var(--penwelope-bg); }
.pw-btn-danger {
  background: var(--penwelope-warning);
  color: white;
}

/* Inputs */
.pw-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--penwelope-border);
  border-radius: 8px;
  font-size: 15px;
  background: var(--penwelope-surface);
  color: var(--penwelope-text);
  font-family: inherit;
  min-height: 44px;
}
.pw-input:focus {
  outline: none;
  border-color: var(--penwelope-accent);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15);
}
.pw-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--penwelope-text);
  margin-bottom: 6px;
}
.pw-help {
  font-size: 12px;
  color: var(--penwelope-text-muted);
  margin-top: 4px;
}

/* Badge */
.pw-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--penwelope-bg);
  color: var(--penwelope-text-muted);
  border: 1px solid var(--penwelope-border);
}
.pw-badge.accent { background: var(--penwelope-accent-soft); color: var(--penwelope-accent); border-color: transparent; }
.pw-badge.warning { background: var(--penwelope-warning-soft); color: var(--penwelope-warning); border-color: transparent; }
.pw-badge.info { background: var(--penwelope-info-soft); color: var(--penwelope-info); border-color: transparent; }

/* Tabs */
.pw-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--penwelope-border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.pw-tabs button {
  background: transparent;
  border: none;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--penwelope-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 120ms;
}
.pw-tabs button:hover { color: var(--penwelope-text); }
.pw-tabs button.active {
  color: var(--penwelope-accent);
  border-bottom-color: var(--penwelope-accent);
}

/* Tables */
.pw-table {
  width: 100%;
  border-collapse: collapse;
}
.pw-table-fixed { table-layout: fixed; }
.pw-table-fixed td, .pw-table-fixed th { word-wrap: break-word; overflow-wrap: break-word; }
.pw-table th, .pw-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--penwelope-border);
}
.pw-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--penwelope-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--penwelope-bg);
}
.pw-table tr:hover td { background: var(--penwelope-bg); }
.pw-table tr:last-child td { border-bottom: none; }

/* Slider 1-10 oder 1-5 */
.pw-slider {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pw-slider button {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--penwelope-border);
  background: var(--penwelope-surface);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  color: var(--penwelope-text-muted);
  transition: all 100ms;
}
.pw-slider button:hover { background: var(--penwelope-bg); }
.pw-slider button.selected {
  background: var(--penwelope-accent);
  color: white;
  border-color: var(--penwelope-accent);
}

/* Avatar Initials */
.pw-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--penwelope-accent-soft);
  color: var(--penwelope-accent);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.pw-avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* Stats */
.pw-stat {
  background: var(--penwelope-surface);
  border: 1px solid var(--penwelope-border);
  border-radius: 12px;
  padding: 20px;
}
.pw-stat-label { font-size: 13px; color: var(--penwelope-text-muted); font-weight: 500; }
.pw-stat-value { font-size: 32px; font-family: "Cormorant Garamond", serif; font-weight: 600; margin-top: 4px; }
.pw-stat-trend { font-size: 12px; color: var(--penwelope-accent); margin-top: 6px; }

/* Wood-Lampe Mode (UV-Look) */
.pw-photo-wood {
  background: linear-gradient(135deg, #1a1240 0%, #2d1758 100%);
  filter: hue-rotate(-30deg) saturate(1.4);
}

/* Hover-Tooltip-Container */
.pw-pulse {
  animation: pwpulse 2s infinite;
}
@keyframes pwpulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Tablet-Breakpoint */
@media (max-width: 900px) {
  .pw-sidebar { width: 64px; }
  .pw-sidebar-logo h1, .pw-sidebar-logo p, .pw-sidebar-nav a span, .pw-sidebar-footer { display: none; }
  .pw-content { padding: 20px; }
}
