:root {
  --red: #c8102e;
  --deep: #111827;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #d7dde5;
  --surface: #ffffff;
  --soft: #f4f6f8;
  --green: #047857;
  --amber: #b45309;
  --blue: #1d4ed8;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef1f4;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: var(--deep);
  color: white;
  border-bottom: 4px solid var(--red);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: white;
  font-weight: 800;
}

.logo-img {
  display: block;
  object-fit: contain;
}

.logo-img.compact {
  width: 82px;
  height: 82px;
  border-radius: 8px;
}

.logo-img.hero {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  margin: 0;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
}

.brand p {
  margin: 2px 0 0;
  color: #d1d5db;
  font-size: 13px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-display {
  font-weight: 700;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 22px 42px;
}

.login-wrap {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 44vw) minmax(380px, 1fr);
  background: #eef1f4;
  overflow: hidden;
}

.login-panel {
  height: 100vh;
  padding: 0;
  background: var(--deep);
  overflow: hidden;
}

.login-panel h1 {
  font-size: 52px;
  margin: 0 0 12px;
}

.login-panel p {
  color: #d1d5db;
  line-height: 1.5;
  max-width: 340px;
}

.login-card {
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100% - 32px));
  background: white;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}

.login-card h2,
.section-head h2,
.panel h2 {
  margin: 0;
  font-size: 22px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
}

.check-field input {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.import-textarea {
  min-height: 220px;
  font-family: Consolas, "Courier New", monospace;
}

.btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--deep);
  color: white;
  font-weight: 700;
}

.btn.secondary {
  background: #e5e7eb;
  color: var(--deep);
}

.btn.red {
  background: var(--red);
}

.btn.green {
  background: var(--green);
}

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

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

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

.tab {
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 13px;
  background: #dde3ea;
  color: var(--deep);
  font-weight: 700;
}

.tab.active {
  background: var(--red);
  color: white;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.filter-chip {
  min-height: 34px;
  border-radius: 6px;
  padding: 7px 11px;
  background: white;
  color: var(--deep);
  border: 1px solid var(--line);
  font-weight: 700;
}

.filter-chip.active {
  background: var(--deep);
  color: white;
  border-color: var(--deep);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head p,
.panel-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.event-section {
  margin-top: 18px;
}

.event-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.event-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.event-section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.event-card {
  min-height: 292px;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.07);
}

.event-card:hover {
  border-color: var(--red);
}

.event-card.featured {
  border-color: #f59e0b;
}

.event-card.tier-small {
  border-color: #2563eb;
}

.event-card.archived {
  opacity: 0.72;
}

.event-card.archived .event-band {
  background: #4b5563;
}

.event-band {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 15px;
  color: white;
  background: var(--deep);
}

.event-card.featured .event-band {
  background: #7f1d1d;
}

.event-card.tier-small .event-band {
  background: #1d4ed8;
}

.event-band .type {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-body {
  padding: 15px;
  display: grid;
  gap: 13px;
  flex: 1;
}

.event-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.event-meta,
.price {
  color: var(--muted);
  font-size: 14px;
}

.price strong {
  color: var(--ink);
  font-size: 18px;
}

.admin-total,
.summary-money {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.admin-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
}

.admin-total span,
.summary-money span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-total strong,
.summary-money strong {
  color: var(--ink);
}

.summary-money {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.summary-money div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  min-height: 58px;
  background: var(--soft);
}

.stat b {
  display: block;
  font-size: 20px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-block {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-block h3 {
  margin: 0;
  font-size: 18px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-number {
  width: 76px;
  min-width: 76px;
  padding: 7px 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #e5e7eb;
  color: var(--deep);
}

.badge.forespurt {
  background: #fef3c7;
  color: var(--amber);
}

.badge.reservert {
  background: #dbeafe;
  color: var(--blue);
}

.badge.betalt {
  background: #d1fae5;
  color: var(--green);
}

.badge.avslatt,
.badge.kansellert {
  background: #fee2e2;
  color: var(--danger);
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.54);
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 20;
}

.drawer.open {
  display: flex;
}

.drawer-panel {
  width: min(520px, 100%);
  background: white;
  padding: 22px;
  overflow-y: auto;
}

.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.message {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 6px;
  background: #ecfdf5;
  color: var(--green);
}

.error {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 6px;
  background: #fee2e2;
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
}

@media (max-width: 760px) {
  .login-wrap {
    display: block;
    height: auto;
    min-height: 100vh;
    background: #eef1f4;
    overflow: visible;
  }

  .login-panel {
    min-height: 42vh;
    padding: 0;
    background: var(--deep);
  }

  .logo-img.hero {
    width: 100%;
    height: 42vh;
  }

  .login-panel h1 {
    font-size: 40px;
  }

  .login-card {
    margin: 18px auto;
  }

  .topbar-inner,
  .section-head,
  .split {
    display: block;
  }

  .topbar-inner {
    padding: 14px 16px;
  }

  .brand {
    gap: 12px;
  }

  .logo-img.compact {
    width: 58px;
    height: 58px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .brand p {
    font-size: 12px;
  }

  .userbar {
    justify-content: space-between;
    margin-top: 12px;
    gap: 10px;
  }

  .role-display {
    max-width: calc(100% - 96px);
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
}
