﻿/* admin.css â€“ enkel desktop-layout fÃ¶r UGC-adminsidan */

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #222;
  overflow: hidden;
}

/* Inloggningsvy */

.admin-login {
  max-width: 420px;
  margin: 40px auto;
  padding: 24px 24px 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.admin-login h1 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.admin-login p {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.admin-login-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 4px;
}

.admin-login-form input {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font: inherit;
}

.admin-login-form button {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.admin-login-form button:hover {
  background: #1d4ed8;
}

.admin-error {
  margin-top: 10px;
  min-height: 1.2em;
  color: #b91c1c;
  font-size: 0.9rem;
}

/* Appvy */

.admin-app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* vÃ¤nster | mitten | hÃ¶ger */
  align-items: center;
  padding: 10px 16px;
  background: #111827;
  color: #f9fafb;
  gap: 12px;
}

.admin-header-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.admin-header-center {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.admin-topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.admin-topnav-btn {
  display: inline-block;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #f9fafb;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
}

.admin-topnav-btn:hover {
  background: rgba(255,255,255,0.22);
}

.admin-topnav-btn.active {
  background: #f97316;
  color: #111827;
}

.admin-header-mapbtn {
  display: inline-block;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: #f97316;
  color: #111827;
  font: inherit;
  cursor: pointer;
}

.admin-header-mapbtn:hover {
  background: #ea580c;
}


.admin-user-label {
  opacity: 0.85;
}

.admin-header button {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: #f97316;
  color: #111827;
  font: inherit;
  cursor: pointer;
}

.admin-header button:hover {
  background: #ea580c;
}

.admin-main {
  flex: 1;
  display: flex;
  gap: 0;
  padding: 12px;
  min-height: 0;
  height: calc(100vh - 68px);
}

.admin-main.admin-main-split-even .admin-list,
.admin-main.admin-main-split-even .admin-details {
  flex: 1 1 0;
}

/* Listpanel vÃ¤nster */

.admin-list {
  flex: 1.4;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-right: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.admin-list h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.admin-status {
  min-height: 1.2em;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #4b5563;
}

.admin-status.error {
  color: #b91c1c;
}



.admin-bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}

.admin-bulk-actions button {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  font: inherit;
  cursor: pointer;
  background: #e5e7eb;
}

.admin-bulk-actions button:hover {
  background: #d1d5db;
}

.admin-bulk-actions button.danger {
  background: #b91c1c;
  color: #fff;
}

.admin-bulk-actions button.danger:hover {
  background: #991b1b;
}

.admin-bulk-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-bulk-info {
  font-size: 0.85rem;
  color: #6b7280;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  display: block;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 6px 6px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.admin-table th {
  font-weight: 600;
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-table tbody tr {
  cursor: pointer;
}

.admin-table tbody tr:hover {
  background: #f3f4f6;
}

.admin-table tbody tr.selected {
  background: #dbeafe;
}

.admin-table tbody tr.q1-null {
  background: #f3f4f6;
}

.admin-table tbody tr.q1-null:hover {
  background: #e5e7eb;
}

.admin-table tbody tr.q1-100 {
  background: #ecfdf3;
}

.admin-table tbody tr.q1-100:hover {
  background: #dcfce7;
}

.admin-table tbody tr.q1-0 {
  background: #fef2f2;
}

.admin-table tbody tr.q1-0:hover {
  background: #fee2e2;
}

.admin-table tbody tr.q1-mid {
  background: #fffbeb;
}

.admin-table tbody tr.q1-mid:hover {
  background: #fef3c7;
}

.admin-table tbody tr.len-risk {
  background: #fff1f2;
}

.admin-table tbody tr.len-risk:hover {
  background: #ffe4e6;
}

.len-cell {
  width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #6b7280;
}

.len-hint {
  width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

.admin-table td.actions {
  white-space: nowrap;
}

.admin-table button.small {
  padding: 3px 6px;
  border-radius: 4px;
  border: none;
  font-size: 0.78rem;
  cursor: pointer;
  background: #e5e7eb;
}

.admin-table button.small:hover {
  background: #d1d5db;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.admin-divider {
  width: 1px;
  height: 20px;
  background: #e5e7eb;
}

.admin-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.admin-input {
  width: 100%;
  min-width: 160px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.admin-input-readonly {
  background: #f3f4f6;
  color: #6b7280;
}

/* Detaljpanel hÃ¶ger */

.admin-details {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.admin-details h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.details-content {
  font-size: 0.9rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
}

.details-meta {
  margin-bottom: 8px;
}

.details-meta dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 8px;
  row-gap: 2px;
  margin: 0 0 8px;
}

.details-meta dt {
  font-weight: 600;
}

.details-meta dd {
  margin: 0;
}

.details-meta input,
.details-meta textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font: inherit;
}

.details-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.details-save-status {
  font-size: 0.85rem;
  color: #6b7280;
}


.details-stats {
  margin-bottom: 8px;
}

.details-stats ul {
  margin: 0;
  padding-left: 18px;
}

.details-comments {
  margin-top: 10px;
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
}

.details-comment {
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 0;
}

.details-comment:last-child {
  border-bottom: none;
}

.details-comment-header {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 2px;
}

.details-comment-text {
  font-size: 0.9rem;
}

/* Ã…tgÃ¤rdsknappar */

.details-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.details-improve-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 1 0 100%;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.details-improve-flags label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.admin-main.admin-main-split-even .admin-list .admin-table thead,
.admin-main.admin-main-split-even .admin-list .admin-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.admin-main.admin-main-split-even .admin-list .admin-table th:nth-child(4),
.admin-main.admin-main-split-even .admin-list .admin-table td:nth-child(4),
.admin-main.admin-main-split-even .admin-list .admin-table th:nth-child(5),
.admin-main.admin-main-split-even .admin-list .admin-table td:nth-child(5) {
  width: 56px;
  white-space: nowrap;
}

.admin-main.admin-main-split-even .admin-list .admin-table th:nth-child(6),
.admin-main.admin-main-split-even .admin-list .admin-table td:nth-child(6),
.admin-main.admin-main-split-even .admin-list .admin-table th:nth-child(7),
.admin-main.admin-main-split-even .admin-list .admin-table td:nth-child(7) {
  width: 44px;
  white-space: nowrap;
}

.admin-main.admin-main-split-even .admin-list .admin-table th:nth-child(8),
.admin-main.admin-main-split-even .admin-list .admin-table td:nth-child(8) {
  width: 84px;
  white-space: nowrap;
}

.admin-main.admin-main-split-even .admin-list .admin-table thead {
  width: calc(100% - 8px);
}

.admin-main.admin-main-split-even .admin-list .admin-table tbody {
  display: block;
  overflow-y: auto;
  max-height: calc(100vh - 215px);
}

.details-actions button {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  font: inherit;
  cursor: pointer;
  background: #e5e7eb;
}

.details-actions button:hover {
  background: #d1d5db;
}

.details-actions button.success {
  background: #86efac;
  color: #064e3b;
}

.details-actions button.success:hover {
  background: #6ee7b7;
}

.details-actions button.danger {
  background: #b91c1c;
  color: #fff;
}

.details-actions button.danger:hover {
  background: #991b1b;
}

.details-actions-hint {
  display: inline-flex;
  align-items: center;
  color: #6b7280;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Flikar fÃ¶r loggkategorier */

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-tab {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.8rem;
  cursor: pointer;
}

.admin-tab:hover {
  background: #e5e7eb;
}

.admin-tab-active {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}


/* Lite mobil-anpassning om du rÃ¥kar Ã¶ppna pÃ¥ telefon */
@media (max-width: 900px) {
  .admin-main {
    flex-direction: column;
  }

  .admin-list {
    margin-right: 0;
    margin-bottom: 8px;
  }

  .admin-details {
    margin-left: 0;
  }
}
.details-photo-wrapper {
  margin-bottom: 8px;
}

.details-photo {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}
.admin-input.dirty {
  outline: 2px solid #f2b800;
  outline-offset: 0;
}

tr.dirty {
  background: #fff7df;
}

