/* Custom CSS for Notion Daily Plan & Diary Dashboard */

:root {
  --bg-color: #090a0f;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #090a0f 70%);
  --sidebar-bg: rgba(13, 15, 24, 0.85);
  --card-bg: rgba(18, 22, 36, 0.6);
  --card-border: 1px solid rgba(255, 255, 255, 0.08);
  --card-hover-border: 1px solid rgba(99, 102, 241, 0.3);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --color-primary: #6366f1; /* Indigo */
  --color-primary-glow: rgba(99, 102, 241, 0.4);
  --color-secondary: #a855f7; /* Purple */
  --color-secondary-glow: rgba(168, 85, 247, 0.4);
  --color-accent: #06b6d4; /* Cyan */
  --color-success: #10b981; /* Emerald */
  --color-warning: #eab308; /* Yellow */
  --color-danger: #f43f5e; /* Coral/Red */
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

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

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  border-right: var(--card-border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.brand-logo i {
  color: white;
  font-size: 1.2rem;
}

.brand-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #ffffff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-normal);
  border: 1px solid transparent;
}

.menu-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
  color: white;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.05);
}

.menu-item i {
  font-size: 1.1rem;
}

.sidebar-footer {
  margin-top: auto;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.connection-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.connection-status.connected .status-dot {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

/* Main Workspace */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 32px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 20px;
}

.header h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.5px;
}

.header-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-bar {
  position: relative;
  width: 260px;
}

.search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-bar input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: var(--card-border);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px 10px 38px;
  color: white;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-bar input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
}

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

.btn-primary:hover {
  background: #4f46e5;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: var(--card-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #ff6b8b;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-glow {
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.btn-glow:hover {
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
}

/* Viewport & Tabs */
.tab-viewport {
  flex: 1;
  position: relative;
}

.tab-content {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.tab-content.active {
  display: block;
}

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

/* Glassmorphism Generic Card */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: var(--card-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--card-shadow);
}

/* 1. OVERVIEW TAB STYLING */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  transition: var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-header i {
  font-size: 1.2rem;
}

.icon-plans { color: var(--color-primary); }
.icon-progress { color: var(--color-accent); }
.icon-completed { color: var(--color-success); }
.icon-diaries { color: var(--color-secondary); }

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-top: 12px;
  margin-bottom: 8px;
}

