:root {
  --bg-color: #f6f3fc;
  --surface-color: #ffffff;
  --primary-color: #8a63e5;
  --primary-hover: #7b5fed;
  --text-main: #1d1d1f;
  --text-muted: #6b7280;
  --border-color: #eaecf0;
  
  --status-new-bg: #ecfdf3;
  --status-new-text: #027a48;
  --status-progress-bg: #fffaeb;
  --status-progress-text: #b54708;
  --status-done-bg: #f9f5ff;
  --status-done-text: #6941c6;
  
  --priority-high: #f04438;
  --priority-medium: #f79009;
  --priority-low: #12b76a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Utilities */
.hidden { display: none !important; }
.btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}
.btn:hover { background-color: var(--primary-hover); }
.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover { background-color: #f9fafb; }
.btn-danger { background-color: #fee4e2; color: #d92d20; }
.btn-danger:hover { background-color: #fec1c1; }

/* Login Page Specific */
.login-container {
  display: flex;
  width: 100%;
  height: 100vh;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
}
.login-card {
  background: var(--surface-color);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 400px;
}
.login-card h2 { margin-bottom: 8px; text-align: center; }
.login-card p { color: var(--text-muted); text-align: center; margin-bottom: 24px; font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
}
.form-group input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(138, 99, 229, 0.1); }
.login-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.login-tab { 
  flex: 1; text-align: center; padding: 10px; cursor: pointer; color: var(--text-muted); font-weight: 500;
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.login-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.error-msg { color: #d92d20; font-size: 14px; margin-bottom: 16px; text-align: center; }

/* Dashboard Layout */
.sidebar {
  width: 250px;
  background-color: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
}
.sidebar.collapsed {
  width: 65px;
}
.sidebar.collapsed .sidebar-title-text,
.sidebar.collapsed .nav-text {
  display: none;
}
.sidebar-header {
  padding: 24px 20px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-links { list-style: none; padding: 20px 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.nav-link:hover { background-color: var(--bg-color); color: var(--text-main); }
.nav-link.active { background-color: var(--bg-color); color: var(--primary-color); }
.nav-icon { min-width: 20px; } /* Ensures icon doesn't shrink */

.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}
.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* Table Style */
.table-container {
  background: var(--surface-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 16px 24px; border-bottom: 1px solid var(--border-color); }
th { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color 0.1s; cursor: pointer; }
tbody tr:hover { background-color: #fcfcfd; }

.priority-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
}
.priority-high { background-color: var(--priority-high); }
.priority-medium { background-color: var(--priority-medium); }
.priority-low { background-color: var(--priority-low); }

.task-title { font-weight: 500; display: flex; align-items: center; }
.task-desc { color: var(--text-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }

/* Status Pills */
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
  cursor: pointer;
  user-select: none;
}
.status-pending { background-color: var(--status-new-bg); color: var(--status-new-text); }
.status-in_progress { background-color: var(--status-progress-bg); color: var(--status-progress-text); }
.status-done { background-color: var(--status-done-bg); color: var(--status-done-text); }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: flex-end; /* Slide in from right */
  z-index: 1000;
}
.modal-content {
  background: var(--surface-color);
  width: 500px;
  height: 100%;
  padding: 32px;
  box-shadow: -4px 0 15px rgba(0,0,0,0.1);
  overflow-y: auto;
  animation: slideIn 0.3s forwards;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-close { cursor: pointer; background: none; border: none; font-size: 24px; color: var(--text-muted); }
.modal-body h3 { margin-bottom: 8px; font-size: 20px; }
.modal-body p { color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }

/* Danger Zone */
.danger-zone {
  margin-top: 40px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 20px;
  background-color: #fafafa;
}
.danger-zone h4 { color: #d92d20; margin-bottom: 8px; }
.danger-zone p { font-size: 14px; margin-bottom: 16px; }
