/* =====================================================
   Outsource Leap - PM | Global Styles
   Light & Dark Theme | Pink-Purple Gradient Accent
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Syne:wght@400;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  /* Gradient Accent */
  --gradient: linear-gradient(135deg, #f72585 0%, #b5179e 35%, #7209b7 70%, #560bad 100%);
  --gradient-soft: linear-gradient(135deg, rgba(247,37,133,0.15) 0%, rgba(114,9,183,0.15) 100%);
  --accent-pink: #f72585;
  --accent-purple: #7209b7;
  --accent-mid: #b5179e;

  /* Light Theme */
  --bg-primary: #f8f7ff;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #f3f0ff;
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #9090b0;
  --border-color: #e8e4f3;
  --border-soft: #f0edf8;
  --shadow-sm: 0 2px 8px rgba(114,9,183,0.06);
  --shadow-md: 0 4px 20px rgba(114,9,183,0.10);
  --shadow-lg: 0 8px 40px rgba(114,9,183,0.14);
  --sidebar-width: 260px;
  --topbar-height: 65px;

  /* Status Colors */
  --status-todo: #6c757d;
  --status-progress: #f39c12;
  --status-review: #3498db;
  --status-done: #27ae60;
  --priority-low: #27ae60;
  --priority-medium: #f39c12;
  --priority-high: #e74c3c;
  --priority-critical: #c0392b;
}

[data-theme="dark"] {
  --bg-primary: #0f0e17;
  --bg-secondary: #16152a;
  --bg-card: #1c1b30;
  --bg-sidebar: #13122a;
  --bg-hover: #211f3a;
  --text-primary: #eeeeff;
  --text-secondary: #a0a0c0;
  --text-muted: #606080;
  --border-color: #2a2847;
  --border-soft: #201e38;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.45);
}

