/* ==========================================================================
   URUT.IN - STYLESHEET (DESIGN SYSTEM & MODERN UI)
   ========================================================================== */

:root {
  /* Primary & Accent Palettes */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4134c9;
  --primary-glow: rgba(99, 102, 241, 0.25);

  /* Semantic Priority Colors */
  --priority-high-bg: #fff1f2;
  --priority-high-border: #fecdd3;
  --priority-high-text: #be123c;
  --priority-high-badge: #e11d48;
  --priority-high-glow: rgba(225, 29, 72, 0.15);

  --priority-med-bg: #fffbeb;
  --priority-med-border: #fde68a;
  --priority-med-text: #b45309;
  --priority-med-badge: #d97706;
  --priority-med-glow: rgba(217, 119, 6, 0.15);

  --priority-low-bg: #f0fdf4;
  --priority-low-border: #bbf7d0;
  --priority-low-text: #15803d;
  --priority-low-badge: #16a34a;
  --priority-low-glow: rgba(22, 163, 74, 0.15);

  /* Neutral Background & Surface Gradients */
  --bg-main: #f8fafc;
  --bg-gradient: radial-gradient(circle at 10% 10%, #f1f5f9 0%, #f8fafc 50%, #eff6ff 100%);
  --surface-card: #ffffff;
  --surface-card-subtle: #f8fafc;
  --surface-border: #000000;
  --surface-border-hover: #cbd5e1;

  /* Typography Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-white: #ffffff;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.09), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-glow-purple: 0 8px 20px -4px rgba(99, 102, 241, 0.35);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

/* ==========================================================================
   LAYOUT WRAPPER
   ========================================================================== */
.app-container {
  max-width: 1540px;
  margin: 0 auto;
  padding: 20px 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
}

/* ==========================================================================
   HEADER NAVIGATION
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 16px;
  z-index: 40;
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-500), #818cf8);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-purple);
  transition: transform var(--trans-spring);
}

.logo-icon:hover {
  transform: rotate(-6deg) scale(1.05);
}

.brand-text h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.15;
}

.brand-text h1 span {
  color: var(--primary-600);
}

.brand-text .tagline {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Header Quick Stats */
.header-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-card-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--surface-border);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-weight: 700;
  color: var(--text-main);
}

.stat-pill.active-pill .stat-value {
  color: var(--primary-600);
}

.stat-pill.success-pill .stat-value {
  color: var(--priority-low-badge);
}

.stat-pill.rate-pill {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.stat-pill.rate-pill .stat-value {
  color: var(--primary-700);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon-text {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all var(--trans-fast);
}

.btn-icon-text:hover {
  background: var(--surface-card-subtle);
  border-color: var(--surface-border-hover);
  transform: translateY(-1px);
}

.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
  transition: background var(--trans-fast);
}

.api-status-dot.active {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.btn-chat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-glow-purple);
  transition: all var(--trans-spring);
}

.btn-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -4px rgba(99, 102, 241, 0.45);
}

/* ==========================================================================
   MAIN 3-COLUMN WORKSPACE
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 340px 1fr 380px;
  gap: 20px;
  align-items: start;
}

/* Card Containers */
.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  transition: border-color var(--trans-normal), box-shadow var(--trans-normal);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   LEFT PANEL: TASK FORM & STATS
   ========================================================================== */
.panel-left {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 100px;
}

.card-header {
  margin-bottom: 18px;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-bubble.icon-purple {
  background: var(--primary-50);
  color: var(--primary-600);
}

.icon-bubble.icon-danger {
  background: #ffe4e6;
  color: #e11d48;
}

.header-title-group h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Form Styles */
.task-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.required {
  color: #e11d48;
}

.label-with-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.difficulty-indicator-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-600);
  background: var(--primary-50);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-main);
  transition: all var(--trans-fast);
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.search-box input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

/* Quick Category Selector Chips */
.category-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-chip {
  padding: 4px 10px;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--trans-fast);
}

