@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:       #080808;
  --card-bg:  #141414;
  --border:   #242424;
  --accent:   #FF5E00;
  --text:     #F0F0F0;
  --muted:    #909090;
  --sidebar-w: 220px;

  --font-display: 'Bebas Neue', sans-serif;
  --font-ui:      'Barlow', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
  width: 120px;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  list-style: none;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.sidebar-nav li a:hover {
  color: var(--text);
  background: rgba(255, 94, 0, 0.06);
}

.sidebar-nav li a.active {
  color: var(--text);
  border-left-color: var(--accent);
  background: rgba(255, 94, 0, 0.08);
}

.sidebar-nav li a .nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ── Main content ────────────────────────── */

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--text);
}

.content {
  flex: 1;
  padding: 40px 32px;
}

/* ── Cards ───────────────────────────────── */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin-bottom: 16px;
}

/* ── Status badge ────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 2px;
  background: rgba(255, 94, 0, 0.12);
  color: var(--accent);
  border: 1px solid rgba(255, 94, 0, 0.25);
}

.badge.green {
  background: rgba(0, 200, 100, 0.1);
  color: #00c864;
  border-color: rgba(0, 200, 100, 0.2);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Footer ──────────────────────────────── */

.site-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* ── Login ───────────────────────────────── */

.login-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-wrap {
  width: 100%;
  max-width: 380px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 36px 32px;
}

.login-logo {
  margin-bottom: 28px;
}

.login-logo img {
  width: 130px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.login-error {
  font-size: 13px;
  color: #ff4444;
  background: rgba(255, 68, 68, 0.08);
  border: 1px solid rgba(255, 68, 68, 0.25);
  border-radius: 3px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--accent);
}

.btn-login {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-login:hover {
  opacity: 0.88;
}

.login-footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ── User info in nav ────────────────────── */

.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
}

.sidebar-logout:hover {
  color: var(--accent);
}

/* ── Under construction ──────────────────── */

.construction-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 560px;
}

.construction-wrap h2 {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--text);
}

.construction-wrap h2 span {
  color: var(--accent);
}

.construction-wrap p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.db-result {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* ── Buttons ─────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:hover {
  color: var(--text);
  border-color: #444;
}

.btn-primary {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ── Document grid ───────────────────────── */

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.doc-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}

.doc-card:hover {
  border-color: #333;
}

.doc-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.doc-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1.2;
  flex: 1;
}

.doc-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.doc-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ── Version badge ───────────────────────── */

.version-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 8px;
}

/* ── Breadcrumb ──────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover { color: var(--text); }

.breadcrumb-sep { opacity: 0.35; }

/* ── Page header ─────────────────────────── */

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

.page-header h2 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1.1;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 6px;
}

/* ── Document view ───────────────────────── */

.doc-view {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 32px;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  min-height: 200px;
  word-break: break-word;
}

.doc-view-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ── Edit form ───────────────────────────── */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-group label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-group input[type="text"] {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field-group input[type="text"]:focus {
  border-color: var(--accent);
}

.textarea-doc {
  width: 100%;
  min-height: 480px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.textarea-doc:focus { border-color: var(--accent); }

.edit-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

/* ── Alerts ──────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.5;
}

.alert-warning {
  background: rgba(255, 180, 0, 0.07);
  border-color: rgba(255, 180, 0, 0.3);
  color: #ffb400;
}

.alert-success {
  background: rgba(0, 200, 100, 0.07);
  border-color: rgba(0, 200, 100, 0.25);
  color: #00c864;
}

.alert strong { font-weight: 600; }

/* ── Empty state ─────────────────────────── */

.empty-state {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty-state a {
  color: var(--accent);
  text-decoration: none;
}

/* ── History list ────────────────────────── */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card-bg);
  gap: 12px;
}

.history-item-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.history-item-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.history-toggle-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.history-toggle-btn:hover {
  color: var(--text);
  border-color: #444;
}

.history-item-content {
  display: none;
  padding: 20px 18px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  word-break: break-word;
}

.history-item.open .history-item-content {
  display: block;
}

/* ── New document form ───────────────────── */

.new-doc-form {
  max-width: 720px;
}

/* ── Dashboard ───────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 4px;
  padding: 20px 24px;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-dot--document_created {
  background: #00c864;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.dash-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.quicklinks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quicklink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.quicklink:hover {
  color: var(--text);
  border-color: #333;
  background: rgba(255, 255, 255, 0.02);
}

.quicklink-icon {
  width: 15px;
  height: 15px;
  opacity: 0.55;
  flex-shrink: 0;
}

/* ── Filer & Mediegalleri ────────────────── */

.files-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.files-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.files-tab:hover {
  color: var(--text);
}

.files-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.files-tab-count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 6px;
  color: var(--muted);
}

