:root {
  --aza-blue: #1a5f8a;
  --aza-blue-dark: #134a6b;
  --aza-blue-light: #e8f2f8;
  --aza-accent: #2d8bc9;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --bg: #f4f7fa;
  --white: #ffffff;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--aza-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--aza-blue-dark);
  color: var(--white);
  padding: 1.5rem 0;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 1rem;
}

.sidebar-brand h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.sidebar-brand small {
  opacity: 0.75;
  font-size: 0.8rem;
}

.sidebar nav a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.sidebar-user {
  padding: 1rem 1.25rem;
  margin-top: auto;
  font-size: 0.85rem;
  opacity: 0.85;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.main {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 1200px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header h2 {
  font-size: 1.5rem;
  color: var(--aza-blue-dark);
}

.hint-banner {
  background: var(--aza-blue-light);
  border-left: 4px solid var(--aza-blue);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--aza-blue);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--aza-blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--aza-blue-dark);
  text-decoration: none;
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--aza-blue-light);
  color: var(--aza-blue-dark);
  font-weight: 600;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-neu { background: #dbeafe; color: #1e40af; }
.badge-arbeit { background: #fef3c7; color: #92400e; }
.badge-warten { background: #fce7f3; color: #9d174d; }
.badge-erledigt { background: #d1fae5; color: #065f46; }
.badge-archiv { background: #e2e8f0; color: #475569; }

.badge-niedrig { background: #e2e8f0; color: #475569; }
.badge-normal { background: #dbeafe; color: #1e40af; }
.badge-hoch { background: #fee2e2; color: #991b1b; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-info {
  background: var(--aza-blue-light);
  color: var(--aza-blue-dark);
  border: 1px solid #bfdbfe;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--aza-blue-dark) 0%, var(--aza-blue) 100%);
}

.login-box {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  text-align: center;
  color: var(--aza-blue-dark);
  margin-bottom: 0.25rem;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-bar input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.comment-list {
  list-style: none;
  margin-top: 1rem;
}

.comment-list li {
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.tag {
  display: inline-block;
  background: var(--aza-blue-light);
  color: var(--aza-blue);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--aza-blue-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--aza-blue);
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone:hover,
.drop-zone:focus {
  outline: none;
  border-color: var(--aza-accent);
  background: var(--aza-blue-light);
}

.drop-zone-active {
  border-color: var(--aza-blue);
  background: var(--aza-blue-light);
  box-shadow: 0 0 0 3px rgba(26, 95, 138, 0.15);
}

.drop-zone-icon {
  font-size: 2rem;
  color: var(--aza-blue);
  margin-bottom: 0.5rem;
}

.drop-zone-title {
  font-weight: 600;
  color: var(--aza-blue-dark);
  margin-bottom: 0.25rem;
}

.drop-zone-sub,
.drop-zone-types {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.drop-zone-types {
  margin-top: 0.5rem;
}

.upload-meta {
  margin-top: 1rem;
}

.upload-status {
  margin-top: 0.75rem;
}

.file-actions {
  white-space: nowrap;
}

.file-actions .btn {
  margin-bottom: 0.25rem;
}

.odt-edit-placeholder h3 {
  color: var(--aza-blue-dark);
}

.doc-editor-header {
  align-items: flex-start;
}

.doc-editor-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.save-status {
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  font-weight: 500;
}

.save-status-saved {
  background: #d1fae5;
  color: #065f46;
}

.save-status-saving {
  background: #fef3c7;
  color: #92400e;
}

.save-status-unsaved {
  background: #dbeafe;
  color: #1e40af;
}

.save-status-error {
  background: #fee2e2;
  color: #991b1b;
}

.doc-meta-card {
  margin-bottom: 1rem;
}

.doc-editor-card {
  padding: 0;
  overflow: hidden;
}

.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  background: var(--aza-blue-light);
  border-bottom: 1px solid var(--border);
}

.doc-tb-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
}

.doc-tb-btn:hover {
  background: var(--bg);
  border-color: var(--aza-accent);
}

.doc-tb-sep {
  width: 1px;
  background: var(--border);
  margin: 0 0.25rem;
  align-self: stretch;
}

.doc-editor-body {
  min-height: 420px;
  padding: 1.25rem 1.5rem;
  outline: none;
  line-height: 1.6;
  font-size: 1rem;
}

.doc-editor-body:focus {
  background: #fcfeff;
}

.doc-editor-body h1,
.doc-editor-body h2,
.doc-editor-body h3 {
  color: var(--aza-blue-dark);
  margin: 0.75rem 0 0.5rem;
}

.doc-editor-body ul,
.doc-editor-body ol {
  margin: 0.5rem 0 0.5rem 1.5rem;
  padding-left: 1.25rem;
}

.doc-editor-body li {
  margin: 0.2rem 0;
  line-height: 1.5;
}

.doc-editor-body ul ul,
.doc-editor-body ul ol,
.doc-editor-body ol ul,
.doc-editor-body ol ol {
  margin-top: 0.15rem;
  margin-bottom: 0.15rem;
}

.doc-toolbar .doc-tb-btn {
  white-space: nowrap;
}

.user-edit-details {
  display: inline-block;
  margin-right: 0.25rem;
}

.user-edit-details summary {
  list-style: none;
  cursor: pointer;
}

.user-inline-form {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  min-width: 220px;
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    padding: 1rem 0;
  }

  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
  }

  .sidebar nav a {
    padding: 0.5rem 1rem;
  }

  .main {
    padding: 1rem;
  }
}
