@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");

:root {
  --page-bg: #f0f2f5;
  --surface: #fff;
  --surface-muted: #f9fafb;
  --card-bg: #fff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-soft: #8c8d90;
  --icon-bg: #f3f4f6;
  --icon-hover: #e5e7eb;
  --border: #e5e7eb;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  --container-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --task-count-accent: #ec4899;
  --total-count-accent: #3232cf;
  --progress-track: #e5e7eb;
  --input-bg: #fff;
  --modal-overlay: rgba(0, 0, 0, 0.5);
  --disabled-bg: #d1d5db;
  --disabled-text: #6b7280;
  --summary-total-bg: #eef2ff;
  --summary-total-text: #3232cf;
  --summary-completed-bg: #d1fae5;
  --summary-completed-text: #047857;
  --summary-pending-bg: #fef3c7;
  --summary-pending-text: #b45309;
}

body.dark-theme {
  color-scheme: dark;
  --page-bg: #0f172a;
  --surface: #111827;
  --surface-muted: #172033;
  --card-bg: #1f2937;
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --icon-bg: #1f2937;
  --icon-hover: #334155;
  --border: #334155;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  --container-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --hover-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  --progress-track: #334155;
  --task-count-accent: #f472b6;
  --total-count-accent: #a5b4fc;
  --input-bg: #0f172a;
  --modal-overlay: rgba(2, 6, 23, 0.76);
  --disabled-bg: #334155;
  --disabled-text: #94a3b8;
  --summary-total-bg: rgba(99, 102, 241, 0.18);
  --summary-total-text: #c4b5fd;
  --summary-completed-bg: rgba(16, 185, 129, 0.18);
  --summary-completed-text: #86efac;
  --summary-pending-bg: rgba(245, 158, 11, 0.18);
  --summary-pending-text: #facc15;
}

.roboto-font {
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
  font-weight: 200;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Roboto", sans-serif;
  background: var(--page-bg);
  min-height: 100vh;
  padding: 40px 20px;
  color: var(--text);
  transition:
    background 0.3s ease,
    color 0.3s ease;
}
.container {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 30px;
  padding: 40px;
  box-shadow: var(--container-shadow);
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
  grid-column: 1/-1;
}

.header-icons {
  display: flex;
  gap: 50px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.icon-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--icon-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  position: relative;
  font-size: 20px;
}
.icon-btn:hover {
  background: var(--icon-hover);
}
.icon-btn.active {
  background: #dc2626;
  color: #fff;
}
.icon-btn.active:hover {
  background: #b91c1c;
}

.icon-btn:disabled,
.icon-btn:disabled:hover {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.main-content {
  padding-right: 20px;
}
.title-section {
  margin-bottom: 40px;
}
.greeting {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.title-section h1 {
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
}
.title-section h1 .task-count {
  color: var(--task-count-accent);
}
.title-section h1 .total-count {
  color: var(--total-count-accent);
}
.add-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 15px;
  transition: 0.3s;
}
.add-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.add-btn:disabled,
.add-btn:disabled:hover {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.section {
  margin-bottom: 40px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.section-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-inactive {
  background: #fee2e2;
  color: #dc2626;
}
.task-item {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow);
  transition: 0.3s;
  min-width: 0;
  overflow: hidden;
}

.draggable {
  flex: 0 0 auto;
  cursor: grab;
  color: var(--text-surface);
  padding: 0 5px;
  line-height: 1;
  transition: color 0.2s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.draggable:hover {
  color: var(--text);
}
.draggable:active {
  cursor: grabbing;
}

.task-item.dragging {
  opacity: 0.5;
  transform: none;
  pointer-events: none;
}
.task-item.drag-over {
  border: 2px dashed #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.18);
}
body.task-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}
.task-item:hover {
  transform: translateX(5px);
  box-shadow: var(--hover-shadow);
}
.task-checkbox {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  border: 2px solid #ec4899;
  background: var(--card-bg);
  cursor: pointer;
  transition: 0.3s;
}
.task-checkbox.completed {
  background: #ec4899;
  position: relative;
}
.task-checkbox.completed::after {
  content: "✓";
  position: absolute;
  color: #fff;
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.task-content {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
}
.task-title {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}
.task-title.completed {
  text-decoration: line-through;
  color: var(--text-soft);
}
.status-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
  white-space: nowrap;
}
.status-pending {
  background: #fef3c7;
  color: #f59e0b;
}
.status-progress {
  background: #dbeafe;
  color: #3b82f6;
}
.status-completed {
  background: #d1fae5;
  color: #10b981;
}
.status-cancelled {
  background: #fee2e2;
  color: #ef4444;
}
.priority-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
  white-space: nowrap;
}
.priority-critical {
  color: #dc2626;
}
.priority-normal {
  color: #f59e0b;
}
.priority-minor {
  color: #10b981;
}
.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #8b5cf6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.sidebar {
  background: var(--surface-muted);
  border-radius: 20px;
  padding: 25px;
}
.sidebar-section {
  margin-bottom: 25px;
}
.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 15px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: var(--shadow);
}
.circular-stat-card {
  display: flex;
  min-height: 168px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.circular-stat-card .stat-label {
  margin-bottom: 0;
}
.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}
.circular-progress {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) var(--progress),
    var(--progress-track) 0deg
  );
  display: grid;
  place-items: center;
  transition: background 0.4s ease;
}
.circular-progress-inner {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.circle-caption {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.task-summary-card {
  display: grid;
  gap: 12px;
}
.summary-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.summary-row strong {
  font-size: 18px;
}
.summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.summary-total {
  background: var(--summary-total-bg);
  color: var(--summary-total-text);
}
.summary-total .summary-dot {
  background: var(--summary-total-text);
}
.summary-completed {
  background: var(--summary-completed-bg);
  color: var(--summary-completed-text);
}
.summary-completed .summary-dot {
  background: #10b981;
}
.summary-pending {
  background: var(--summary-pending-bg);
  color: var(--summary-pending-text);
}
.summary-pending .summary-dot {
  background: #f59e0b;
}
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal.active {
  display: flex;
}
.modal-content {
  background: var(--surface);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
}
.modal-header {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: 0.3s;
  background: var(--input-bg);
  color: var(--text);
}
.form-group input::placeholder {
  color: var(--text-soft);
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
}
.focused-work-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.focused-work-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.focused-work-toggle.disabled {
  color: var(--text-soft);
  cursor: not-allowed;
}
.focused-work-toggle.disabled input {
  cursor: not-allowed;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.btn-secondary {
  background: var(--icon-bg);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--icon-hover);
}
.empty-state {
  color: var(--text-soft);
  padding: 20px;
}
@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body {
    padding: 20px 10px;
  }
  .container {
    padding: 24px 16px;
    border-radius: 20px;
  }
  .main-content {
    padding-right: 0;
  }
  .title-section h1 {
    font-size: 30px;
  }
  .add-btn {
    margin-left: 0;
    margin-top: 12px;
  }
  .task-item {
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  .task-content {
    flex-basis: calc(100% - 64px);
  }
  .status-badge,
  .priority-badge {
    margin-left: 0;
  }
}