.files-tab.active .files-tab-count {
  background: rgba(255, 94, 0, 0.12);
  border-color: rgba(255, 94, 0, 0.25);
  color: var(--accent);
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.file-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}

.file-card:hover {
  border-color: #383838;
}

.file-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg);
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.file-card:hover .file-thumb img {
  opacity: 0.88;
}

.file-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.file-thumb-icon {
  width: 36px;
  height: 36px;
  opacity: 0.35;
}

.file-type-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(255, 94, 0, 0.12);
  border: 1px solid rgba(255, 94, 0, 0.25);
  color: var(--accent);
}

.file-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid var(--border);
}

.file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ── Utility ─────────────────────────────── */

.hidden { display: none !important; }

/* ── Kanban layout ───────────────────────── */

.content--board {
  padding: 20px 28px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 28px;
  align-items: flex-start;
  flex: 1;
}

.kanban-board::-webkit-scrollbar { height: 5px; }
.kanban-board::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Kanban column ───────────────────────── */

.kanban-col {
  width: 278px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.kanban-col-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  min-width: 0;
}

.kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-col-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.kanban-col-actions { display: flex; gap: 2px; }

.kanban-col-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.kanban-col-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.kanban-col-delete-btn:hover { color: #ff4444 !important; }

.kanban-col-body {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 72px;
  transition: background 0.1s;
}
.kanban-col-body.drag-over { background: rgba(255, 94, 0, 0.05); }

.kanban-col-footer {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
}

.kanban-add-card-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.kanban-add-card-btn:hover { color: var(--text); border-color: #444; }

/* ── Kanban card ─────────────────────────── */

.k-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 11px 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.k-card:hover { border-color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.k-card.dragging { opacity: 0.4; }

.k-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 2px;
  align-self: flex-start;
}

.k-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.k-card-subtitle {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.k-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.k-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
}

.k-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.k-due {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}
.k-due.overdue { color: #ff4444; }

/* ── Add column area ─────────────────────── */

.kanban-add-col { width: 230px; flex-shrink: 0; }

.kanban-add-col-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.kanban-add-col-btn:hover { color: var(--text); border-color: #444; background: rgba(255,255,255,0.03); }

.kanban-col-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-col-form input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.kanban-col-form input[type="text"]:focus { border-color: var(--accent); }

.kanban-col-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kanban-col-form input[type="color"] {
  width: 36px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}

.kanban-col-form-actions { display: flex; gap: 6px; }

/* ── Modal ───────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.68);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 40px;
  overflow-y: auto;
}

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 22px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-field input[type="text"],
.modal-field input[type="date"],
.modal-field select,
.modal-field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus { border-color: var(--accent); }

.modal-field select { cursor: pointer; }

.modal-field textarea {
  min-height: 108px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.modal-field select option { background: var(--card-bg); }

.modal-field-row { display: flex; gap: 12px; }
.modal-field-row .modal-field { flex: 1; min-width: 0; }

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-save-feedback {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #00c864;
}

/* ── New tag inline form ─────────────────── */

.new-tag-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.new-tag-form input[type="text"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  min-width: 0;
  transition: border-color 0.15s;
}
.new-tag-form input[type="text"]:focus { border-color: var(--accent); }

.new-tag-form input[type="color"] {
  width: 32px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  cursor: pointer;
  padding: 1px;
  flex-shrink: 0;
}