.stat-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--color-primary), var(--color-success));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.overview-card {
  display: flex;
  flex-direction: column;
  max-height: 480px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-all-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.view-all-link:hover {
  color: #818cf8;
}

.card-body {
  padding: 16px 24px;
  flex: 1;
}

.scrollable {
  overflow-y: auto;
}

/* Today's Plans List Styling */
.plans-list-simple, .diaries-list-simple {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-item-row, .diary-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: var(--transition-fast);
  cursor: pointer;
}

.plan-item-row:hover, .diary-item-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.plan-item-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.plan-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.plan-checkbox.completed {
  border-color: var(--color-success);
  background: var(--color-success);
  color: white;
}

.plan-checkbox i {
  font-size: 0.6rem;
  display: none;
}

.plan-checkbox.completed i {
  display: block;
}

.plan-text-info {
  display: flex;
  flex-direction: column;
}

.plan-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.plan-title.line-through {
  text-decoration: line-through;
  color: var(--text-muted);
}

.plan-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.plan-priority-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.priority-high { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.priority-medium { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.priority-low { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.priority-none { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* Diary Item Row Overview */
.diary-item-left {
  display: flex;
  flex-direction: column;
}

.diary-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.diary-item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.diary-item-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Loading spinner utility */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Helper Colors */
.text-indigo { color: var(--color-primary); }
.text-purple { color: var(--color-secondary); }

/* 2. PLANS TAB STYLING */
.filter-bar {
  display: flex;
  padding: 16px 24px;
  margin-bottom: 24px;
  gap: 24px;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.filter-group label {
  font-weight: 600;
  color: var(--text-muted);
}

.filter-select {
  background: rgba(255, 255, 255, 0.05);
  border: var(--card-border);
  border-radius: var(--border-radius-sm);
  padding: 6px 12px;
  color: white;
  outline: none;
  font-size: 0.85rem;
}

.filter-select option {
  background: var(--bg-color);
}

.view-mode-toggle {
  display: flex;
  gap: 4px;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--border-radius-sm);
  border: var(--card-border);
}

.btn-toggle {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-toggle:hover {
  color: var(--text-main);
}

.btn-toggle.active {
  background: var(--color-primary);
  color: white;
}

/* Kanban Board Layout */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  flex: 1;
  min-height: 500px;
}

.kanban-column {
  display: flex;
  flex-direction: column;
  background: rgba(13, 15, 24, 0.4);
  border: var(--card-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.column-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.not-started { background: #60a5fa; box-shadow: 0 0 8px #60a5fa; }
.status-indicator.in-progress { background: #94a3b8; box-shadow: 0 0 8px #94a3b8; }
.status-indicator.completed { background: #b45309; box-shadow: 0 0 8px #b45309; }
.status-indicator.expired { background: #f87171; box-shadow: 0 0 8px #f87171; }

.column-count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 10px;
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 300px;
}

/* Kanban Cards */
.kanban-card {
  padding: 16px;
  transition: var(--transition-normal);
  cursor: pointer;
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(99, 102, 241, 0.1);
}

.card-priority-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-meta-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.card-relation-badge {
  align-self: flex-start;
  margin-top: 10px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* List View Table Styling */
.plans-list-view {
  width: 100%;
  overflow-x: auto;
}

.plans-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.plans-table th, .plans-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.plans-table th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plans-table td {
  font-size: 0.9rem;
}

.plans-table tbody tr {
  transition: var(--transition-fast);
  cursor: pointer;
}

.plans-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.not-started { background: rgba(96, 165, 250, 0.15); color: #93c5fd; }
.status-badge.in-progress { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.status-badge.completed { background: rgba(180, 83, 9, 0.15); color: #f59e0b; }
.status-badge.expired { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }

.hidden {
  display: none !important;
}

/* 3. DIARIES TAB TIMELINE */
.diary-timeline-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
  opacity: 0.3;
}

.timeline-entry {
  position: relative;
  margin-bottom: 40px;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 3px solid var(--color-secondary);
  box-shadow: 0 0 10px var(--color-secondary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.timeline-dot i {
  font-size: 0.7rem;
  color: var(--color-secondary);
}

.timeline-card {
  padding: 24px;
  transition: var(--transition-normal);
  cursor: pointer;
}

.timeline-card:hover {
  transform: translateX(4px);
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(168, 85, 247, 0.1);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-section-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.015);
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  border-left: 2px solid var(--color-secondary);
}

.timeline-section-content.reflection {
  border-left-color: var(--color-accent);
}

.timeline-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.timeline-relation-tag {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ================= MODALS STYLING ================= */
.modal-overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 5, 8, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 500px;
  max-width: 90%;
  padding: 28px;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-box.wide {
  width: 720px;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: white;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.required {
  color: var(--color-danger);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  background: rgba(255, 255, 255, 0.03);
  border: var(--card-border);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  color: white;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition-fast);
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.05);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.flex-2 {
  flex: 2 !important;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

/* Relation Selector UI */
.relation-selector-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: var(--card-border);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  min-height: 44px;
}

.selected-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.placeholder-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.relation-badge {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.relation-badge i {
  cursor: pointer;
  font-size: 0.7rem;
}

.relation-badge i:hover {
  color: var(--color-danger);
}

.plans-relation-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: 100%;
  max-height: 240px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.relation-search {
  position: relative;
  border-bottom: var(--card-border);
}

.relation-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.relation-search input {
  width: 100%;
  background: transparent !important;
  border: none !important;
  padding: 10px 12px 10px 34px !important;
  font-size: 0.85rem !important;
}

.relation-options {
  overflow-y: auto;
  max-height: 190px;
  padding: 6px;
}

.relation-option {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.relation-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.relation-option.selected {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
}

/* DETAIL MODAL STYLING (Notion Blocks) */
.detail-modal {
  width: 900px !important;
  height: 90vh;
  max-height: 720px;
  display: flex;
  flex-direction: column;
}

.detail-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--color-primary);
  padding: 2px 8px;
  border-radius: 4px;
  color: white;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-body-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  overflow: hidden;
  padding-bottom: 0 !important;
}

.detail-meta-panel {
  border-right: var(--card-border);
  padding-right: 24px;
  overflow-y: auto;
}

.detail-meta-panel h3, .detail-content-panel h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-properties-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.property-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.property-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.property-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.detail-content-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-right: 8px;
}

.notion-blocks-renderer {
  flex: 1;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.15);
  padding: 20px;
  border-radius: var(--border-radius-sm);
  border: var(--card-border);
  margin-bottom: 20px;
  min-height: 200px;
}

/* Notion block layout inside renderer */
.notion-block {
  margin-bottom: 12px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.notion-block-paragraph {
  color: var(--text-main);
}

.notion-block-bulleted_list_item {
  padding-left: 14px;
  position: relative;
}

.notion-block-bulleted_list_item::before {
  content: "•";
  color: var(--color-primary);
  position: absolute;
  left: 0;
}

.notion-block-to_do {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notion-todo-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

.notion-todo-checkbox.checked {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.notion-todo-text.checked {
  text-decoration: line-through;
  color: var(--text-muted);
}

.notion-no-content {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin-top: 60px;
}

/* Add Block UI Inside Details */
.add-block-container {
  padding: 16px;
  margin-bottom: 16px;
}

.add-block-container h4 {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-block-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-block-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.add-block-actions select {
  font-size: 0.8rem;
  padding: 6px 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--border-radius-sm);
  color: white;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  animation: slideIn var(--transition-fast) forwards;
  min-width: 250px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { background: rgba(16, 185, 129, 0.9); border-left: 4px solid var(--color-success); }
.toast.error { background: rgba(244, 63, 94, 0.9); border-left: 4px solid var(--color-danger); }
.toast.info { background: rgba(99, 102, 241, 0.9); border-left: 4px solid var(--color-primary); }

/* Responsiveness */
@media (max-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 70px;
    padding: 16px 8px;
  }
  .brand-text, .menu-item span, .connection-status span:last-child {
    display: none;
  }
  .main-content {
    margin-left: 70px;
    padding: 20px;
  }
  .kanban-board {
    grid-template-columns: 1fr;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .search-bar {
    width: 100%;
  }
  .detail-body-layout {
    grid-template-columns: 1fr;
  }
  .detail-meta-panel {
    border-right: none;
    border-bottom: var(--card-border);
    padding-right: 0;
    padding-bottom: 20px;
  }
}
