/* Laget av Aiobi@2026 */

:root {
  --navy: #17253a;
  --navy-light: #223452;
  --paper: #f3f1ea;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #6b7380;
  --line: #e2ded2;
  --accent: #2f6f5e;
  --amber: #b8620a;
  --amber-bg: #fbeadb;
  --green-bg: #e2f0e4;
  --green-ink: #2f6f4a;
  --red: #b3261e;
  --red-bg: #f7e2e0;
  --radius: 6px;
  font-family: "Iowan Old Style", "Georgia", "Charter", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

h1, h2 {
  font-family: "Iowan Old Style", "Georgia", "Charter", serif;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--navy);
  letter-spacing: -0.01em;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }

.muted { color: var(--muted); font-size: 0.9rem; margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--amber);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
}
.brand {
  font-family: "Iowan Old Style", "Georgia", serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff !important;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a {
  color: #cfd6e2 !important;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
}
.tabs a:hover { background: var(--navy-light); }
.tabs a.active { background: var(--navy-light); color: #fff !important; }
.user-area { display: flex; align-items: center; gap: 12px; font-size: 0.88rem; }
.user-name { color: #cfd6e2; }
.role-tag { color: #94a3b8; font-size: 0.76rem; border: 1px solid #3a4c6b; border-radius: 20px; padding: 1px 8px; margin-left: 4px; }
.logout-link { color: #cfd6e2 !important; }

/* Layout */
.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px 20px;
}
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* Forms */
label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin: 12px 0 4px 0; }
label:first-of-type { margin-top: 0; }
input[type=text], input[type=password], input[type=number], input[type=file], textarea, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.94rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.hint { font-size: 0.82rem; color: var(--muted); margin: 6px 0 0 0; }
.req { color: var(--amber); font-weight: 500; font-size: 0.78rem; }
.opt { color: var(--muted); font-weight: 400; font-size: 0.78rem; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--ink);
  margin: 10px 0;
}
.checkbox-row input { width: auto; }

.inline-form { display: flex; gap: 10px; align-items: flex-end; }
.inline-form input { flex: 1; }
.inline-form-wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form-wrap input, .inline-form-wrap select { width: auto; flex: 1; min-width: 140px; margin: 0; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input[type=text] { flex: 1; min-width: 200px; }
.filter-bar select { width: auto; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
}
.btn-primary { background: var(--navy); color: #fff !important; }
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink) !important; }
.btn-secondary:hover { background: var(--paper); }
.btn-link { background: none; border: none; color: var(--accent) !important; padding: 4px 0; font-weight: 500; text-decoration: underline; }
.btn-block { width: 100%; margin-top: 16px; }

/* Table */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--paper);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.data-table tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--paper); }
.empty-state { text-align: center; color: var(--muted); padding: 30px !important; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-green { background: var(--green-bg); color: var(--green-ink); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-grey { background: #e9e9e9; color: var(--muted); }
.badge-lg { font-size: 0.95rem; padding: 6px 16px; }

.signature { font-size: 0.9rem; margin-top: 10px; line-height: 1.5; }
.checklist-done { margin: 12px 0; padding-left: 18px; font-size: 0.88rem; color: var(--muted); }
.checklist-form { margin-top: 14px; }

.thumb {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-top: 10px;
  display: block;
}

/* Flash messages */
.flash-wrap { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 8px; }
.flash-success { background: var(--green-bg); color: var(--green-ink); }
.flash-error { background: var(--red-bg); color: var(--red); }

/* Login */
.login-wrap { display: flex; justify-content: center; padding-top: 60px; }
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 360px;
}
.login-card h1 { text-align: left; }

@media (max-width: 700px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .user-area { margin-left: auto; }
}