.cat-chip:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.cat-chip.active {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-700);
  box-shadow: var(--shadow-sm);
}

/* Quick Deadline Helper Pills */
.quick-deadline-pills {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-time-pill {
  padding: 3px 8px;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--trans-fast);
}

.btn-time-pill:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-600);
}

/* Difficulty Buttons Picker */
.difficulty-level-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.diff-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: all var(--trans-spring);
}

.diff-btn .diff-num {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-muted);
}

.diff-btn .diff-title {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.diff-btn:hover {
  border-color: var(--primary-500);
  transform: translateY(-2px);
}

.diff-btn.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.diff-btn.active .diff-num,
.diff-btn.active .diff-title {
  color: #ffffff;
}

/* Submit Button */
.btn-submit-task {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow-purple);
  transition: all var(--trans-spring);
}

.btn-submit-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -3px rgba(99, 102, 241, 0.45);
}

.btn-submit-task:active {
  transform: translateY(0);
}

/* Formula Info Card */
.formula-card {
  padding: 16px 18px;
  background: rgba(248, 250, 252, 0.9);
}

.formula-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-600);
  margin-bottom: 6px;
}

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

.formula-desc {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.priority-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.legend-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.legend-high {
  background: var(--priority-high-bg);
  color: var(--priority-high-text);
}

.legend-high .legend-badge {
  background: var(--priority-high-badge);
  color: #fff;
}

.legend-med {
  background: var(--priority-med-bg);
  color: var(--priority-med-text);
}

.legend-med .legend-badge {
  background: var(--priority-med-badge);
  color: #fff;
}

.legend-low {
  background: var(--priority-low-bg);
  color: var(--priority-low-text);
}

.legend-low .legend-badge {
  background: var(--priority-low-badge);
  color: #fff;
}

/* ==========================================================================
   CENTER PANEL: TASK LISTS & PRIORITIZATION
   ========================================================================== */
.panel-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Tabs Header */
.task-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 18px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.tabs-list {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 10px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--trans-fast);
}

.tab-btn:hover {
  background: var(--surface-card-subtle);
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 700;
}

.badge-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: var(--text-main);
}

.tab-btn.active .badge-count {
  background: var(--primary-600);
  color: #ffffff;
}

.badge-count.count-green {
  background: #dcfce7;
  color: #15803d;
}

/* Filter & Search Bar */
.filter-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
}

.search-box input {
  width: 100%;
  padding: 7px 12px 7px 36px;
  background: var(--surface-card-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  color: var(--text-main);
}

.custom-select {
  padding: 7px 12px;
  background: var(--surface-card-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.custom-select:focus {
  border-color: var(--primary-500);
}

/* Tab Contents */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 14px;
}

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

.section-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
}

.section-title-bar h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-hint {
  font-size: 0.77rem;
  color: var(--text-muted);
}

.btn-subtle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--trans-fast);
}

.btn-subtle:hover {
  background: var(--surface-card-subtle);
  color: var(--text-main);
}

.btn-subtle-danger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: #e11d48;
  transition: all var(--trans-fast);
}

.btn-subtle-danger:hover {
  background: #ffe4e6;
}

