/* StoreyOS Dashboard — matches landing page design language */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f0e6;
  --surface: #ffffff;
  --fg: #1a1814;
  --fg-muted: #6b6560;
  --accent: #b87333;
  --accent-light: #d4a76a;
  --border: #d9cfc0;
  --card-bg: #ffffff;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── APP SHELL ─── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ─── HEADER ─── */
.app-header {
  background: var(--fg);
  color: var(--bg);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 32px; width: 100%; max-width: 1400px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-mark { background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; padding: 5px 8px; border-radius: 6px; }
.logo-name { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.3rem; font-weight: 400; letter-spacing: 0.01em; }
.header-nav { display: flex; gap: 4px; }
.nav-link { color: rgba(245,240,230,0.6); text-decoration: none; font-size: 0.85rem; padding: 6px 12px; border-radius: 6px; transition: all 0.15s; }
.nav-link:hover, .nav-link.active { color: #f5f0e6; background: rgba(255,255,255,0.08); }
.header-meta { margin-left: auto; }
.os-badge { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-light); font-weight: 500; }

/* ─── MAIN ─── */
.app-main { flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; padding: 48px 40px; }

.dashboard-header { margin-bottom: 32px; }
.dashboard-header h1 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 2.2rem; font-weight: 300; margin-bottom: 8px; }
.dashboard-subtitle { font-size: 0.95rem; color: var(--fg-muted); }

/* ─── BUILDING TABS ─── */
.building-tabs { display: flex; gap: 8px; margin-bottom: 40px; flex-wrap: wrap; }
.btab { background: var(--surface); border: 1px solid var(--border); color: var(--fg-muted); font-size: 0.82rem; font-family: 'DM Sans', sans-serif; padding: 8px 16px; border-radius: 99px; cursor: pointer; transition: all 0.15s; }
.btab:hover { border-color: var(--accent); color: var(--fg); }
.btab.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ─── THREE-COLUMN LAYOUT ─── */
.os-columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; align-items: start; }

.os-col { display: flex; flex-direction: column; gap: 16px; }

.col-header { display: flex; justify-content: space-between; align-items: center; }
.col-title { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); display: flex; align-items: center; gap: 8px; }

.btn-add { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; border: none; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; line-height: 1; }
.btn-add:hover { transform: scale(1.1); }

/* ─── KANBAN ─── */
.kanban { display: flex; flex-direction: column; gap: 10px; }

.kanban-col { background: rgba(255,255,255,0.4); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }

