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

:root {
  --sand:   #f5f3ee;
  --sand2:  #ece9e2;
  --sand3:  #ddd9d0;
  --ink:    #2c2c2a;
  --ink2:   #5a5955;
  --ink3:   #9a9891;
  --teal:   #2D7D6F;
  --teal2:  #235f55;
  --teal-l: #e8f4f1;
  --red:    #c0392b;
  --amber:  #d97706;
  --green:  #2e7d32;
  --border: rgba(44,44,42,0.12);
  --radius: 10px;
  --shadow: 0 2px 12px rgba(44,44,42,0.08);
}

html { font-size: 16px; }

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--ink);
  background: var(--sand);
  min-height: 100vh;
  line-height: 1.6;
}

/* --- Typography --- */
h1 { font-size: 1.75rem; font-weight: 400; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 400; }
h3 { font-size: 1rem; font-weight: 600; font-family: system-ui, sans-serif; }
p  { color: var(--ink2); }

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

/* --- Layout --- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo span {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-logo small {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.sidebar nav { flex: 1; padding: 12px 0; }

.nav-section {
  font-family: system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 20px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--teal); color: #fff; }

.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-link.active svg { opacity: 1; }

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .logout-link {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}
.sidebar-user .logout-link:hover { color: rgba(255,255,255,0.7); }

/* --- Main content --- */
.main { flex: 1; overflow: auto; }

.page-header {
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
}

.page-header-left h1 { color: var(--ink); }
.page-header-left p { font-size: 14px; margin-top: 4px; }

.page-body { padding: 32px 40px; max-width: 900px; }
.page-body-wide { padding: 32px 40px; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal2); text-decoration: none; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--sand); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink2);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--sand2); text-decoration: none; color: var(--ink); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a93226; text-decoration: none; color: #fff; }

.btn svg { width: 16px; height: 16px; }

/* --- Cards --- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.card + .card { margin-top: 16px; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--sand3);
  border-radius: 8px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45,125,111,0.1);
}

textarea { resize: vertical; min-height: 180px; line-height: 1.6; }

.form-hint {
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--ink3);
  margin-top: 4px;
}

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* --- Meeting card --- */
.meeting-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.15s;
}

.meeting-card:hover { box-shadow: var(--shadow); text-decoration: none; }

.meeting-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.meeting-card-body { flex: 1; min-width: 0; }
.meeting-card-title {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  font-family: system-ui, sans-serif;
}

.meeting-card-meta {
  font-size: 12px;
  color: var(--ink3);
  font-family: system-ui, sans-serif;
  margin-top: 2px;
}

/* --- Action items --- */
.action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background 0.1s;
}

.action-item:hover { background: var(--sand); }

.action-item.done .action-desc { text-decoration: line-through; color: var(--ink3); }

.action-checkbox {
  width: 18px; height: 18px;
  border: 2px solid var(--sand3);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.action-checkbox.checked { background: var(--teal); border-color: var(--teal); }
.action-checkbox.checked::after { content: ''; display: block; width: 10px; height: 7px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px,-1px); }

.action-desc { flex: 1; font-size: 14px; font-family: system-ui, sans-serif; }

.action-meta {
  font-size: 12px;
  color: var(--ink3);
  font-family: system-ui, sans-serif;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
}

.badge-open   { background: #fef3c7; color: #92400e; }
.badge-done   { background: #d1fae5; color: #065f46; }
.badge-count  { background: var(--teal-l); color: var(--teal2); }

/* --- Project color pill --- */
.project-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--ink2);
}

/* --- Login page --- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sand);
  padding: 24px;
}

.login-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

.login-box h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-box p { font-size: 14px; margin-bottom: 28px; }

/* --- Flash messages --- */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  margin-bottom: 20px;
}

.flash-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-info    { background: var(--teal-l); color: var(--teal2); border: 1px solid #a7f3d0; }

/* --- Meeting view (formatted notes) --- */
.meeting-notes {
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}

.meeting-notes h1 { font-size: 1.4rem; margin: 0 0 20px; }
.meeting-notes h2 { font-size: 1.1rem; margin: 24px 0 10px; color: var(--ink); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.meeting-notes p  { margin: 0 0 12px; }
.meeting-notes ul, .meeting-notes ol { margin: 0 0 12px 20px; }
.meeting-notes li { margin-bottom: 4px; }
.meeting-notes strong { color: var(--ink); }
.meeting-notes hr  { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* --- Stat cards --- */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  font-family: Georgia, serif;
}

.stat-label {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink3);
  margin-top: 6px;
}

/* --- AI loading state --- */
.ai-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--teal-l);
  border-radius: 8px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: var(--teal2);
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--teal-l);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* --- Empty state --- */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink3);
  font-family: system-ui, sans-serif;
  font-size: 14px;
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* --- Source tabs (new meeting) --- */
.source-tab {
  padding: 7px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.source-tab:hover  { background: rgba(255,255,255,0.7); color: var(--ink); }
.source-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* --- Utility --- */
.hidden { display: none !important; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .page-header { padding: 20px 20px 16px; flex-direction: column; }
  .page-body, .page-body-wide { padding: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- Color palette for projects --- */
.color-swatch {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s;
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--ink); }

/* Drag-and-drop todo sorting */
.drag-handle {
  cursor: grab;
  color: var(--ink3);
  padding: 0 6px;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  opacity: 0.3;
  transition: opacity 0.15s;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.action-item:hover .drag-handle { opacity: 0.8; }
.drag-ghost { opacity: 0.4 !important; background: var(--sand2) !important; border-radius: var(--radius); }

/* Større klikflade på checkboxes i todo-lister */
.action-checkbox {
  min-width: 24px;
  min-height: 24px;
  padding: 4px;
}