/* ==========================================================================
   TASK CARDS & ANIMATIONS
   ========================================================================== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans-spring);
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #cbd5e1;
  border-radius: 4px 0 0 4px;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--surface-border-hover);
}

/* Priority Card Variants */
.task-card.priority-high {
  border-color: var(--priority-high-border);
  background: linear-gradient(to right, #ffffff, #fffafa);
}

.task-card.priority-high::before {
  background: var(--priority-high-badge);
}

.task-card.priority-med {
  border-color: var(--priority-med-border);
  background: linear-gradient(to right, #ffffff, #fffdf8);
}

.task-card.priority-med::before {
  background: var(--priority-med-badge);
}

.task-card.priority-low {
  border-color: var(--priority-low-border);
  background: linear-gradient(to right, #ffffff, #f9fdfa);
}

.task-card.priority-low::before {
  background: var(--priority-low-badge);
}

/* Ranking Badge */
.task-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: #f1f5f9;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.task-card.priority-high .task-rank {
  background: var(--priority-high-bg);
  color: var(--priority-high-badge);
}

.task-card.priority-med .task-rank {
  background: var(--priority-med-bg);
  color: var(--priority-med-badge);
}

.task-card.priority-low .task-rank {
  background: var(--priority-low-bg);
  color: var(--priority-low-badge);
}

/* Task Checkbox */
.task-checkbox-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all var(--trans-spring);
}

.custom-checkbox:hover {
  border-color: var(--primary-500);
  transform: scale(1.08);
}

.custom-checkbox::before {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #ffffff;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:checked {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.custom-checkbox:checked::before {
  transform: scale(1);
}

/* Task Content Info */
.task-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.category-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--text-muted);
}

.task-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.task-deadline-info {
  display: flex;
  align-items: center;
  gap: 5px;
}

.deadline-countdown {
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.countdown-overdue {
  background: #fee2e2;
  color: #dc2626;
  animation: pulse-alert 1.5s infinite;
}

.countdown-urgent {
  background: #fef3c7;
  color: #b45309;
}

.countdown-normal {
  background: #e0f2fe;
  color: #0369a1;
}

.task-difficulty-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.diff-bars {
  display: flex;
  gap: 2px;
}

.diff-bar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e2e8f0;
}

.diff-bar-dot.filled {
  background: var(--primary-600);
}

/* Priority Meter in Card */
.task-priority-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 90px;
}

.score-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}

.score-badge.badge-high {
  background: var(--priority-high-bg);
  color: var(--priority-high-badge);
  border: 1px solid var(--priority-high-border);
}

.score-badge.badge-med {
  background: var(--priority-med-bg);
  color: var(--priority-med-badge);
  border: 1px solid var(--priority-med-border);
}

.score-badge.badge-low {
  background: var(--priority-low-bg);
  color: var(--priority-low-badge);
  border: 1px solid var(--priority-low-border);
}

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

/* Task Actions (Delete, Undo) */
.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-delete-task {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  transition: all var(--trans-fast);
}

.btn-delete-task:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.08);
}

.btn-undo-task {
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #eef2ff;
  color: var(--primary-600);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--trans-fast);
}

.btn-undo-task:hover {
  background: #e0e7ff;
}

/* Completed Card Styling */
.task-card.is-completed {
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.88;
}

.task-card.is-completed::before {
  background: #10b981;
}

.task-card.is-completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.completed-time-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Task card transition out/in animation */
.task-card-anim-out {
  transform: translateX(30px) scale(0.95);
  opacity: 0;
  transition: all 0.3s ease;
}

.task-card-anim-in {
  animation: slide-in-bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Empty State Box */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-lg);
}

.empty-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.empty-icon-wrap.icon-neutral {
  background: #f1f5f9;
  color: #94a3b8;
}

.empty-state h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 360px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   RIGHT PANEL: AI ASSISTANT CHATBOT
   ========================================================================== */
.panel-right {
  position: sticky;
  top: 100px;
  height: calc(100vh - 120px);
  min-height: 560px;
}

.chat-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--surface-border);
}

.bot-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.online-pulse {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
}

.bot-info h3 {
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.15;
}

.model-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #9333ea;
  background: #faf5ff;
  border: 1px solid #f3e8ff;
  padding: 1px 6px;
  border-radius: 4px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon-tiny {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--trans-fast);
}

.btn-icon-tiny:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

/* Chat Context Bar */
.chat-context-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Messages Scroll Area */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fcfdfe;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.chat-message {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: fade-in-up 0.25s ease-out;
}

.chat-message.bot-msg {
  align-self: flex-start;
}

.chat-message.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  font-size: 1.1rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
  word-break: break-word;
}

.bot-msg .msg-bubble {
  background: #ffffff;
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  border-top-left-radius: 4px;
}