/* ── Base Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

a { color: var(--accent-pink); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-purple); }

/* ===================================================
   LAYOUT
   =================================================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease, background 0.3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  width: 38px; height: 38px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  font-family: 'Syne', sans-serif;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.brand-sub { font-size: 10px; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-nav { padding: 16px 12px; flex: 1; }

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  padding: 10px 12px 6px;
  font-weight: 600;
}

.nav-item { margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  opacity: 1;
}

.nav-link.active {
  background: var(--gradient-soft);
  color: var(--accent-purple);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--gradient);
  border-radius: 0 4px 4px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-soft);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-user:hover { background: var(--bg-hover); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  position: relative;
}
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.online-dot {
  width: 9px; height: 9px;
  background: #27ae60;
  border: 2px solid var(--bg-sidebar);
  border-radius: 50%;
  position: absolute;
  bottom: 0; right: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 900;
  transition: background 0.3s;
}

.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 400; display: block; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.topbar-btn:hover { border-color: var(--accent-pink); color: var(--accent-pink); }

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--accent-pink);
  border-radius: 50%;
  border: 1.5px solid var(--bg-card);
}

/* Theme Toggle */
.theme-toggle {
  width: 52px; height: 28px;
  background: var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  position: relative;
  border: none;
  transition: background 0.3s;
  display: flex; align-items: center;
  padding: 0 4px;
}
.theme-toggle.active { background: var(--gradient); }
.toggle-thumb {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  left: 4px;
  transition: transform 0.3s ease;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.theme-toggle.active .toggle-thumb { transform: translateX(24px); }

/* ── Page Content ── */
.page-content { padding: 28px; flex: 1; }

/* ===================================================
   COMPONENTS
   =================================================== */

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, background 0.3s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 700; }

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
}
.stat-card.alt::before { background: linear-gradient(135deg, #3498db, #2ecc71); }
.stat-card.alt2::before { background: linear-gradient(135deg, #f39c12, #e74c3c); }
.stat-card.alt3::before { background: linear-gradient(135deg, #1abc9c, #3498db); }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--gradient-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}
.stat-number { font-size: 30px; font-weight: 800; font-family: 'Syne', sans-serif; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up { color: #27ae60; }
.stat-change.down { color: #e74c3c; }

/* ── Buttons ── */
.btn-gradient {
  background: var(--gradient);
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-gradient:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(247,37,133,0.35); }

.btn-outline-gradient {
  background: transparent;
  border: 1.5px solid var(--accent-pink);
  color: var(--accent-pink);
  border-radius: 10px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-outline-gradient:hover {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.btn-ghost {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 8px 18px;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--accent-purple); }

/* ── Badges / Pills ── */
.badge-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-todo     { background: rgba(108,117,125,0.12); color: #6c757d; }
.badge-progress { background: rgba(243,156,18,0.12); color: #f39c12; }
.badge-review   { background: rgba(52,152,219,0.12); color: #3498db; }
.badge-done     { background: rgba(39,174,96,0.12); color: #27ae60; }
.badge-low      { background: rgba(39,174,96,0.12); color: #27ae60; }
.badge-medium   { background: rgba(243,156,18,0.12); color: #f39c12; }
.badge-high     { background: rgba(231,76,60,0.12); color: #e74c3c; }
.badge-critical { background: rgba(192,57,43,0.18); color: #c0392b; }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}
.data-table th {
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Forms ── */
.form-control, .form-select {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(114,9,183,0.12);
  background: var(--bg-secondary);
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}
.form-group { margin-bottom: 18px; }

/* ── Search ── */
.search-wrap { position: relative; }
.search-wrap .form-control { padding-left: 38px; }
.search-wrap .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Progress Bars ── */
.progress-bar-wrap { background: var(--bg-primary); border-radius: 20px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--gradient); border-radius: 20px; transition: width 0.6s ease; }

/* ── Avatar Group ── */
.avatar-group { display: flex; }
.avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gradient);
  border: 2px solid var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
  margin-left: -8px;
  position: relative;
  transition: transform 0.2s;
}
.avatar-group .avatar-sm:first-child { margin-left: 0; }
.avatar-group .avatar-sm:hover { transform: scale(1.15); z-index: 2; }
.avatar-sm img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 28px;
  width: 90%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.show .modal-box { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title { font-size: 20px; font-weight: 800; }

.btn-close-modal {
  width: 32px; height: 32px;
  background: var(--bg-hover);
  border: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer;
  font-size: 16px; transition: background 0.2s;
}
.btn-close-modal:hover { background: var(--gradient); color: #fff; }

/* ── Dropdown ── */
.dropdown-menu-custom {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 180px;
}
.dropdown-item-custom {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.dropdown-item-custom:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item-custom.danger:hover { background: rgba(231,76,60,0.1); color: #e74c3c; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}
.empty-state h5 { color: var(--text-secondary); margin-bottom: 6px; }

/* ── Sidebar Toggle (Mobile) ── */
.sidebar-toggle {
  display: none;
  width: 38px; height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer;
  font-size: 16px;
}

/* ===================================================
   LOGIN PAGE
   =================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-primary);
}

.login-left {
  flex: 1;
  background: var(--gradient);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -150px; right: -150px;
}
.login-left::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  bottom: -100px; left: -100px;
}

.login-left-content { position: relative; z-index: 1; color: #fff; text-align: center; }
.login-left-logo {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800;
  font-family: 'Syne', sans-serif;
  color: #fff;
  margin: 0 auto 24px;
}
.login-left-title { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
.login-left-sub { font-size: 16px; opacity: 0.85; max-width: 320px; }

.login-right {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
}

.login-form-wrap { width: 100%; }
.login-heading { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.login-sub { color: var(--text-muted); margin-bottom: 32px; }

/* ===================================================
   KANBAN BOARD
   =================================================== */
.kanban-wrapper { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 16px; }
.kanban-col {
  min-width: 270px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}
.kanban-col-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  font-weight: 700; font-size: 14px;
}
.kanban-dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-count {
  margin-left: auto;
  background: var(--bg-primary);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  color: var(--text-muted);
}
.kanban-task {
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.2s;
}
.kanban-task:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kanban-task-title { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.kanban-task-meta { display: flex; align-items: center; justify-content: space-between; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 24px; }
}

@media (max-width: 767px) {
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stat-number { font-size: 24px; }
}
