/* ── Admin UI ────────────────────────────────────────────── */

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

body {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 13px;
  background: #e8e4dc;
  color: #111;
}

/* ── Layout admin ────────────────────────────────────────── */
.admin-wrap {
  display: grid;
  grid-template-columns: 190px 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "topbar topbar"
    "sidenav content"
    "footer footer";
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────── */
.admin-topbar {
  grid-area: topbar;
  background: #1e3008;
  color: #c8e07a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid #0a1a04;
}
.admin-topbar .brand {
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #c8e07a;
  text-decoration: none;
}
.admin-topbar .brand span { color: #88cc44; }
.admin-topbar .user-info {
  font-size: 11px;
  color: #88aa48;
  display: flex;
  gap: 10px;
  align-items: center;
}
.admin-topbar a { color: #aac860; text-decoration: none; }
.admin-topbar a:hover { color: #d8f090; text-decoration: underline; }

/* ── Sidenav ─────────────────────────────────────────────── */
.admin-sidenav {
  grid-area: sidenav;
  background: #2a3a14;
  padding: 0;
  border-right: 1px solid #1a2a08;
}
.admin-sidenav .nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #607030;
  padding: 10px 12px 4px;
  font-weight: bold;
}
.admin-sidenav ul { list-style: none; }
.admin-sidenav li a {
  display: block;
  padding: 7px 14px;
  color: #a8c870;
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid #1e2e0a;
}
.admin-sidenav li a:hover,
.admin-sidenav li a.active {
  background: #1a2808;
  color: #d8f090;
  text-decoration: none;
}
.admin-sidenav li a .icon {
  display: inline-block;
  width: 16px;
  text-align: center;
  margin-right: 6px;
  font-style: normal;
}

/* ── Content area ────────────────────────────────────────── */
.admin-content {
  grid-area: content;
  background: #f2efe8;
  padding: 0;
}

.admin-page-header {
  background: #fff;
  border-bottom: 1px solid #ccc8be;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-page-header h1 {
  font-size: 17px;
  font-weight: bold;
  color: #1a1a1a;
}

.admin-body {
  padding: 16px;
}

/* ── Tabelle ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
  border: 1px solid #ccc8be;
}
.data-table th {
  background: #2e4a0a;
  color: #c8e07a;
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: bold;
  white-space: nowrap;
}
.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #e0ddd4;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f0ede4; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-published { background: #2e4a0a; color: #c8e07a; }
.badge-draft     { background: #888; color: #fff; }

/* ── Pulsanti ────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid;
  font-family: Verdana, sans-serif;
  white-space: nowrap;
}
.btn-primary {
  background: #2e4a0a;
  color: #c8e07a;
  border-color: #1a2e06;
}
.btn-primary:hover { background: #3a6010; color: #d8f090; text-decoration: none; }

.btn-secondary {
  background: #e0ddd4;
  color: #333;
  border-color: #aaa;
}
.btn-secondary:hover { background: #d4d0c4; text-decoration: none; }

.btn-danger {
  background: #6b1414;
  color: #ffd8d8;
  border-color: #3a0a0a;
  font-size: 11px;
  padding: 3px 8px;
}
.btn-danger:hover { background: #8b1a1a; text-decoration: none; }

.btn-sm { padding: 2px 8px; font-size: 11px; }

/* ── Form ────────────────────────────────────────────────── */
.form-row {
  margin-bottom: 14px;
}
.form-row label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #555;
  margin-bottom: 4px;
}
.form-row input[type=text],
.form-row input[type=url],
.form-row input[type=number],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #aaa9a0;
  background: #fff;
  font-family: Verdana, sans-serif;
  color: #111;
}
.form-row textarea {
  font-family: "Courier New", monospace;
  font-size: 12px;
  min-height: 200px;
  resize: vertical;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid #3a6010;
  border-color: #3a6010;
}
.form-row .help {
  font-size: 11px;
  color: #888;
  margin-top: 3px;
}
.form-row input[type=checkbox] {
  width: auto;
  margin-right: 6px;
}

/* Form layout 2 colonne */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: start;
}
.form-sidebar {
  background: #fff;
  border: 1px solid #ccc8be;
}
.form-sidebar-header {
  background: #3a3830;
  color: #f0ede4;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 4px 8px;
  letter-spacing: 0.5px;
}
.form-sidebar-body { padding: 10px; }

/* ── Flash messages ──────────────────────────────────────── */
.flash-msg {
  padding: 8px 14px;
  margin: 0;
  font-size: 12px;
  border-bottom: 1px solid;
}
.flash-msg.success { background: #ddf0dd; border-color: #88bb88; color: #115511; }
.flash-msg.error   { background: #ffeedd; border-color: #cc8866; color: #661100; }
.flash-msg.info    { background: #ddeeff; border-color: #88aacc; color: #113366; }

/* ── EasyMDE overrides ───────────────────────────────────── */
.editor-toolbar.toolbar-is-fixed {
  position: fixed !important;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.EasyMDEContainer .CodeMirror {
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  border: 1px solid #aaa9a0;
  min-height: 400px;
}
.editor-toolbar { border: 1px solid #aaa9a0; border-bottom: none; background: #e8e4dc; }
.editor-preview { font-family: Georgia, serif; font-size: 14px; line-height: 1.75; padding: 12px; }
.editor-preview pre { background: #0b0b14; color: #44ee66; padding: 10px; }

/* ── Admin footer ────────────────────────────────────────── */
.admin-footer {
  grid-area: footer;
  background: #1e3008;
  color: #607030;
  font-size: 10px;
  padding: 6px 14px;
  text-align: center;
}

/* ── Dashboard stats ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.stat-box {
  background: #fff;
  border: 1px solid #ccc8be;
  padding: 12px 14px;
  text-align: center;
}
.stat-box .number {
  font-size: 32px;
  font-weight: bold;
  color: #2e4a0a;
  font-family: "Courier New", monospace;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-box .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
}