.user-msg .msg-bubble {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: #ffffff;
  border-top-right-radius: 4px;
}

.bot-msg .msg-bubble p:not(:last-child) {
  margin-bottom: 8px;
}

.bot-msg .msg-bubble ul,
.bot-msg .msg-bubble ol {
  margin-left: 18px;
  margin-bottom: 8px;
}

.bot-msg .msg-bubble li {
  margin-bottom: 4px;
}

.bot-msg .msg-bubble strong {
  color: var(--primary-700);
}

.bot-msg .msg-bubble code {
  background: #f1f5f9;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: monospace;
}

/* Typing Indicator Animation */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing-bounce 1.3s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Quick Suggestion Chips */
.quick-prompts-container {
  padding: 8px 14px;
  background: #ffffff;
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-prompt-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.quick-prompt-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.quick-prompt-scroll::-webkit-scrollbar {
  height: 3px;
}

.quick-prompt-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

.quick-chip {
  padding: 4px 10px;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  transition: all var(--trans-fast);
}

.quick-chip:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-600);
  transform: translateY(-1px);
}

/* Chat Input Form */
.chat-input-form {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid var(--surface-border);
}

.chat-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 4px 6px 4px 12px;
  transition: border-color var(--trans-fast);
}

.chat-input-wrapper:focus-within {
  border-color: var(--primary-500);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.chat-input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  resize: none;
  max-height: 80px;
  padding: 6px 0;
  color: var(--text-main);
}

.btn-send-chat {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary-600);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--trans-spring);
}

.btn-send-chat:hover {
  background: var(--primary-700);
  transform: scale(1.05);
}

.btn-send-chat:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   MODALS (API SETTINGS & DELETE CONFIRMATION)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  animation: fade-in 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--surface-border);
  overflow: hidden;
  animation: scale-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--surface-border);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-group h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

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

.modal-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal-note code {
  background: #f1f5f9;
  color: var(--primary-600);
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.helper-text {
  font-size: 0.72rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

.btn-input-action {
  position: absolute;
  right: 10px;
  color: var(--text-subtle);
  padding: 4px;
}

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

.delete-task-preview {
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--surface-border);
}

.btn-primary {
  padding: 8px 18px;
  background: var(--primary-600);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 700;
  transition: all var(--trans-fast);
}

.btn-primary:hover {
  background: var(--primary-700);
}

.btn-danger {
  padding: 8px 18px;
  background: #e11d48;
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 700;
  transition: all var(--trans-fast);
}

.btn-danger:hover {
  background: #be123c;
}

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

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #1e293b;
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slide-in-toast 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.2s ease;
}

.toast.toast-success {
  background: #065f46;
  border-left: 4px solid #34d399;
}

.toast.toast-danger {
  background: #881337;
  border-left: 4px solid #f43f5e;
}

.toast.toast-info {
  background: #1e1b4b;
  border-left: 4px solid #818cf8;
}

.mobile-only {
  display: none;
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */
@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-bottom {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-up {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-in-toast {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes typing-bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-6px);
  }
}

@keyframes pulse-alert {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */
@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 320px 1fr;
  }

  .panel-right {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: 380px;
    z-index: 90;
    transform: translateX(105%);
    transition: transform var(--trans-spring);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  }

  .panel-right.drawer-open {
    transform: translateX(0);
  }

  .mobile-only {
    display: flex;
  }
}

@media (max-width: 860px) {
  .app-container {
    padding: 12px 14px 24px;
    gap: 14px;
  }

  .app-header {
    top: 8px;
    padding: 12px 16px;
  }

  .header-stats {
    order: 3;
    width: 100%;
    justify-content: space-around;
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .panel-left {
    position: static;
  }

  .panel-right {
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 540px) {
  .brand-text .tagline {
    display: none;
  }

  .task-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .task-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .task-priority-metric {
    align-items: flex-start;
  }

  .task-actions {
    align-self: flex-end;
  }
}