.kanban-col-label { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.erledigt-label { color: #4a9e6a; }
.pruefung-label { color: #d4a76a; }
.offen-label { color: var(--fg-muted); }

.kanban-count { background: rgba(0,0,0,0.07); border-radius: 99px; padding: 1px 7px; font-size: 0.68rem; }

.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }

.task-card { background: var(--surface); border-radius: 8px; padding: 12px 12px 12px 16px; border: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; cursor: default; transition: box-shadow 0.15s; }
.task-card:hover { box-shadow: 0 4px 12px rgba(26,24,20,0.08); }
.task-card-priority { width: 4px; border-radius: 4px; align-self: stretch; min-height: 32px; flex-shrink: 0; }
.task-card-body { flex: 1; min-width: 0; }
.task-card-title { font-size: 0.82rem; font-weight: 500; color: var(--fg); margin-bottom: 6px; line-height: 1.4; }
.task-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card-building { font-size: 0.7rem; color: var(--fg-muted); }

.task-status-select { background: transparent; border: 1px solid var(--border); border-radius: 6px; font-size: 0.7rem; color: var(--fg-muted); padding: 2px 6px; cursor: pointer; font-family: 'DM Sans', sans-serif; }

/* ─── VOTES ─── */
.votes-list { display: flex; flex-direction: column; gap: 12px; }

.vote-card { background: var(--surface); border-radius: 12px; padding: 18px; border: 1px solid var(--border); }
.vote-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.vote-type-badge { font-size: 0.65rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(184,115,51,0.12); color: var(--accent); padding: 3px 8px; border-radius: 99px; }
.vote-status { font-size: 0.78rem; font-weight: 500; }
.vote-title { font-size: 0.9rem; font-weight: 500; color: var(--fg); margin-bottom: 4px; line-height: 1.4; }
.vote-building { font-size: 0.75rem; color: var(--fg-muted); margin-bottom: 8px; }
.vote-desc { font-size: 0.8rem; color: var(--fg-muted); line-height: 1.5; margin-bottom: 12px; }
.vote-results { margin-bottom: 14px; }
.vote-bar { height: 6px; background: rgba(184,115,51,0.15); border-radius: 3px; overflow: hidden; display: flex; margin-bottom: 6px; }
.vote-bar-yes { background: #4a9e6a; height: 100%; transition: width 0.3s; }
.vote-bar-no { background: #e05252; height: 100%; transition: width 0.3s; }
.vote-tally { display: flex; gap: 12px; font-size: 0.75rem; }
.tally-yes { color: #4a9e6a; }
.tally-no { color: #e05252; }
.tally-abstain { color: var(--fg-muted); }
.vote-actions { display: flex; gap: 6px; margin-top: 12px; }
.vote-btn { flex: 1; padding: 8px; border-radius: 8px; font-size: 0.78rem; font-weight: 500; font-family: 'DM Sans', sans-serif; cursor: pointer; border: 1px solid; transition: all 0.15s; }
.vote-btn.yes { background: rgba(74,158,106,0.08); border-color: rgba(74,158,106,0.3); color: #4a9e6a; }
.vote-btn.yes:hover { background: #4a9e6a; color: #fff; }
.vote-btn.no { background: rgba(224,82,82,0.08); border-color: rgba(224,82,82,0.3); color: #e05252; }
.vote-btn.no:hover { background: #e05252; color: #fff; }
.vote-btn.abstain { background: rgba(107,101,96,0.08); border-color: rgba(107,101,96,0.3); color: var(--fg-muted); }
.vote-btn.abstain:hover { background: var(--fg-muted); color: #fff; }
.vote-deadline { font-size: 0.72rem; color: var(--fg-muted); margin-top: 8px; }

/* ─── DOCUMENTS ─── */
.upload-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: rgba(184,115,51,0.04); }
.upload-icon { color: var(--fg-muted); margin-bottom: 8px; display: flex; justify-content: center; }
.upload-text { font-size: 0.85rem; color: var(--fg); margin-bottom: 4px; }
.upload-hint { font-size: 0.72rem; color: var(--fg-muted); }

.docs-categories { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.doc-category { }
.doc-category-label { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.doc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: box-shadow 0.15s;
}
.doc-row:hover { box-shadow: 0 3px 10px rgba(26,24,20,0.07); }
.doc-icon { font-size: 1.1rem; flex-shrink: 0; }
.doc-name { font-size: 0.82rem; color: var(--fg); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 0.72rem; color: var(--fg-muted); white-space: nowrap; }
.doc-download { color: var(--accent); text-decoration: none; padding: 4px; flex-shrink: 0; display: flex; align-items: center; }
.doc-download:hover { color: var(--fg); }

/* ─── EMPTY STATE ─── */
.empty-state { font-size: 0.82rem; color: var(--fg-muted); text-align: center; padding: 24px 0; }

/* ─── MODAL ─── */
.modal { display: flex; align-items: center; justify-content: center; position: fixed; inset: 0; background: rgba(26,24,20,0.4); backdrop-filter: blur(4px); z-index: 200; }
.modal-box { background: var(--surface); border-radius: 16px; padding: 28px; width: 100%; max-width: 480px; box-shadow: 0 24px 48px rgba(26,24,20,0.18); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.4rem; font-weight: 400; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--fg-muted); line-height: 1; padding: 0; }
.modal-close:hover { color: var(--fg); }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 6px; letter-spacing: 0.03em; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.88rem; font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--fg); outline: none; transition: border-color 0.15s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.btn-primary { background: var(--fg); color: var(--bg); border: none; padding: 10px 22px; border-radius: 8px; font-size: 0.88rem; font-weight: 500; font-family: 'DM Sans', sans-serif; cursor: pointer; transition: opacity 0.15s; }
.btn-primary:hover { opacity: 0.85; }
.btn-secondary { background: transparent; color: var(--fg-muted); border: 1px solid var(--border); padding: 10px 22px; border-radius: 8px; font-size: 0.88rem; font-family: 'DM Sans', sans-serif; cursor: pointer; }
.btn-secondary:hover { background: rgba(0,0,0,0.04); }

.upload-preview { padding: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; text-align: center; margin-bottom: 16px; }
.upload-preview-name { font-size: 0.85rem; color: var(--fg-muted); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .os-columns { grid-template-columns: 1fr 1fr; }
  #col-documents { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .app-main { padding: 24px 20px; }
  .app-header { padding: 0 20px; }
  .os-columns { grid-template-columns: 1fr; }
  .header-meta { display: none; }
  .kanban { gap: 8px; }
  .kanban-col { padding: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .modal-box { margin: 20px; padding: 20px; }
}