/* ============================================================
   Projektraum — CI / Design System
   CI-Orange: #DE6C27
   ============================================================ */

:root {
  --orange:        #DE6C27;
  --orange-hover:  #C4581E;
  --orange-light:  #FAEEE5;
  --sidebar-bg:    #1C1C1E;
  --sidebar-text:  #A1A1A6;
  --sidebar-hover: #2C2C2E;
  --bg:            #F4F4F6;
  --white:         #FFFFFF;
  --text:          #231F20;
  --text-muted:    #6E6E73;
  --border:        #E0E0E5;
  --border-dark:   #C8C8D0;
  --radius:        8px;
  --radius-sm:     5px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 24px rgba(0,0,0,.12);
  --sidebar-w:     240px;
  --topbar-h:      56px;
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- Layout ---- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo img { width: 130px; }

.sidebar-section-label {
  padding: 20px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
}

.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-item svg { flex-shrink: 0; opacity: .7; }

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  color: #fff;
  background: rgba(222,108,39,.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--orange);
  border-radius: 0 3px 3px 0;
}

.nav-item.active svg { opacity: 1; color: var(--orange); }

.nav-badge {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-name { font-size: 13px; font-weight: 500; color: #fff; }
.sidebar-user-role { font-size: 11px; color: var(--sidebar-text); }

/* ---- Topbar ---- */
.topbar {
  grid-area: topbar;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.topbar-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--orange); }
.topbar-breadcrumb .sep { color: var(--border-dark); }
.topbar-breadcrumb .current { color: var(--text); font-weight: 500; }

.topbar-spacer { flex: 1; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  width: 240px;
  color: var(--text-muted);
  font-size: 13px;
}

.topbar-icon-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  position: relative;
}

.topbar-icon-btn:hover { border-color: var(--orange); color: var(--orange); }

.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--orange);
  border-radius: 50%;
  border: 1.5px solid var(--white);
}

/* ---- Main Content ---- */
.main {
  grid-area: main;
  padding: 28px;
  max-width: 1300px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-primary:hover { background: var(--orange-hover); box-shadow: var(--shadow); }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-card.orange .stat-value { color: var(--orange); }

/* ---- Project Cards Grid ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--orange);
}

.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }

.project-number { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.project-name { font-size: 15px; font-weight: 700; margin-top: 2px; }

.project-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.meta-row { display: flex; align-items: center; justify-content: space-between; }
.meta-label { font-size: 12px; color: var(--text-muted); }
.meta-value { font-size: 12.5px; font-weight: 500; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-active { background: #E8F5E9; color: #2E7D32; }
.status-active::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #2E7D32; display: inline-block; }
.status-paused { background: #FFF3E0; color: #E65100; }
.status-paused::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #E65100; display: inline-block; }
.status-archive { background: var(--bg); color: var(--text-muted); }
.status-archive::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); display: inline-block; }

.new-docs-badge { background: var(--orange-light); color: var(--orange); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--orange-light); }

/* ---- File browser ---- */
.file-layout {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 16px;
  align-items: start;
}

.folder-tree {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 0;
  box-shadow: var(--shadow-sm);
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background .12s;
}

.folder-item:hover { background: var(--bg); }
.folder-item.active { background: var(--orange-light); color: var(--orange); font-weight: 600; }
.folder-item svg { flex-shrink: 0; }

.file-list { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.file-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-path { font-size: 12.5px; color: var(--text-muted); flex: 1; }

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  cursor: pointer;
}

.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg); }

.file-icon { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-icon.pdf { background: #FDEAEA; color: #C62828; }
.file-icon.dwg { background: #E3F2FD; color: #1565C0; }
.file-icon.folder { background: #FFF8E1; color: #F57F17; }
.file-icon.img { background: #F3E5F5; color: #6A1B9A; }
.file-icon.doc { background: #E8F5E9; color: #2E7D32; }

.file-name { font-size: 13.5px; font-weight: 500; flex: 1; }
.file-meta { font-size: 11.5px; color: var(--text-muted); text-align: right; }
.file-version { background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }

/* ---- Activity Feed ---- */
.activity-feed { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.activity-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-avatar.blue { background: #1565C0; }
.activity-avatar.green { background: #2E7D32; }
.activity-avatar.purple { background: #6A1B9A; }

.activity-text { font-size: 12.5px; line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-text strong { font-weight: 600; }

/* ---- Wizard ---- */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 20px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  position: relative;
}

.wizard-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}

.wizard-step.done:not(:last-child)::after { background: var(--orange); }

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.wizard-step.active .step-num { border-color: var(--orange); background: var(--orange); color: #fff; }
.wizard-step.done .step-num { border-color: var(--orange); background: var(--orange); color: #fff; }

.step-label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.wizard-step.active .step-label { color: var(--orange); font-weight: 600; }
.wizard-step.done .step-label { color: var(--text); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.form-label span { color: var(--orange); }
.form-control {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: var(--white);
  font-family: var(--font);
  transition: border-color .15s;
  outline: none;
}
.form-control:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(222,108,39,.1); }

select.form-control { cursor: pointer; }

.folder-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.folder-preview-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
}

/* ---- Invite row ---- */
.invite-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 140px 36px;
  gap: 10px;
  align-items: end;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.invite-row:first-of-type { padding-top: 0; }

/* ---- Login ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background-image: url('onnen_.png');
  background-size: cover;
  background-position: center;
  opacity: .18;
  filter: grayscale(1);
}

.login-card {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  padding: 44px 44px 36px;
  width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo { margin-bottom: 28px; }
.login-logo img { height: 44px; }

.login-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-sub { font-size: 13.5px; color: var(--text-muted); margin-bottom: 28px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ---- Misc ---- */
.avatar-stack { display: flex; }
.avatar-stack .av {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--white);
  margin-left: -6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.avatar-stack .av:first-child { margin-left: 0; }

.role-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

.role-architekt { background: #E3F2FD; color: #1565C0; }
.role-bauherr   { background: #E8F5E9; color: #2E7D32; }
.role-gewerk    { background: #FFF3E0; color: #E65100; }
.role-statik    { background: #F3E5F5; color: #6A1B9A; }
.role-pruefer   { background: #FCE4EC; color: #AD1457; }

.section-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }

hr.section-sep { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
