:root {
  --bg: #edf1f3;
  --sidebar-top: #38525b;
  --sidebar-mid: #6f858d;
  --sidebar-active: rgba(36, 58, 66, 0.42);
  --card: #f8f8fa;
  --line: #d9dde2;
  --accent: #5d8d8c;
  --accent-dark: #4e7f7e;
  --text: #40434f;
  --muted: #7f8791;
  --danger: #b0524f;
  --warn: #dfc15d;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #d8e0e4 0%, #edf1f3 100%);
}

button, input, select { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px 1fr;
  transition: grid-template-columns 0.2s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 88px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar-top) 0%, #8ea3aa 100%);
  color: rgba(255, 255, 255, 0.95);
  padding: 26px 0;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 34px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.brand-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.12);
  font-size: 12px;
}

.brand-title {
  font-size: 24px;
  font-weight: 700;
}

.side-nav {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  padding: 19px 34px;
  font-size: 20px;
  background: transparent;
}

.side-link.active,
.side-link:hover {
  background: var(--sidebar-active);
  color: #fff;
}

.side-link-icon {
  width: 18px;
  text-align: center;
  opacity: 0.95;
}

.side-link-text {
  display: inline;
}

/* Eingeklappt */
.sidebar.collapsed .brand {
  justify-content: center;
  padding: 0 0 20px;
}

.sidebar.collapsed .brand-title {
  display: none;
}

.sidebar.collapsed .side-link {
  justify-content: center;
  padding: 18px 0;
}

.sidebar.collapsed .side-link-text {
  display: none;
}

.sidebar.collapsed .side-link-icon {
  width: auto;
  font-size: 22px;
}

.main-area {
  min-width: 0;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(255,255,255,0.28);
  border-bottom: 1px solid rgba(64,67,79,0.08);
}

.topbar h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1;
  font-weight: 700;
  color: #3f4250;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-wrap input {
  width: 250px;
  height: 52px;
  border-radius: 7px;
  border: 1px solid #d8d8de;
  background: rgba(255,255,255,0.85);
  padding: 0 18px;
  font-size: 18px;
  color: var(--text);
}

.icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(93, 115, 124, 0.15);
  color: #6b7e88;
  cursor: pointer;
}

.content {
  padding: 22px 34px 34px;
}

.banner {
  margin: 18px 34px 0;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.banner.success {
  color: #295546;
  background: #e5f2ee;
  border-color: #bad8cf;
}

.banner.error {
  color: #8a3131;
  background: #f9e6e6;
  border-color: #edc9c8;
}

.hidden { display: none !important; }

.card {
  background: rgba(252,252,253,0.92);
  border: 1px solid rgba(169, 180, 187, 0.5);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.55), 0 2px 16px rgba(78, 96, 105, 0.08);
}

.entry-panel {
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
}

.card-accent {
  height: 4px;
  background: var(--accent);
}

.panel-header {
  padding: 22px 24px 8px;
}

.panel-header h2 {
  margin: 0;
  font-size: 25px;
}

.entry-form {
  padding: 0 24px 24px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 22px;
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 18px;
}

.field-grid label span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-grid label em {
  color: #b65454;
  font-style: normal;
  font-size: 13px;
}

.field-grid input,
.field-grid select {
  height: 46px;
  border-radius: 6px;
  border: 1px solid #d2d5db;
  background: #fff;
  padding: 0 14px;
  color: #6e7692;
  font-size: 18px;
}

.note-preview {
  margin-top: 18px;
  border: 1px solid #e0e4e8;
  background: #fbfbfc;
  border-radius: 8px;
  padding: 14px;
}

.note-preview-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.note-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, monospace;
  color: #5b6275;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.table-card {
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 10px;
}

.table-title {
  font-size: 22px;
  font-weight: 700;
}

.table-subtitle {
  color: var(--muted);
  margin-top: 4px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
}

thead th {
  text-align: left;
  background: #edf0f4;
  color: #505565;
  padding: 14px 18px;
  font-weight: 700;
  border-right: 1px solid #dde2e8;
  white-space: nowrap;
}

thead th:last-child { border-right: 0; }

tbody td {
  padding: 14px 18px;
  border-top: 1px solid #e2e6ea;
  vertical-align: middle;
}

.data-row:hover {
  background: rgba(93, 141, 140, 0.06);
}

.mono {
  font-variant-numeric: tabular-nums;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 15px;
}

.status.active {
  background: #e5f1ea;
  color: #346253;
}

.status.suspended {
  background: #fbefc9;
  color: #755f16;
}

.actions-cell {
  display: flex;
  gap: 10px;
  white-space: nowrap;
  align-items: center;
}

.actions-col {
  width: 250px;
}

.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.btn {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.2s ease;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

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

.btn.primary:hover { background: var(--accent-dark); }

.btn.light {
  background: #f4f4f6;
  border: 1px solid #d4d7de;
  color: #606474;
}

.btn.warn {
  background: var(--warn);
  color: #5d4d11;
}

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

.btn.small {
  min-width: 110px;
  height: 42px;
  padding: 0 16px;
  font-size: 19px;
}

.btn.xs {
  min-width: 116px;
  height: 38px;
  padding: 0 14px;
  font-size: 16px;
}

.form-actions .btn {
  min-width: 160px;
  height: 44px;
  padding: 0 16px;
  font-size: 18px;
}

/* Gleich grosse Action-Buttons */
.actions-cell .btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
}

.confirm-dialog {
  border: 0;
  padding: 0;
  border-radius: 12px;
  width: min(460px, calc(100vw - 24px));
}

.confirm-dialog::backdrop {
  background: rgba(27, 39, 45, 0.45);
}

.confirm-box {
  padding: 24px;
  background: #fff;
}

.confirm-box h3 {
  margin: 0 0 12px;
  font-size: 24px;
}

.confirm-box p {
  margin: 0;
  color: #59606f;
  line-height: 1.5;
}

.confirm-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-actions .btn {
  min-width: 132px;
  height: 42px;
}

/* LOGIN */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-box {
  background: rgba(252,252,253,0.95);
  border: 1px solid rgba(169, 180, 187, 0.5);
  border-radius: 12px;
  padding: 30px;
  width: 320px;
  box-shadow: 0 2px 16px rgba(78, 96, 105, 0.1);
}

.login-box h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  height: 44px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid #d2d5db;
  border-radius: 6px;
}

.login-box button {
  width: 100%;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.login-box button:hover {
  background: var(--accent-dark);
}

.login-error {
  margin-top: 10px;
  color: var(--danger);
}

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 250px 1fr; }
  .app-shell.sidebar-collapsed { grid-template-columns: 88px 1fr; }
  .topbar h1 { font-size: 42px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    height: auto;
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .topbar h1 { font-size: 34px; }

  .content, .banner {
    margin: 0;
    padding-left: 20px;
    padding-right: 20px;
  }

  .banner { margin-top: 16px; }
}

@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .actions-cell { flex-direction: column; }
  .search-wrap input { width: 100%; }
  .topbar-tools { flex-wrap: wrap; }
}