/* =========================================================
   ATN Workspace — Design System
   ========================================================= */
:root {
  --bg: #0F172A;
  --card: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(255, 255, 255, 0.14);
  --primary: #4F46E5;
  --accent: #06B6D4;
  --success: #22C55E;
  --warning: #FACC15;
  --danger: #EF4444;
  --purple: #A855F7;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --radius: 18px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  --font-main: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(120deg, var(--primary), var(--accent), var(--purple), var(--primary));
  background-size: 400% 400%;
  animation: gradientShift 18s ease infinite;
  opacity: 0.35;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.glass {
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.35);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #07120a; }
.btn-warning { background: var(--warning); color: #1e1a05; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

/* Forms */
input, textarea, select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border 0.2s, background 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.14);
}
input::placeholder, textarea::placeholder {
  color: var(--muted);
}
select option { color: #0F172A; }

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}

.hidden { display: none !important; }

/* Auth page */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-page {
  width: 100%;
  max-width: 460px;
}

.auth-card {
  padding: 40px 36px;
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  text-align: center;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 6px 0 22px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--primary);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 16px;
  color: var(--muted);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.oauth-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.oauth-btn {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}
.oauth-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.auth-error {
  text-align: center;
  color: #ffcccc;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 10px;
  font-size: 0.85rem;
  margin-top: 14px;
}
.auth-error:empty { display: none; }

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 20px;
}
.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* App shell */
.app-shell {
  min-height: 100vh;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.16); }

.nav-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  padding: 3px 7px;
  border-radius: 50px;
  font-weight: 700;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
}

.app-body {
  display: flex;
  min-height: calc(100vh - 66px);
}

.sidebar {
  width: 260px;
  padding: 20px 14px;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 66px;
  height: calc(100vh - 66px);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}
.sidebar-item i {
  width: 20px;
  text-align: center;
}
.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.sidebar-item.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.3);
}

.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.view {
  display: none;
  animation: fadeUp 0.3s ease;
}
.view.active { display: block; }

/* Dashboard */
.dash-greeting {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.dash-subtitle {
  color: var(--muted);
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, background 0.2s;
}
.stat-card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.stat-icon.blue { background: rgba(79, 70, 229, 0.25); color: var(--accent); }
.stat-icon.green { background: rgba(34, 197, 94, 0.25); color: var(--success); }
.stat-icon.yellow { background: rgba(250, 204, 21, 0.25); color: var(--warning); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.25); color: var(--purple); }

.stat-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
}
.stat-info p {
  color: var(--muted);
  font-size: 0.8rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.panel {
  padding: 22px;
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel h2 .panel-action {
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
}

.chart-wrapper {
  height: 260px;
  position: relative;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-text { font-size: 0.85rem; }
.activity-time { color: var(--muted); font-size: 0.75rem; }

.small-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.small-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
}
.small-list-item .date {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Notes */
.notes-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 160px);
}

.note-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.note-list-panel .panel-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.note-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.note-list-item {
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
  margin-bottom: 8px;
}
.note-list-item:hover { background: rgba(255, 255, 255, 0.08); }
.note-list-item.active {
  background: rgba(79, 70, 229, 0.2);
  border-color: var(--primary);
}
.note-list-item h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-list-item p {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-list-item .delete-note {
  float: right;
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.editor-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}
.editor-toolbar-actions .btn { padding: 8px 14px; font-size: 0.8rem; }

#editor-container {
  flex: 1;
  overflow-y: auto;
  min-height: 300px;
}
.ql-editor {
  min-height: 300px;
  font-size: 1rem;
}
.ql-toolbar { border-radius: 0 !important; }
.ql-container { border-radius: 0 !important; border-bottom: none !important; }

.editor-meta {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 0.8rem;
}

.editor-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  border-radius: 0;
}
.editor-fullscreen .ql-toolbar,
.editor-fullscreen #editor-container {
  width: 100%;
}

.emoji-picker {
  position: absolute;
  right: 10px;
  top: 50px;
  z-index: 1000;
}

/* Tasks */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.board-header h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.Tasks-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}

.Tasks-column {
  min-width: 300px;
  max-width: 340px;
  flex-shrink: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
  transition: border-color 0.2s;
}

.column-handle {
  cursor: grab;
  opacity: 0.6;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 6px;
}

.column-title {
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-count {
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
}

.column-actions {
  display: flex;
  gap: 4px;
}
.column-actions button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.column-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.tasks-container {
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px;
}

.task-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px;
  cursor: grab;
  transition: transform 0.15s, background 0.2s;
  animation: fadeUp 0.2s ease;
}
.task-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}
.task-card.dragging { opacity: 0.6; }

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.task-title {
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-word;
}

.priority-tag {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.priority-high { background: rgba(239, 68, 68, 0.3); color: #ffb3b3; }
.priority-medium { background: rgba(250, 204, 21, 0.25); color: #ffe98a; }
.priority-low { background: rgba(34, 197, 94, 0.25); color: #9dffc0; }

.task-desc {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-labels {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.task-label {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
}

.task-checklist {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.task-actions {
  display: flex;
  gap: 4px;
}
.task-actions button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
}
.task-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.task-actions .complete-btn:hover { color: var(--success); }
.task-actions .delete-btn:hover { color: var(--danger); }

.add-column-btn {
  min-width: 280px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}
.add-column-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(6, 182, 212, 0.08);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #1E293B;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s;
}
.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* Make the values typed/selected inside modal forms (column name, task
   column picker, etc.) stand out clearly instead of blending into the box. */
.modal-form input,
.modal-form select {
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.modal-form select option {
  font-weight: 600;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.export-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s;
}
.export-item:hover {
  background: rgba(79, 70, 229, 0.2);
  border-color: var(--primary);
}
.export-item i {
  font-size: 1.4rem;
  color: var(--accent);
}
.export-item span { font-weight: 600; font-size: 0.9rem; }

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Share page */
.share-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.share-card {
  max-width: 760px;
  width: 100%;
  padding: 28px;
}
.share-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.share-content { line-height: 1.7; }
.share-content h1 {
  font-family: var(--font-display);
  margin-bottom: 12px;
}
.skeleton {
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 12px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Responsive */
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: 220px 1fr; }
  .sidebar { width: 220px; }
}

@media (max-width: 768px) {
  .app-body { flex-direction: column; }
  .sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    overflow-x: auto;
    height: auto;
    padding: 10px;
  }
  .sidebar-item { width: auto; white-space: nowrap; }
  .main-content { padding: 16px; }
  .notes-layout { grid-template-columns: 1fr; }
  .note-list-panel { display: block; height: 220px; }
  .stats-grid { grid-template-columns: 1fr; }
  .Tasks-column { min-width: 270px; }
  .form-row { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
}