/* ============================================================
   CSS-Variablen & Reset
   ============================================================ */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --sidebar-w: 220px;
  --sidebar-bg: #1e3a5f;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(37,99,235,0.35);
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg-main: #f3f4f6;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --topbar-h: 56px;
  --transition: 0.2s ease;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.login-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: left;
}

/* ============================================================
   FORMS (shared)
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  text-align: left;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), transform 0.1s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); }

.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f9fafb; }

.btn-danger { background: #ef4444; color: var(--white); }
.btn-danger:hover { background: #dc2626; }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 200;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand {
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.hamburger {
  color: rgba(255,255,255,0.7);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.hamburger:hover { background: var(--sidebar-hover); color: var(--white); }
.hamburger-top { color: var(--text); display: none; }
.hamburger-top:hover { background: var(--border); color: var(--text); }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--white); }
.nav-item.active { background: var(--sidebar-active); color: var(--white); }

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}

.nav-label { flex: 1; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { color: var(--white); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,0.5); font-size: 11px; margin-top: 1px; }

.logout-btn { width: 100%; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

/* ============================================================
   APP BODY & TOPBAR
   ============================================================ */
.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

#main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px;
  background: var(--bg-main);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

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

/* ============================================================
   SECTION & CARDS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--blue-light); }

td {
  padding: 12px 14px;
  vertical-align: middle;
  color: var(--text);
}

.td-muted { color: var(--text-muted); }
.td-bold { font-weight: 600; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Status-Badges */
.badge-neu { background: #dbeafe; color: #1d4ed8; }
.badge-in_bearbeitung { background: #fed7aa; color: #c2410c; }
.badge-abgeschlossen { background: #d1fae5; color: #065f46; }
.badge-wartend { background: #e0e7ff; color: #4338ca; }
.badge-storniert { background: #fee2e2; color: #991b1b; }

/* Prioritäts-Badges */
.badge-hoch { background: #fee2e2; color: #dc2626; }
.badge-mittel { background: #fef9c3; color: #92400e; }
.badge-niedrig { background: #f0fdf4; color: #15803d; }

/* Rollen-Badges */
.badge-admin { background: #ede9fe; color: #6d28d9; }
.badge-mitarbeiter { background: #e0f2fe; color: #0369a1; }
.badge-viewer { background: #f3f4f6; color: #6b7280; }

/* ============================================================
   TOOLBAR / FILTER BAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-input {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  padding: 8px 12px 8px 36px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
  outline: none;
  transition: border-color var(--transition);
  font-size: 13px;
}
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.filter-select {
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--blue); }

/* ============================================================
   CUSTOMER DETAIL (zweispaltig)
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.detail-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}

.detail-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}
.detail-field:last-child { margin-bottom: 0; }

.detail-field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-field-value {
  font-size: 14px;
  color: var(--text);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  cursor: pointer;
  transition: color var(--transition);
}
.detail-back:hover { color: var(--blue); }

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

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

/* ============================================================
   TRELLO BOARD
   ============================================================ */
.board-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
  min-height: calc(100vh - var(--topbar-h) - 80px);
}

.board-column {
  min-width: 270px;
  max-width: 270px;
  background: #eaecf0;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 80px);
}

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  flex-shrink: 0;
}

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

.column-title {
  flex: 1;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.column-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0,0,0,0.08);
  padding: 2px 7px;
  border-radius: 999px;
}

.column-delete {
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition);
  padding: 2px 4px;
  border-radius: 4px;
}
.board-column:hover .column-delete { opacity: 1; }
.column-delete:hover { background: #fee2e2; color: #dc2626; }

.column-cards {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

.column-cards.drag-over {
  background: rgba(37,99,235,0.06);
  border-radius: var(--radius);
}

.task-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px 13px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform 0.15s;
  border: 1px solid transparent;
  user-select: none;
}
.task-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.task-card.dragging { opacity: 0.5; border: 1px dashed var(--blue); }
.task-card.drag-over-card { border-top: 2px solid var(--blue); }

.task-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-due {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.task-due.overdue { color: #dc2626; }

.task-assignee {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.column-add-btn {
  margin: 0 10px 10px;
  padding: 8px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.column-add-btn:hover { background: rgba(0,0,0,0.06); color: var(--text); }

.board-add-column {
  min-width: 220px;
  max-width: 220px;
  background: rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  height: fit-content;
  border: 2px dashed rgba(0,0,0,0.12);
}
.board-add-column:hover { background: rgba(37,99,235,0.06); color: var(--blue); border-color: var(--blue); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-window {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: #f3f4f6; color: var(--text); }

#modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ============================================================
   TEAM LIST
   ============================================================ */
.team-member-row td:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.member-name { font-weight: 600; }
.member-email { font-size: 12px; color: var(--text-muted); }

/* Deaktiviertes Mitglied */
.member-inactive { opacity: 0.5; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p { font-size: 14px; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1f2937;
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  max-width: 320px;
  line-height: 1.4;
}

.toast.toast-success { background: #065f46; }
.toast.toast-error { background: #991b1b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ============================================================
   PAGE HEADERS
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

/* ============================================================
   NOTES TEXTAREA (Kundendetail)
   ============================================================ */
.notes-area {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13.5px;
  resize: vertical;
  min-height: 100px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.notes-area:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.notes-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ============================================================
   COLOR PICKER (Spaltenfarbe)
   ============================================================ */
.color-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.color-dot-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.color-dot-btn.selected { border-color: var(--text); transform: scale(1.15); }
.color-dot-btn:hover { transform: scale(1.1); }

/* ============================================================
   RESPONSIVE — Mobile (< 768px)
   ============================================================ */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 300;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
  }
  .sidebar-overlay.active {
    display: block;
    pointer-events: all;
  }

  .hamburger-top {
    display: flex;
  }

  #main {
    padding: 16px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-window {
    max-width: 100%;
    max-height: 95vh;
  }

  .topbar {
    padding: 0 16px;
  }
}

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

/* Boards Grid */
.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.board-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow var(--transition), transform 0.15s;
}
.board-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.board-card-header {
  padding: 20px 16px 16px;
  min-height: 80px;
  display: flex;
  align-items: flex-end;
}
.board-card-name {
  color: white;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.board-card-body { padding: 12px 16px; }
.board-card-meta { font-size: 12px; color: var(--text-muted); }
.column-header.drag-handle { cursor: grab; }
.column-header.drag-handle:active { cursor: grabbing; }
.board-column.col-dragging { opacity: 0.4; }
.board-column.col-drag-over { outline: 2px solid var(--blue); outline-offset: 2px; }
