/* =========================================================
   Modern Blue Dashboard – Redesign v2.0
   ========================================================= */

/* ---------- 1. Variables & Design System ---------- */
:root {
  /* Colors - Primary Blue Palette */
  --primary-color: #2563eb;
  /* Main Action Blue (Tailwind Blue-600) */
  --primary-hover: #1d4ed8;
  /* Darker Blue for hover */
  --primary-light: #eff6ff;
  /* Very light blue background */
  --secondary-color: #64748b;
  /* Slate-500 for secondary text/icons */

  /* Backgrounds */
  --bg-body: #f1f5f9;
  /* Light Slate background */
  --bg-sidebar: #2563eb;
  /* Sidebar is now Primary Blue */
  --bg-white: #ffffff;

  /* Text */
  --text-dark: #0f172a;
  /* Almost Black */
  --text-muted: #64748b;
  /* Soft Gray */
  --text-white: #ffffff;

  /* Borders */
  --border-color: #e2e8f0;

  /* Task Status Colors */
  --status-todo-bg: #f1f5f9;
  --status-todo-text: #475569;

  --status-progress-bg: #fff7ed;
  --status-progress-text: #ea580c;
  /* Orange */

  --status-done-bg: #f0fdf4;
  --status-done-text: #16a34a;
  /* Green */

  /* Measurements */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* ---------- 2. Base Reset ---------- */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-dark);
}

a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  text-decoration: none;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* ---------- 3. Layout Grid (Admin Shell) ---------- */
.admin-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.sidebar .brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: block;
  padding: 10px 16px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nav-item i {
  font-size: 18px;
}

/* MAIN CONTENT WRAPPER */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* TOPBAR */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-sidebar);
  /* Matches Sidebar in this design, creates full blue header look */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  color: #fff;
}

/* Search Bar in Topbar */
.top-search {
  position: relative;
  width: 400px;
  max-width: 100%;
}

.top-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 24px;
  /* Pill shape */
  padding: 8px 16px 8px 40px;
  color: #fff;
  font-size: 14px;
}

.top-search input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.top-search input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
}

.top-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  opacity: 0.9;
  cursor: pointer;
}

.top-profile i {
  font-size: 20px;
  margin-bottom: 2px;
}

/* CONTENT SCROLL AREA */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-body);
}

/* ---------- 4. Dashboard Grid (Content + Right Sidebar) ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  /* Main content vs Chat Sidebar */
  gap: 24px;
  height: 100%;
}

/* If the content scrolls internally, we remove height 100% from grid so page scrolls.
   BUT for a "web app" feel, we want the panels to scroll independently. 
   Let's try: dashboard-grid fills height, cols scroll independently.
*/
.dashboard-grid {
  height: calc(100vh - var(--topbar-height) - 48px);
  /* Approximate available space */
}

.task-panel {
  overflow-y: auto;
  padding-right: 8px;
}

.chat-panel {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}


/* ---------- 5. Components ---------- */

/* Buttons */
.btn-new {
  background: #fff;
  color: var(--primary-color);
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.1s;
}

.btn-new:hover {
  transform: scale(1.02);
}

/* Task Groups */
.task-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
  margin-top: 24px;
  padding-left: 8px;
  cursor: pointer;
  /* Indicate clickability */
}

.task-group-title i {
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

/* Rotate chevron when collapsed (aria-expanded="false") */
.task-group-title[aria-expanded="false"] i {
  transform: rotate(-90deg);
}

.task-group-title.first {
  margin-top: 0;
}

/* Task Headers */
.task-list-header {
  display: grid;
  grid-template-columns: 20px 2fr 100px 100px 100px 100px;
  /* Checkbox Title Badge Priority Deadline Status */
  gap: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border-color);
  border-bottom: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  align-items: center;
}

/* Task Item */
.task-item {
  display: grid;
  grid-template-columns: 150px 2fr 100px 100px 100px 100px;
  gap: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: none;
  align-items: center;
  transition: background 0.1s;
  font-size: 14px;
}

.task-item:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.task-item:hover {
  background: var(--primary-light);
}

.task-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
}

.task-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #e0f2fe;
  /* Light Blue */
  color: #0ea5e9;
}

.task-priority {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.priority-high {
  color: #dc2626;
}

.priority-medium {
  color: #ea580c;
}

.priority-normal {
  color: #059669;
}

.task-status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.st-todo {
  background: var(--status-todo-bg);
  color: var(--status-todo-text);
}

.st-review {
  background: #fef9c3;
  color: #854d0e;
}

.st-done {
  background: var(--status-done-bg);
  color: var(--status-done-text);
}

/* Resources Cards */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.resource-card {
  background: #bfdbfe;
  /* Stronger blue background as per mockup */
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 120px;
  color: #fff;
  /* Mockup shows white/light content on blue card */
  cursor: pointer;
  transition: opacity 0.2s;
}

.resource-card:hover {
  opacity: 0.9;
}

.resource-card i {
  font-size: 32px;
  margin-bottom: 8px;
  color: #fff;
  opacity: 0.9;
}

.resource-card span {
  font-size: 13px;
  font-weight: 500;
}

/* Right Chat Sidebar */
.chat-header {
  background: var(--primary-color);
  color: #fff;
  padding: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-tabs {
  background: #f1f5f9;
  padding: 8px;
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.chat-tab-item.active {
  color: var(--text-dark);
  text-decoration: underline;
}

.chat-body {
  flex: 1;
  background: #fff;
  overflow-y: auto;
  padding: 16px;
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background: #fff;
  display: flex;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: -280px;
    display: flex !important;
    position: fixed;
    top: 0;
    left: -280px;
    /* Width + padding safety */
    height: 100vh;
    z-index: 9999;
    width: var(--sidebar-width);
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  }

  .sidebar.active {
    left: 0;
  }

  .top-search {
    width: 200px;
  }
}

/* Override Bootstrap utils */
.text-decoration-none {
  text-decoration: none !important;
}

.fw-bold {
  font-weight: 700 !important;
}

.table-hover>tbody>tr:hover>* {
  z-index: 9999999 !important;
}