/* Font Imports */
@font-face {
    font-family: 'Audiowide';
    src: url('../fonts/Audiowide.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* Global Styles */
/* 🔹 Ensure Header Menu is Fixed */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    padding: 15px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header Styling */
h1, h2, h3 {
    color: #222222;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

/* Logo Styling */
/* 🔹 Velrin Logo */
.velrin-logo {
    width: 100px;
    margin-bottom: 20px;
}

/* Task Status Styling */
.status-pending {
    color: #ff9800; /* Amber */
    font-weight: 500;
}

.status-in-progress {
    color: #00bcd4;
    font-weight: 500;
}

.status-completed {
    color: #4caf50;
    font-weight: 500;
}

/* Buttons keep their own color; other links use the theme color */
a:not(.btn) {
    color: var(--primary-color);
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
}

a:hover {
    text-decoration: underline;
    color: #008c9e;
}

/* 🔥 Add Glowing Effect to Buttons */
.login-button {
    color: white;
    background: #00bcd4; /* Velrin Accent - contrast */
    border: none;
    padding: 10px 20px;
    text-align: center;
    display: inline-block;
    margin: 10px 0;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
    transition: all 0.3s ease;
}

.login-button:hover {
    background: #008c9e;
    box-shadow: 0 6px 18px rgba(0, 188, 212, 0.35);
}

/* 🔘 Default Button Styling */
button, .btn {
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  padding: 8px 15px;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  border: none;
  box-shadow: none;
}

/* 🚀 Accent Buttons */
.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #008c9e;
  color: white;
  box-shadow: 0 0 10px rgba(0, 188, 212, 0.4);
}

/* ✨ Glowing Effect for Cards & Containers */
.card, .content-box, .kanban-column, .task-table {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
}

.card:hover, .content-box:hover, .kanban-column:hover, .task-table:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2),
                0 0 10px rgba(0, 188, 212, 0.3);
}

.kanban-column {
  width: auto;
  min-width: 0;
  max-width: none;
  flex: 1 1 auto; /* harmless in grid; keeps flex DRY if reused elsewhere */
}

/* Smooth column width when sidebar opens/closes */
.kanban-column {
  width: var(--kb-col-min, 260px);
  transition: width .18s ease;
}

/* 🔝 Ensure Header Stays Visible After Login */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Loader */
.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color); /* #00bcd4 */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: none;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fully Center Login Page */
.login-container {
    display: flex;
    flex-direction: column; /* Stack logo, text, and login box */
    justify-content: center;
    align-items: center;
    height: 100vh; /* Full viewport height */
    width: 100vw; /* Full width */
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    font-family: 'Roboto', sans-serif;
}

/* Fix Login Box Alignment */
.login-box {
  background: #ffffff;
  padding: 30px;
  border-radius: 10px;
  width: 350px;
  text-align: center;
  box-shadow: var(--box-shadow);
}

/* Fix Logo Placement */
.login-logo {
    display: block;
    width: 120px;
    margin-bottom: 10px;
}

/* Ensure Text is Centered */
.login-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
  font-family: 'Roboto', sans-serif;
}

/* ✏️ Form Inputs */
.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
}

.input-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--secondary-color);
  background: #ffffff;
  color: #333;
  border-radius: var(--border-radius);
}

/* ⚠️ Alert Messages */
.alert-container {
    margin-top: 10px;
}

.alert {
  padding: 10px;
  background: var(--danger-color); /* Updated red */
  color: black;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
}

/* 📌 Links */
.additional-links {
    margin-top: 15px;
}

.additional-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.additional-links a:hover {
    text-decoration: underline;
}

.form-wrapper {
  width: 300px;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

.content-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  box-sizing: border-box;
}

ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

li {
  margin: 10px 0;
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.5;
}

.task-list-container h1, .task-list-container h2 {
    text-align: center;
}

/* Task Table Styling */
.task-table {
  width: 100%;
  max-width: 1200px;
  border-collapse: collapse;
  display: block;
  margin: 0 auto;
  overflow-x: auto;
  position: relative;
  z-index: 2;
  border-radius: var(--border-radius);
}

/* 🛠 Reduce Button Sizes in Table */
.task-table td .btn {
  padding: 6px 10px;
  font-size: 12px;
  min-width: 80px;
  border-radius: var(--border-radius);
}

/* 🛠 Reduce Table Font Size */
.task-table th, .task-table td {
  border: 1px solid #dee2e6;
  padding: 6px;
  text-align: left;
  font-size: 0.85rem;
  white-space: nowrap;
  font-family: var(--font-family);
}

.task-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  font-family: var(--font-family);
}

.task-table tr:nth-child(even) {
  background-color: #fcfcfc;
}

.smart-table tbody tr:hover td {
  background-color: rgba(128,128,128,0.06) !important; /* subtle */
}
@media (prefers-color-scheme: dark) {
  .smart-table tbody tr:hover td {
    background-color: rgba(255,255,255,0.06) !important; /* subtle in dark */
  }
}

.task-table td a {
  color: var(--primary-color);
  text-decoration: none;
}

.task-table td a:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* Task Progress Bars */
.progress-bar {
  text-align: center;
  color: white;
  font-size: 0.9rem;
  line-height: 20px;
  border-radius: var(--border-radius);
  font-family: var(--font-family);
}

.progress-bar.bg-warning {
  background-color: #ffc107;
}

.progress-bar.bg-primary {
  background-color: var(--primary-color);
}

.progress-bar.bg-success {
  background-color: var(--success-color);
}

.progress-bar.bg-danger {
  background-color: var(--danger-color);
}

/* Consistent Card Styles */
.card {
    flex: 1; /* Allows the card to take up equal space */
    min-width: 300px; /* Prevents cards from becoming too small */
    max-width: 500px; /* Ensures cards don't stretch too much */
}

.card:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15), 0 0 12px rgba(0, 188, 212, 0.2);
}

.card-body {
  padding: 15px;
  font-family: var(--font-family);
}

/* Consistent Buttons */
.btn {
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  padding: 10px 15px;
  margin-right: 5px;
  font-family: var(--font-family);
}

.btn-primary {
  background-color: var(--primary-color) !important;
  border: none;
  color: white;
}

.btn-primary:hover {
  background-color: #008c9e !important;
  box-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

.btn-secondary {
  background-color: #6c757d !important;
  border-color:     #6c757d !important;
  color: #fff !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #5a6268 !important;
  border-color:     #5a6268 !important;
  color: #fff !important;
}

.btn-secondary:hover {
    background-color: #5a6268 !important;
}

.btn-success {
  background-color: #198754 !important;
  border-color:     #198754 !important;
  color: #fff !important;
}

.btn-success:hover,
.btn-success:focus {
  background-color: #157347 !important;
  border-color:     #157347 !important;
  color: #fff !important;
}

.btn-success:hover {
    background-color: #218838 !important;
}

.btn-warning {
    background-color: #ffc107 !important; /* Restore Warning Yellow */
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800 !important;
}

/* Force reliable, legible colors for core Bootstrap buttons */
.btn-danger {
  background-color: #dc3545 !important;
  border-color:     #dc3545 !important;
  color: #fff !important;
}

.btn-danger:hover {
    background-color: #c82333 !important;
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #c82333 !important;
  border-color:     #c82333 !important;
  color: #fff !important;
}

.btn-info {
  background-color: #00bcd4 !important;
  color: white;
}

.btn-info:hover {
  background-color: #008c9e !important;
}

.btn-outline-primary {
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  background-color: transparent;
}

.btn-outline-primary:hover {
  color: white;
  background-color: var(--primary-color);
}

/* Dark Mode */
body.dark-mode {
    background-color: #121212;
    color: #e4e4e4;
}

/* Header and Footer */
body.dark-mode .footer {
    background-color: #1e1e1e;
    color: #e4e4e4;
    border: none;
}

/* 🚀 Fix Header in Dark Mode */
body.dark-mode .header {
  background: #1e1e1e;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 188, 212, 0.2);
}

body.dark-mode .footer p {
  color: #aaaaaa;
}

/* Titles */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3 {
    color: #ffffff; /* Ensure section titles are white for visibility */
}

/* Cards */
body.dark-mode .card {
  background-color: #1e1e1e;
  color: #ffffff;
  border-color: #2a2a2a;
}

body.dark-mode .card .card-title {
    color: #ffffff; /* Card titles in white */
}

/* Buttons */
body.dark-mode .btn {
  background-color: #2c2c2c;
  color: #e4e4e4;
  border: 1px solid #444;
}

/* Keep your custom Velrin buttons dark in dark-mode too */
body.dark-mode .btn:hover {
  filter: brightness(1.05);      /* subtle lift, no color swap */
}

/* Explicit hover colors for Velrin button set */
body.dark-mode .btn-velrin-primary:hover,
body.dark-mode .btn-velrin-primary:focus {
  background-color: #262a30 !important;
  border-color: #262a30 !important;
  color: #ffffff !important;
}
body.dark-mode .btn-velrin-secondary:hover,
body.dark-mode .btn-velrin-secondary:focus {
  background-color: #3c424a !important;
  border-color: #3c424a !important;
  color: #ffffff !important;
}
body.dark-mode .btn-velrin-outline:hover,
body.dark-mode .btn-velrin-outline:focus {
  background-color: #2f343b !important;
  border-color: #2f343b !important;
  color: #ffffff !important;
}

/* Progress Bars */
body.dark-mode .progress-bar {
    color: white;
}

body.dark-mode .progress-bar.bg-warning {
    background-color: #ffc107;
}

body.dark-mode .progress-bar.bg-primary {
    background-color: #007bff;
}

body.dark-mode .progress-bar.bg-success {
    background-color: #28a745;
}

body.dark-mode .progress-bar.bg-danger {
    background-color: #dc3545;
}

/* Notifications */
body.dark-mode .list-group-item {
    background-color: #242424;
    color: #ffffff;
    border: 1px solid #333;
}

body.dark-mode .list-group-item:hover {
  background-color: #303030;
  color: white;
  box-shadow: 0 0 6px rgba(0, 188, 212, 0.15);
}

/* Tables */
body.dark-mode .table {
  background-color: #1e1e1e;
  color: #e4e4e4;
  border-color: #444;
}

body.dark-mode .table thead th {
  background-color: #2e2e2e;
  color: #ffffff;
  border-color: #444;
}

body.dark-mode .table td {
  background-color: #1f1f1f;
  color: #e4e4e4;
  border-color: #444;
}

body.dark-mode .table .btn {
  background-color: #2c2c2c;
  color: #e4e4e4;
  border: 1px solid #444;
}

body.dark-mode .table .btn:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Side Bar */
body.dark-mode .sidebar {
    background: #1a1a1a;
}

body.dark-mode .sidebar ul li a {
  color: #ccc;
  transition: color 0.3s ease;
}

body.dark-mode .sidebar ul li a:hover {
  color: var(--primary-color);
}

/* Links */
body.dark-mode a {
  color: #00bcd4;
}

body.dark-mode a:hover {
  color: #00e0ff;
}

/* Fix Button Alignment in Task List */
.task-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Fix Progress Bar and Button Overlap */
.task-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.task-row .progress {
    flex: 1; /* Allow progress bar to expand */
    margin-right: 10px;
}

.task-row .task-buttons {
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* Kanban Board Container */
/* Kanban Board Container (sidebar-aware + smooth resize) */
.kanban-container,
#kanban-container {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--kb-col-min, 260px); /* fixed track per column for smoother reflow */
    gap: var(--kb-gap, 12px);
    align-items: start;
    justify-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 15px;
}

.kanban-column,
.content-box {
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}


.kanban-column:hover,
.content-box:hover {
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 188, 212, 0.2);
}

/* 🔷 Column Header Bar */
.kanban-column-header {
    background: var(--primary-color);
    color: #ffffff !important;
    padding: 12px;
    font-weight: 600;
    text-align: center;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
}

.kanban-column-header .btn-close {
    color: white;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.kanban-column-header .btn-close:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* 📦 Column Body */
.kanban-column-body {
    padding: 10px;
    min-height: 200px;
    background: #fdfdfd;
    border-radius: 0 0 8px 8px;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    padding: 10px;
}

.kanban-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.kanban-card {
  position: relative;
  transition: background-color .2s ease-in-out, box-shadow .2s;
}
.kanban-card:hover {
  background-color: #f1f1f1;
  box-shadow: 0 3px 12px rgba(0,0,0,.06);
}
body.dark-mode .kanban-card:hover {
  background-color: #2a2a2a;
}

.kanban-card .desc{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.kanban-card.overdue{
  border-left: 3px solid #dc3545;
  padding-left: .5rem;
}

.kanban-scroll-hint {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    margin-top: 5px;
}

/* 🎯 Additional Kanban Improvements */

/* Dark mode fix for column body */
body.dark-mode .kanban-column-body {
  background: #252525;
}

/* Centering and structure for board wrapper */
/*.kanban-board {
  max-width: 100%;
  margin: auto;
}*/

.kanban-board {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

#kanban-container {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--kb-col-min, 260px);  /* fixed column width */
  grid-template-columns: none;
  gap: var(--kb-gap, 12px);
  align-items: start;
  justify-items: stretch;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 10px;
  width: 100%;
}

body.sidebar-collapsed #kanban-container {
  justify-content: center;
  padding-left: 30px;
  padding-right: 30px;
}

/* Header consistency */
.kanban-board h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary-color);
  text-align: center;
}

body.dark-mode .kanban-board h1 {
  color: #00bcd4;
}

/* Buttons on Kanban board */
.kanban-board .btn {
  font-weight: 500;
  border-radius: 6px;
}

.kanban-board .btn-secondary,
.kanban-board .btn-light {
  color: var(--text-color);
  background-color: transparent;
  border: 1px solid var(--primary-color);
  transition: background-color 0.2s ease;
}

.kanban-board .btn-secondary:hover,
.kanban-board .btn-light:hover {
  background-color: var(--primary-color);
  color: white;
}

body.dark-mode .kanban-board .btn-secondary,
body.dark-mode .kanban-board .btn-light {
  color: #ddd;
  border-color: #ccc;
}

/* ✅ Keep button inside Kanban Board */
/* Kanban: let toolbar classes style the Add Column button (no forced circle) */
#add-column-btn {
  position: static;
  margin: 0;
  width: auto;
  height: auto;
  border-radius: 999px;     /* pill shape, matches .btn-rounded */
  background: transparent;  /* outline stays outline */
  color: inherit;
  box-shadow: none;
  transition: none;
}
#add-column-btn:hover { transform: none; }

/* Highlight column when dragged over */
.kanban-column-body.drag-over {
    background: #e0f7fa;
    border: 2px dashed var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 188, 212, 0.2);
}

/* Kanban Card Styling */
.kanban-card {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: white;
    color: black;
    padding: 10px;
    border-radius: 6px;
    border-left: 5px solid var(--primary-color);
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: grab;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease;
}

.kanban-card-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card-description {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 188, 212, 0.15);
}

.kanban-card:active {
    cursor: grabbing;
    opacity: 0.7;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 🔴 Overdue Card */
.kanban-card.overdue {
    border-left: 5px solid #dc3545;
    background: #fff5f5;
}

/* 🔘 Active Toggle Button */
.btn.active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* 🧠 Accessibility Focus Ring */
.kanban-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 🕳 Placeholder */
.kanban-placeholder {
    padding: 10px;
    color: #999;
    text-align: center;
    font-style: italic;
}

/* Dark Mode Styling */
body.dark-mode .kanban-column, body.dark-mode .content-box {
    background: #1e1e1e;
    box-shadow: 0 4px 8px rgba(0, 255, 255, 0.2);
}

body.dark-mode .kanban-card {
    background: #222;
    color: #e4e4e4;
    border-left: 5px solid var(--primary-color);
}

/* Kanban — dark-mode meta text legibility (e.g., Due: …) */
body.dark-mode .kanban-card small,
body.dark-mode .kanban-card .text-muted {
  color: #cfd8dc !important;   /* soft light gray for high contrast on #222 */
}

/* (Optional) nudge card body copy a touch brighter in dark mode */
body.dark-mode .kanban-card p {
  color: #e6e6e6;
}

body.dark-mode .kanban-placeholder {
  background: #2a2a2a;
  color: #cccccc;
  border: 1px dashed #555;
}


/* 📎 Footer */
.footer {
    text-align: center;
    padding: 20px;
    background: #f4f4f4;
    color: #333;
    margin-top: 30px;
}

/* 🚀 Fix Footer in Dark Mode */
body.dark-mode .footer {
    background: #1e1e1e;
    color: white;
}

/* 🧱 Global Layout */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 📚 Sidebar */
/* Sidebar (unified timing with main-content to avoid overlap) */
.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: #1a1a1a;
    color: white;
    padding: 20px;
    transition: width .24s ease; /* match main-content timing */
    will-change: width;
    overflow-x: hidden;
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin-top: 45px; /* Prevent overlap */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.sidebar-menu li {
    padding: 6px 15px;
    transition: background 0.3s ease-in-out;
    border-radius: 6px;
}

.sidebar-menu li:hover {
    background: #2a2a2a;
}

.sidebar-menu a {
    color: #e4e4e4;
    text-decoration: none;
    font-size: 15px;
    display: block;
    font-weight: 500;
}

/* 🧭 Sidebar Footer */
.sidebar-footer {
    font-size: 12px;
    text-align: center;
    padding: 15px 10px;
    margin-top: auto;
    color: #999;
    opacity: 0.8;
    border-top: 1px solid #333;
}

/* TOP NAVBAR */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #ffffff;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

body.dark-mode .top-navbar {
    background: #1a1a1a;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
}

/* HEADER BUTTONS */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px; /* Spacing between buttons */
}

/* Ensuring All Header Buttons (Dark Mode, Logout, Sidebar) Have the Same Size */
.header-buttons .btn,
.sidebar-toggle {
    padding: 8px 12px;
    font-size: 14px;
    height: 40px;
    min-width: 100px;
    border-radius: 6px;
    font-weight: 500;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: #333;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.3s ease-in-out;
}

.sidebar-toggle:hover {
    background: #444;
}

/* Ensuring Sidebar Toggle Button is Fully Visible */
.sidebar-toggle i {
    color: white;
}

/* 📐 Sidebar Collapse Rules */
.sidebar.collapsed {
    width: 60px;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

/*.sidebar.collapsed + .main-content,
.sidebar + .main-content {
    width: calc(100% - 250px);
    margin-left: 250px !important;
    transition: none !important;
}*/

/* 📊 Task Layout Fixes on Collapse */
/* When the sidebar collapses, let main content (and our task page) span fully */
.sidebar.collapsed ~ .main-content .task-page-wrap {
  max-width: none;
  width: 100%;
}

/* Hide Sidebar Items When Collapsed */
.sidebar.collapsed .sidebar-menu,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-menu a {
    display: none;
}

.navbar-content {
    width: 100%;
    text-align: center;
}

/* 🦶 Footer Responsive to Sidebar */
.footer {
    text-align: center;
    padding: 15px;
    background: #1a1a1a;
    color: white;
    position: fixed;
    width: 100%;
    bottom: 0;
    left: 250px;
    transition: left 0.3s ease-in-out;
}

.sidebar.collapsed ~ .footer {
  left: 60px;
}

/* Dark Mode Styling */
.dark-mode {
    background: #181818;
    color: #e4e4e4;
}

/* Sidebar Dark Mode */
.dark-mode-sidebar {
    background: #111;
    border-right: 1px solid #444;
}

/* Buttons in Dark Mode */
.dark-mode .btn {
    background: #222;
    color: #e4e4e4;
}

/* Header */
.header {
    width: 100%;
    height: 80px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.header-logo {
    height: 40px;
}

/* Ensure the Dashboard Content has a uniform width */
.dashboard-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 equal columns */
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

/* General Box Styling */
.dashboard-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    min-height: 280px; /* Prevents shrinking */
    max-width: 100%; /* Prevents boxes from stretching out */
    overflow: hidden; /* Ensures content never spills out */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Evenly distributes content */
}

/* 🧱 Dashboard Container */
.dashboard-container {
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
}

/* 📱 Mobile Dashboard Layout */
@media screen and (max-width: 768px) {
    .dashboard-content {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .widget.half-width,
    .widget.full-width-box {
        width: 100%;
        max-width: 100%;
    }

    #dashboard-grid .row {
        flex-direction: column;
    }
}

/* 🧢 Dashboard Title */
.dashboard-title {
    width: 100%;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

/* 🎨 Widget Accent Borders */
.task-summary,
.recent-notifications,
.tasks-per-user {
    border-left: 5px solid var(--primary-color);
}

.overdue-tasks {
    border-left: 5px solid #e63946;
}

/* 📦 Task Summary + Notifications Widget */
.task-summary, .recent-notifications {
    height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15px;
}

.notification-text-wrapper {
  display: inline-block;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Ensure Task Summary Text Doesn't Overflow */
.task-summary h3,
.task-summary p {
    font-size: 1rem;
    margin: 5px 0;
}

/* 🔹 Fix Charts from Extending Downward */
.tasks-per-user, .overdue-tasks {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    height: 280px;
}

/* 🌕 Light Mode Defaults */
.task-summary,
.task-details,
.task-meta,
.comment-section,
.progress-history {
    background: #ffffff;
    color: #222222;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 🌓 Apply Dark Mode Only When Activated */
body.dark-mode .task-summary,
body.dark-mode .task-details,
body.dark-mode .task-meta,
body.dark-mode .comment-section,
body.dark-mode .progress-history {
    background: #1e1e1e !important; /* Dark background */
    color: white !important; /* White text */
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

/* ✅ List Group Styling */
.comment-section .list-group-item,
.progress-history .list-group-item {
    background: #f9f9f9;
    color: #222;
    border-left: 5px solid #00bcd4;
    border-radius: 6px;
    margin-bottom: 5px;
}

body.dark-mode .comment-section .list-group-item,
body.dark-mode .progress-history .list-group-item {
    background: #2a2a2a !important;
    color: white !important;
    border-left-color: var(--primary-color) !important;
}

/* Default Light Mode Background */
.task-details,
.task-meta,
.comments-container,
.progress-history-container {
    background: #ffffff;
    color: black;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Apply Dark Mode */
body.dark-mode .task-details,
body.dark-mode .task-meta,
body.dark-mode .comments-container,
body.dark-mode .progress-history-container {
    background: #1e1e1e !important;
    color: white;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

.task-details p,
.task-meta p,
.comments-container p,
.progress-history-container p {
    font-size: 14px;
    font-weight: 500;
    color: black;
}

/* Apply Dark Mode */
body.dark-mode .task-details p, 
body.dark-mode .task-meta p, 
body.dark-mode .comments-container p, 
body.dark-mode .progress-history-container p {
    color: white !important;
}

/* 🎨 Ensure Watch/Unwatch Buttons Follow Theme */
.watch-buttons button {
    background-color: var(--primary-color);
    color: white;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 1rem;
}

body.dark-mode .watch-buttons button {
    background-color: #444; /* Darker button in dark mode */
    color: white;
}

/* 🔄 Fix Progress Bar Colors in Light and Dark Mode */
.progress-bar-container {
    width: 100%;
    max-width: 400px; /* Prevents excessive width */
}

.progress-bar {
    text-align: center;
    font-size: 0.9rem;
    line-height: 20px;
    border-radius: 5px;
    color: white; /* Default white text */
}

.progress-bar.bg-warning { background-color: #ffc107; }
.progress-bar.bg-primary { background-color: #007bff; }
.progress-bar.bg-success { background-color: #28a745; }
.progress-bar.bg-danger  { background-color: #dc3545; }

body.dark-mode .progress-bar.bg-warning { background-color: #ffc107; }
body.dark-mode .progress-bar.bg-primary { background-color: #007bff; }
body.dark-mode .progress-bar.bg-success { background-color: #28a745; }
body.dark-mode .progress-bar.bg-danger  { background-color: #dc3545; }

/* 🛠 Notifications List Scroll Fix */
.notifications-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.notifications-list::-webkit-scrollbar {
    display: none;
}

/* 🔹 Notification Card */
.notification-item {
    background: #f5f5f5;
    color: #333;
    border-left: 4px solid #00bcd4;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease-in-out;
}

.notification-item:hover {
    background: #e9e9e9;
}

body.dark-mode .notification-item {
  background: #1f1f1f;
  color: white;
  border-left: 4px solid #00bcd4;
}

/* 🛠 Fix Notifications Page Alignment */
/* ✅ Ensure Notifications Page is Fully Centered */
.notifications-container {
    width: 85%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 160px; /* Further increase left padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center; /* Ensures everything inside stays centered */
    transition: none;
}

/* ✉️ Notification Links */
.notification-link {
    color: #007bff;
    text-decoration: none;
}

.notification-link:hover {
    text-decoration: underline;
}

body.dark-mode .notification-link {
    color: #00bcd4;
}

body.light-mode .notification-link {
    color: #212529;
}

/* ⏱ Timestamps */
.notification-timestamp {
    color: var(--bs-secondary-color, #ccc);
    font-size: 0.8rem;
}

body.dark-mode .notification-timestamp {
    color: #ccc;
}
body.light-mode .notification-timestamp {
    color: #555;
}

/* ✅ Prevent Sidebar Collapse from Affecting Notifications */
.sidebar.collapsed + .notifications-container {
    width: 85%;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 170px; /* Further fine-tuned left padding */
    transition: none;
}

.mark-read-btn {
    background: #00bcd4;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease-in-out;
}

.mark-read-btn:hover {
  background: #008c9e;
}

/* 🔹 Task Summary Styling */
.task-summary {
    max-width: 850px;
    margin: auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

/* Ensure Task Details and Task Meta Align Properly */
.task-summary .row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 20px;
    width: 100%;
}

.task-summary-page {
    max-width: 800px;
    margin: auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ✅ Ensure Equal Sizing for Details & Meta */
.task-summary .task-details,
.task-summary .task-meta {
    padding: 15px;
    background: #f8f9fa; /* Light gray background */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure Task Summary Title Matches Other Box Titles */
.task-summary h3 {
    position: relative;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-weight: normal;
    padding: 5px 0 10px;
}

/* ✅ Title Consistency */
.task-summary h2 {
    font-size: 1.6rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

/* 🔹 Align Title & Icon */
.task-summary h3 i {
    font-size: 1.5rem;
    color: #ff4757; /* Red pushpin icon */
}

/* 🔹 Improve Text Readability */
.task-summary p {
    font-size: 1rem;
    margin: 5px 0;
}

/* ✅ Fix Dark Mode for Task Items */
body.dark-mode .task-item {
    background-color: #1f1f1f;
    border: 1px solid #333;
    color: #eaeaea;
}

body.dark-mode .task-status {
    background-color: #333;
    color: #fff;
}

/* Fix Task Item Buttons */
.task-item .btn {
    background: #00bcd4;
    color: white;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 1rem;
    transition: background 0.3s ease;
}
.task-item .btn:hover {
    background-color: #008c9e;
}

.comments-container,
.progress-history-container {
    max-width: 800px;
    margin: auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Fix for Buttons */
body.dark-mode .task-item .btn {
    background-color: #444;
    color: #fff;
    border: 1px solid #666;
}

/* Apply Dark Mode */
body.dark-mode .comments-container, 
body.dark-mode .progress-history-container {
    background: #222 !important;
    color: white;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

.task-summary-container {
    display: flex;
    gap: 15px; /* Space between boxes */
    justify-content: space-between;
    align-items: stretch; /* Ensures both boxes stretch equally */
}

.task-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
    background: #ffffff;
    color: var(--task-box-text);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    border: 1px solid var(--task-box-border);
    height: 100%;
}

/* Ensures equal height in dark mode */
.dark-mode .task-box {
    background: #2a2a2a; /* Dark background */
    color: white;
}

/* Ensure Flex Layout for Proper Alignment */
/*.row {
    align-items: stretch;
}*/

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.row .widget {
  flex: 1 1 calc(50% - 12px);
  min-width: 300px;
}

.task-summary-page,
.comments-container,
.progress-history-container {
    overflow: hidden;
}

.comment-list,
.progress-list {
    max-width: 100%;
}

/* ✅ Status & Priority Badges */
.status-badge, .priority-badge {
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: bold;
}

/* 🔹 Adjust Status Alignment */
.task-summary .status-row {
    display: flex;
    justify-content: space-between;
    width: 80%;
    padding: 5px 0;
}

/* Layout for Task Count Boxes */
.task-summary .status-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* 🔹 Arrange Task Statuses in a Vertical List */
.task-summary .status-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly; /* Ensures proper spacing */
    align-items: center;
    gap: 15px; /* Ensures even spacing */
    width: 100%;
}

/* Individual Task Count Boxes */
.task-summary .status-box {
    background: rgba(0, 0, 0, 0.05); /* Light background */
    padding: 12px 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.task-summary .status-item {
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.05); /* Light background */
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 120px;
    text-align: center;
}

/* Task Status Numbers Aligned */
.task-summary .status-item span {
    font-weight: bold;
    margin-left: 5px;
}

.task-summary, .task-details, .task-meta {
    background: #ffffff; /* Default Light Mode */
    color: black;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Apply Dark Mode */
body.dark-mode .task-summary, 
body.dark-mode .task-details, 
body.dark-mode .task-meta {
    background: #222 !important; /* Dark Mode Background */
    color: white;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}
.comment-section, .progress-history {
    background: #ffffff; /* Light Mode Default */
    color: black;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Apply Dark Mode */
body.dark-mode .comment-section, 
body.dark-mode .progress-history {
    background: #222 !important;
    color: white;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

/* Status Container (Ensures All Items Fit Properly) */
.status-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two columns */
    gap: 10px; /* Adds space between boxes */
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    width: 100%;
}

/* Status Boxes (Uniform Size and Styling) */
.status-box {
    background: #f8c102; /* Default yellow */
    color: black;
    font-weight: bold;
    padding: 8px 12px; /* Smaller padding */
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%; /* Ensures they don’t stretch */
    max-width: 150px; /* Prevents them from getting too wide */
    min-height: 50px; /* Keeps them small */
}

/* 🔹 Unified Status Colors */
.status-box.pending {
    background: #b2ebf2;      /* Light Cyan */
    color: #004d40;
}

.status-box.in-progress {
    background: #00bcd4;      /* Velrin Cyan */
    color: white;
}

.status-box.completed {
    background: #0097a7;      /* Muted Teal */
    color: white;
}

.status-box.overdue {
    background: #ff6b6b;      /* Coral Red */
    color: white;
}

/* 🧾 Labeling */
.status-box .status-title {
    font-size: 12px;
    font-weight: 600;
}

.status-box .status-count,
.status-box span {
    font-size: 16px;
    font-weight: bold;
    margin-top: 3px;
}

/* Recent Notifications */
.recent-notifications {
    min-height: 280px;
    max-height: 280px;
    overflow-y: auto; /* Enables scrolling if needed */
}

/* Tasks Per User */
.tasks-per-user canvas, .overdue-tasks canvas {
    width: 90% !important; /* Prevents it from touching box edges */
    height: 220px !important; /* Ensures proper scaling */
    display: block;
    margin: auto;
}

/* Chart Titles Inside the Box */
.tasks-per-user h3, .overdue-tasks h3 {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

/* Overdue Tasks */
.overdue-tasks {
  border-left: 5px solid #ff6b6b; /* Velrin Soft Coral */
}

/* Full-Width Section (Admin Tasks Box) */
.full-width-tasks {
    grid-column: span 2;
    width: 100%;
    min-height: 320px; /* Increased from 250px to 290px */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Evenly distributes content */
    padding: 15px 20px;
    position: relative;
}

/* Properly Center the "Admin Tasks" Title */
.full-width-tasks h3 {
    margin: 0;
    padding: 5px 0 10px;
    text-align: center;
}

/* View All Button - Keep Inside the Box */
.full-width-tasks .view-all-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: auto; /* Ensures button stays at bottom */
    padding-bottom: 15px;
}

/* Task List Styling */
.task-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.widget.user-tasks {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Task list container override */
.widget.user-tasks .task-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
}

/* Task item sizing */
.widget.user-tasks .task-item {
    width: 30%;
    min-width: 280px;
    max-width: 320px;
    height: auto;
}

/* Chart canvas containment */
.widget canvas {
    height: 240px !important;
    max-height: 240px;
    object-fit: contain;
}

.widget h2 {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 15px;
  text-align: center;
}

/* Task Item Card */
.task-item {
    background: var(--task-box-bg); /* Uses theme variable */
    color: var(--task-box-text);
    padding: 15px;
    border-radius: 8px;
    width: 30%;
    min-width: 280px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, color 0.3s ease;
    cursor: pointer; /* Optional */
}

.task-item h4 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--task-box-text); /* ensures proper theme integration */
    word-wrap: break-word;
}

.task-status {
    font-weight: bold;
    padding: 8px 12px; /* Balanced padding */
    border-radius: 5px;
    display: inline-flex; /* Ensures alignment */
    align-items: center;
    justify-content: center;
    width: 100px; /* Uniform width */
    height: 36px; /* Matches View Task button */
    text-align: center;
    white-space: nowrap;
}

/* View Task Button - Ensures Consistent Height */
.view-task-btn {
    height: 36px; /* Matches status badge */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    font-size: 14px;
}

.view-task-btn,
.view-all-btn {
  background: #00bcd4 !important;
  color: white !important;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  display: inline-block;
}

.view-task-btn:hover,
.view-all-btn:hover {
  background: #008c9e !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}


/* 🔹 Define Status Colors */
/* Status Colors */
.task-status.pending {
  background: #ffcc00;
  color: #333;
}

.task-status.in-progress {
  background: #00bcd4;
  color: white;
}

.task-status.completed {
  background: #0097a7;
  color: white;
}

.task-status.overdue {
  background: #ff6b6b;
  color: white;
}

/* View All Button for Admin Tasks */
.view-all-container {
    width: 100%;
    text-align: center;
    margin-top: auto; /* Ensures it's at the bottom */
    padding-bottom: 15px; /* Keeps original spacing */
}

/* Standardized Dashboard Header */
.dashboard-header {
    width: 100%; /* Full width */
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding: 10px 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 10px;
    display: flex;
    justify-content: center; /* Center the text */
    align-items: center;
}

/* Ensure Full-Width Header Line for Task Summary */
.task-summary .dashboard-header {
    width: 100%; /* Force full width */
}

/* ✅ Fix for Smaller Screens */
@media (max-width: 900px) {
    .task-list-container {
        width: 100%;
    }
    .task-table {
        min-width: unset; /* Allows shrinking */
        width: 100%;
        overflow-x: auto; /* Enables scrolling */
    }
    #dashboard-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
}

/* ✅ Fix for Laptop Screens (13" & 15") */
@media (max-width: 1440px) {
  main.main-content {
    width: calc(100vw - 250px);
    margin-left: 250px;
  }
  .sidebar.collapsed ~ main.main-content {
    width: calc(100vw - 60px);
    margin-left: 60px;
  }
  /* keep the rest of this block (dashboard-container, task-table, etc.) as-is */
}

@media (max-width: 1280px) {
  .task-list-container {
    width: 95%;
    margin-left: auto;
    margin-right: auto;
  }
  /* keep main content driven by the base/collapsed rules */
  main.main-content { padding: 50px 15px; }
  .task-table { max-width: 100%; }
}

@media (max-width: 1024px) {
  /* keep calc-based width; just soften padding */
  main.main-content { padding: 40px 15px; }
  .task-list-container { width: 95%; }
  .task-table { overflow-x: auto; display: block; max-width: 100%; }
}

@media (max-width: 768px) {
    .main-content {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .task-list-container {
        width: 100%;
        padding: 10px;
    }
    .notifications-container {
        padding: 20px;
        text-align: center;
    }

    .btn {
        padding: 10px;
        font-size: 14px;
    }
    button, .btn {
        padding: 12px;
        font-size: 14px;
    }

    input, textarea {
        width: 100%;
        font-size: 16px;
        padding: 12px;
    }
    .task-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
    .widget#widget-task-summary .status-box {
        min-width: 120px; /* Adjusts for smaller screens */
        font-size: 1.1rem; /* Slightly smaller font */
    }
    .half-width {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .widget.half-width {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .card.h-100 {
      margin-bottom: 20px;
    }
    .kanban-toast {
      right: 15px;
      bottom: 15px;
      left: 15px;
      margin: 0 auto;
      text-align: center;
    }
}

/* Responsive: collapse to 1 column on smaller screens */
@media screen and (max-width: 1200px) {
    #dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ✅ Grid Layout for Dashboard */
#dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    margin: auto;
}


/* ✅ Ensure All Widgets in the Same Row Have Equal Height */
.row-1, .row-3 {
    align-items: stretch; /* Ensures uniform height */
}
/* ✅ First Row: Notifications & Task Summary */
.row-1 {
    display: flex;
    gap: 30px;
    width: 100%;
    align-items: stretch; /* Ensures same height for all containers */
}

/* ✅ Second Row: Admin Tasks (Full Width) */
.row-2 {
    display: flex;
    width: 100%;
}

/* ✅ Third Row: Overdue Tasks & Tasks Per User */
.row-3 {
    display: flex;
    gap: 30px;
    width: 100%;
    align-items: stretch; /* Ensures consistency */
}

/* ✅ Ensure Widgets Stay Inside Grid */
.widget {
    min-height: 320px;
    height: 100%;
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
    background: var(--task-box-bg);
    color: var(--task-box-text);
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.widget h2, .widget h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: inherit;
  margin-bottom: 16px;
}

/* ✅ Admin Task List - Always Full Width */
.widget.full-width {
    grid-column: span 2;
    width: 100%;
    min-height: 350px; /* Ensure proper height */
}

/* ✅ Maintain Equal Height for Widgets */
.widget-container {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch; /* Ensures all widgets match height */
}

/* ✅ Increased Width for Widgets */
.widget.wide-box {
    width: 70%; /* Ensures better width utilization */
}

/* ✅ Active Drag Effect */
.widget.dragging {
    opacity: 0.5;
    transform: scale(1.01);
}

/* ✅ Fix Chart Height (No Infinite Expansion) */
canvas {
    width: 100% !important;
    height: 280px !important;
    max-height: 280px;
}

/* ✅ Ensure Proper Spacing Between Containers */
.widget:not(:last-child) {
    margin-bottom: 20px;
}

/* 📌 Prevent Dragging Inside Buttons */
.widget button, .widget a {
    pointer-events: auto;
    cursor: pointer;
}

/* 📌 Prevent Buttons & Inner Elements from Being Dragged */
.no-drag, .widget .no-drag {
    pointer-events: auto !important;
    user-select: none;
    cursor: pointer;
}
/* ✅ Dynamic Height Handling for All Boxes */
.widget-container .widget {
    flex-grow: 1;
}
/* ✅ Fix Content Inside Widgets from Overflowing */
.widget-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}
/* ✅ Ensure Proper Spacing Between Containers */
.widget:not(:last-child) {
    margin-bottom: 20px;
}
/* ✅ Dark Mode Compatibility */
body.dark-mode .widget {
    background-color: #1e1e1e;
    color: white;
    border: 1px solid #444;
}

body.dark-mode h2, body.dark-mode h3 {
    color: #fff;
}

body.dark-mode .widget button {
    background: #333;
    color: #fff;
}

body.dark-mode .widget a {
    color: #bbb;
}

button, a, input, textarea {
    pointer-events: auto !important;
    user-select: none;
    cursor: pointer;
}
.dark-mode .widget.user-tasks a,
.dark-mode .widget#widget-notifications a {
    color: #1abc9c !important; /* Highlight buttons/links */
}

/* ✅ Dark Mode Compatibility for Admin Tasks & Notifications */
.dark-mode .widget.admin-tasks,
.dark-mode .widget#widget-notifications {
    background-color: #1e1e1e !important; /* Darker background */
    color: #ffffff !important; /* Light text */
}

.dark-mode .widget.user-tasks .task-item,
.dark-mode .widget#widget-notifications .notification-item {
    background-color: #1f1f1f !important; /* Slightly lighter for contrast */
    border-radius: 8px;
    border-left: 4px solid #00bcd4;
    color: #f0f0f0;
    padding: 10px;
}

.dark-mode .widget.admin-tasks .task-item,
.dark-mode .widget#widget-notifications .notification-item {
    background-color: #1f1f1f !important; /* Slightly lighter for contrast */
    border-radius: 8px;
    border-left: 4px solid #00bcd4;
    color: #f0f0f0;
    padding: 10px;
}

/* ✂️ Truncate long task descriptions gracefully */
.task-item p {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
  max-height: 3.6em;          /* Show approx 2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* Limit to 2 lines */
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-word;
}

.dark-mode .widget.admin-tasks a,
.dark-mode .widget#widget-notifications a {
    color: #1abc9c !important; /* Highlight buttons/links */
}

.dark-mode .widget.user-tasks .task-status {
    background-color: #333 !important;
    color: #fff !important;
}
.dark-mode .widget.admin-tasks .task-status {
    background-color: #333 !important;
    color: #fff !important;
}
/* Apply Dark Mode Styling */
body.dark-mode .task-summary-page {
    background: #1e1e1e !important;
    color: white;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

/* ✅ Centered & Larger Task Summary Content */
.widget#widget-task-summary {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligns title at the top */
    align-items: center; /* Centers content horizontally */
    text-align: center;
}
/* ✅ Ensure Task Summary Boxes are the Same Size */
.widget#widget-task-summary .status-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px; /* Balanced spacing */
    width: 100%;
}

.widget#widget-task-summary .status-box {
    flex: 1;
    min-width: 150px;
    max-width: 160px;
    height: 50px;
    text-align: center;
    padding: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ✅ Improve Readability for Task Summary */
/* ✅ Ensure Task Summary Title is Positioned at the Top */
.widget#widget-task-summary h2 {
    font-size: 1.6rem; /* Matches other containers */
    text-align: center; /* Ensures it's centered */
    margin-bottom: 15px; /* Spacing below the title */
    width: 100%; /* Ensures alignment */
}

/* Adjust Comments & Progress Sections */
.comment-section,
.progress-history {
    width: 100%;
    max-width: 700px;
    background: rgba(0, 0, 0, 0.05); /* Light grey background */
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* Fix comment & progress item styling */
.comment-section .list-group-item,
.progress-history .list-group-item {
    width: 100%;
    background: #fff;
    padding: 12px;
    border-left: 5px solid #007bff;
    border-radius: 6px;
    margin-bottom: 5px;
}

/* 🔹 Dark Mode Fix */
body.dark-mode .comment-section,
body.dark-mode .progress-history {
    background: #1e1e1e !important;
    color: white;
}

body.dark-mode .list-group-item {
    background: #2a2a2a !important;
    color: white !important;
    border-left-color: #17a2b8 !important; /* Blue accent */
}

/* Ensure Navigation Buttons are Consistently Styled */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.nav-buttons a {
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 6px;
    text-align: center;
}
/* Ensure Watch Button is Centered */
.watch-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}
.watch-buttons button {
    width: 150px;
    font-size: 1rem;
}

/* Progress Bar Fix */
.progress-bar-container {
    width: 100%;
    max-width: 400px; /* Prevents excessive width */
}

/* Light Mode Defaults */
:root {
    --primary-color: #00bcd4;
    --text-muted: #777;
    --text-color: #333;
    --task-box-bg: #ffffff;
    --task-box-text: black;
    --task-box-border: #ddd;
    --secondary-color: #6c757d;
    --success-color:   #198754;
    --danger-color:    #dc3545;
}

/* Dark Mode Overrides */
.dark-mode {
    --task-box-bg: #222;
    --task-box-text: white;
    --task-box-border: #444;
}

/* Proper Row Layout with Two Columns */
.dashboard-container .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}

/* Equal width handling */
.half-width {
    flex: 1 1 48%;
    max-width: 48%;
}
.full-width-box {
    width: 100%;
}

/* Two-column layout */
.widget.half-width {
    flex: 0 0 48%;
    max-width: 48%;
}

/* Full-width section */
.widget.full-width-box {
    flex: 0 0 100%;
    max-width: 100%;
}

/* 🛠️ Enforce Consistent Heights Across All Widgets */
.row-1 .widget,
.row-3 .widget {
    min-height: 320px;
    height: 320px;
}
/* ✅ Limit dashboard to two columns max even on wide screens */
#dashboard-grid .row {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}
/* 🧩 Smooth consistent height for task summary + notifications */
#widget-task-summary, #widget-notifications {
    height: 320px !important;
}
.dashboard-footer-button {
    margin-top: 40px;
    padding-bottom: 40px;
}

.dashboard-footer-button .btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 8px;
}
body.dark-mode .workspace-summary {
    color: #e2e8f0; /* soft white */
}

body:not(.dark-mode) .workspace-summary {
    color: #6c757d; /* Bootstrap muted */
}

.theme-default {
    --primary-color: #495057;           /* Dark Gray instead of Blue */
    --sidebar-bg: #f8f9fa;
    --header-bg: #ffffff;
}

.theme-blue {
    --primary-color: #0d6efd;
    --sidebar-bg: #004085;
    --header-bg: #cce5ff;
}

.theme-green {
    --primary-color: #28a745;
    --sidebar-bg: #155724;
    --header-bg: #d4edda;
}

.theme-dark {
    --primary-color: #343a40;
    --sidebar-bg: #212529;
    --header-bg: #1d2124;
}

.theme-purple {
    --primary-color: #6f42c1;
    --sidebar-bg: #4b3d72;
    --header-bg: #e9d8fd;
}

/* Apply theme variables */
body[class*="theme-"] {
    background-color: var(--header-bg);
}

body[class*="theme-"] .sidebar {
    background-color: var(--sidebar-bg);
}

body[class*="theme-"] .top-navbar {
    background-color: var(--primary-color);
    color: white;
}

body[class*="theme-"] .btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Fix Apply Button Alignment in Filter Row */
.filter-form .btn {
  margin-top: 8px;
}
.reset-layout-btn {
  background: #00bcd4;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 500;
  box-shadow: none;
  transition: all 0.3s ease-in-out;
}
.reset-layout-btn:hover {
  background: #008c9e;
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.btn-accent {
  background: #00bcd4;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  padding: 8px 14px;
  transition: all 0.3s ease-in-out;
}


.btn-accent:hover {
  background: #008c9e;
  box-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

.card-body canvas {
  height: 260px !important;
  width: 100% !important;
  object-fit: contain;
}

.kanban-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  max-width: 300px;
  background: #00bcd4;
  color: white;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 0.95rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: none;
  animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
  0%   { opacity: 0; transform: translateY(20px); }
  10%  { opacity: 1; transform: translateY(0); }
  90%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(20px); }
}
/* 🖱️ Widget Hover Interaction */
.widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 188, 212, 0.15), 0 0 8px rgba(0, 188, 212, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 🌑 Dark Mode Hover Effect */
body.dark-mode .widget:hover {
  background-color: #1f1f1f;
  box-shadow: 0 8px 18px rgba(0, 188, 212, 0.2);
}
.widget:active {
  transform: scale(0.98);
  box-shadow: 0 0 12px rgba(0, 188, 212, 0.15);
}

.sidebar ul li ul li {
  padding-left: 1.5rem;
  font-size: 14px;
}

/* When sidebar is collapsed */
.task-drawer {
  position: fixed;
  right: 0;
  top: 64px;                         /* sit clearly below header */
  height: calc(100% - 64px);         /* shorten to match new top */
  width: 800px;
  background: #fff;
  z-index: 1050;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
  border-left: 1px solid rgba(0,0,0,.08);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

body.dark-mode .task-drawer {
  background: #171a1f;                   /* ⬅ same as Filters/Tools */
  color: rgba(255,255,255,.92);
  border-left: 1px solid rgba(255,255,255,.12);
}
/* Parity with Filters/Tools offcanvas: inputs/selects in the drawer */
.task-drawer .form-control,
.task-drawer .form-select {
  border: 1px solid rgba(0,0,0,.28);
  background-color: rgba(255,255,255,.98);
  color: #111;
}
body.dark-mode .task-drawer .form-control,
body.dark-mode .task-drawer .form-select {
  background-color: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.28);
}
body.dark-mode .task-drawer .form-control::placeholder {
  color: rgba(255,255,255,.70);
}

/* Drawer content (single source of truth) */
.task-drawer .task-drawer-content {
  /* fill the drawer; no surprise gutters */
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* Scrollable area you inject HTML into */
#task-drawer-body {
  padding: 16px 16px 24px !important;
  overflow-y: auto;
}

/* Inside the drawer, never center/limit widths */
#task-drawer-body > .task-summary-page.drawer-version {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Nuke Bootstrap container gutters inside the drawer only */
#task-drawer-body .task-summary-page.drawer-version .container {
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Make absolutely sure nothing right-aligns by accident */
#task-drawer .task-drawer-content,
#task-drawer #task-drawer-body {
  text-align: left !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

/* Keep content from overflowing without forcing left skew */
.task-drawer-content * { max-width: 100%; }

.task-drawer-overlay {
  position: fixed;
  top: 64px;                   /* match .top-navbar height */
  left: 0;
  width: calc(100% - 800px);   /* space not covered by the panel */
  height: calc(100vh - 64px);
  z-index: 1040;
  background: rgba(0,0,0,.35);
  display: none;
  pointer-events: none;        /* invisible to mouse when hidden */
}

/* Only clickable/visible when the drawer is marked open */
#task-drawer.open .task-drawer-overlay {
  display: block;
  pointer-events: auto;
}

/* Belt & suspenders: when not open, never catch clicks */
#task-drawer:not(.open) .task-drawer-overlay {
  display: none !important;
  pointer-events: none !important;
}

.task-summary-page.drawer-version {
  width: 100%;
  max-width: none;                      /* fill the full drawer */
  margin: 0;
  padding: 22px 4px 16px 4px;           /* extra top; equal L/R padding */
  background: transparent;              /* drawer provides the bg */
  box-shadow: none;
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
}

.task-summary-page.drawer-version h2,
.task-summary-page.drawer-version p,
.task-summary-page.drawer-version .nav-buttons {
  text-align: left;
}
.close-btn {
  position: absolute;
  top: 50px; /* 🔥 PUSH IT DOWN */
  right: 20px; /* Stay to the right */
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: inherit;
  z-index: 2000;
}
/* === Drawer anti-shift: force content to start at the left edge === */
#task-drawer .task-drawer-content,
#task-drawer #task-drawer-body,
#task-drawer .task-summary-page.drawer-version {
  margin-left: 0 !important;
  max-width: 100% !important;
}

#task-drawer .task-summary-page.drawer-version .container,
#task-drawer .task-summary-page.drawer-version [class*="col-"] {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

#task-drawer .task-summary-page.drawer-version .mx-auto,
#task-drawer .task-summary-page.drawer-version .ms-auto:not(.btn) {
  margin-left: 0 !important;
}

#task-drawer #drawer-comments-list .list-group-item {
  padding-left: 0.75rem; /* keep list readable without creating a left gap */
}
/* When the JS adds .open, the drawer is guaranteed visible */
.task-drawer.open { display: block !important; }

.close-btn:hover {
  color: #ff4d4f;
}
a.mention {
  color: #0d6efd;
  font-weight: 500;
  text-decoration: none;
}
a.mention:hover {
  text-decoration: underline;
}
.mention-suggestions {
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: absolute !important;
  z-index: 999999 !important;
}

.mention-suggestions .list-group-item {
  padding: 6px 10px;
  margin: 0;                     /* ✅ removes spacing between items */
  border: none;                  /* ✅ removes borders between items */
  border-bottom: 1px solid #eee; /* ✅ subtle divider */
  font-size: 0.9rem;
}

.mention-suggestions .list-group-item:last-child {
  border-bottom: none;           /* ✅ no border on last item */
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.alert-error,
.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.icon-muted {
  color: var(--text-muted);
  font-size: 1.25rem;
  vertical-align: middle;
}
body.dark-mode .icon-muted {
  color: #bbbbbb;
}

/* 🧠 Fix dropdown clipping inside responsive tables */
/* ✅ Table Dropdown Fix */
/* ✅ Table cell overflow: clip everywhere; only Actions column stays visible */
.smart-table td {
  overflow: hidden;            /* prevents sideways spill / overlap */
  position: relative;
}

/* Keep dropdowns usable in the Actions column only */
.smart-table td[data-col="actions"] {
  overflow: visible;
}
.smart-table td[data-col="actions"] .dropdown-menu {
  overflow: visible;
}

.table-responsive .dropdown-menu.custom-dropdown-fix {
  z-index: 9999;
  min-width: 180px;
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
  border-radius: 6px;
}

/* Optional/required visual helpers */
.optional-badge {
  font-size: 0.7rem;
  vertical-align: middle;
  padding: 0.15rem 0.35rem;
  border-radius: 0.4rem;
}
/* ===== Velrin: FINAL button overrides (place at very bottom) ===== */
:root {
  --velrin-slate: #2f343b;   /* primary dark slate */
  --velrin-slate-2: #262a30; /* hover/active */
  --velrin-mid:   #444a52;   /* secondary slate */
}

/* 1) Kill neon globally on any .btn-primary left in the codebase */
.btn-primary,
a.btn-primary,
button.btn-primary {
  background-color: var(--velrin-slate) !important;
  border-color:     var(--velrin-slate) !important;
  color:            #fff !important;
  box-shadow: none !important;
}
.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover,
.btn-primary:focus,
a.btn-primary:focus,
button.btn-primary:focus {
  background-color: var(--velrin-slate-2) !important;
  border-color:     var(--velrin-slate-2) !important;
  color:            #fff !important;
  box-shadow: none !important;
}

/* 2) Our house styles (used by Create Task / Apply Filters / Reset etc.) */
.btn-velrin-primary,
a.btn-velrin-primary,
button.btn-velrin-primary {
  background-color: var(--velrin-slate) !important;
  border-color:     var(--velrin-slate) !important;
  color:            #fff !important;
  box-shadow: none !important;
}
.btn-velrin-primary:hover,
a.btn-velrin-primary:hover,
button.btn-velrin-primary:hover,
.btn-velrin-primary:focus,
a.btn-velrin-primary:focus,
button.btn-velrin-primary:focus {
  background-color: var(--velrin-slate-2) !important;
  border-color:     var(--velrin-slate-2) !important;
  color:            #fff !important;
}

.btn-velrin-secondary,
a.btn-velrin-secondary,
button.btn-velrin-secondary {
  background-color: var(--velrin-mid) !important;
  border-color:     var(--velrin-mid) !important;
  color:            #fff !important;
  box-shadow: none !important;
}
.btn-velrin-secondary:hover,
a.btn-velrin-secondary:hover,
button.btn-velrin-secondary:hover,
.btn-velrin-secondary:focus,
a.btn-velrin-secondary:focus,
button.btn-velrin-secondary:focus {
  background-color: #3c424a !important;
  border-color:     #3c424a !important;
  color:            #fff !important;
}

.btn-velrin-outline,
a.btn-velrin-outline,
button.btn-velrin-outline {
  background: transparent !important;
  color:  var(--velrin-slate) !important;
  border: 1px solid var(--velrin-slate) !important;
  box-shadow: none !important;
}
.btn-velrin-outline:hover,
a.btn-velrin-outline:hover,
button.btn-velrin-outline:hover,
.btn-velrin-outline:focus,
a.btn-velrin-outline:focus,
button.btn-velrin-outline:focus {
  background: var(--velrin-slate) !important;
  color:      #fff !important;
  border-color: var(--velrin-slate) !important;
}

/* Icons inside buttons must inherit text color (fixes purple +) */
.btn .bi,
a.btn .bi,
button.btn .bi {
  color: inherit !important;
  fill: currentColor !important;
}

/* Optional: keep same palette in dark mode */
body.dark-mode .btn-velrin-primary,
body.dark-mode a.btn-velrin-primary,
body.dark-mode button.btn-velrin-primary {
  background-color: var(--velrin-slate) !important;
  border-color:     var(--velrin-slate) !important;
  color:            #fff !important;
}
/* ===== Velrin Modern Minimal Overrides ===== */

/* Rounded pill-style buttons */
.btn-rounded {
  border-radius: 50px !important;
  padding: 0.35rem 1rem !important;
  font-size: 0.9rem !important;
}

/* Make Create Task button slimmer */
.btn-velrin-primary.btn-sm {
  font-size: 0.85rem !important;
  padding: 0.35rem 0.9rem !important;
}

/* Fix task ID color (neutral, no blue) */
.task-link {
  color: #2f343b !important;
  text-decoration: none !important;
}
.task-link:hover {
  text-decoration: underline !important;
}
/* ===== Velrin Task List Layout Improvements ===== */

/* Header row spacing (title + button aligned nicely) */
.task-list-container > .d-flex {
  margin-bottom: 1.5rem;
  padding: 0 4px;
}

/* Make Create Task button same height as filters */
.btn-velrin-primary.btn-sm {
  padding: 0.4rem 1rem !important;
  font-size: 0.85rem !important;
}

/* Pill-style buttons everywhere */
.btn-rounded {
  border-radius: 50px !important;
  font-weight: 500;
}

/* Ensure filters line up left like Asana */
form .row.g-3 {
  margin-left: 0;
  margin-right: 0;
  justify-content: flex-start !important;
}

/* Task ID stays neutral, no blue */
.task-link {
  color: #2f343b !important;
  text-decoration: none;
}
.task-link:hover {
  text-decoration: underline !important;
}
/* ===== Asana-like header & filters alignment (final) ===== */

/* Make sure content in this page is left-aligned by default */
.task-list-container { text-align: left; }

/* Filters toolbar: left aligned, wraps nicely, spacing consistent */
.filters-bar {
  row-gap: 10px;
  column-gap: 16px;
}

/* Compact inputs to keep toolbar on one line where possible */
.filters-bar .form-control-sm,
.filters-bar .form-select-sm {
  min-width: 170px;
}

/* Buttons: pill shape and consistent size */
.btn-rounded { border-radius: 999px !important; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

/* Ensure the Create Task icon inherits text color (no purple) */
.btn-velrin-primary .bi { color: inherit !important; fill: currentColor !important; }

/* Keep task ID neutral (not blue) */
.task-link { color: #2f343b !important; text-decoration: none; }
.task-link:hover { text-decoration: underline !important; }

/* Table header remains neutral */
/* Smart-table header colors (light + dark) */
.smart-table thead th {
  background-color: #f3f4f6 !important;     /* light mode header */
  color: #343a40 !important;
  border-bottom: 1px solid #d4d7dc !important;
}
body.dark-mode .smart-table thead th {
  background-color: #2e2e2e !important;     /* dark mode header */
  color: #ffffff !important;
  border-bottom-color: #444 !important;
}

/* keep .thead-darkgray free to avoid fighting with the rule above */
.thead-darkgray th { background-color: inherit !important; color: inherit !important; border-bottom-color: inherit !important; }

/* === Velrin: Actions dropdown overrides === */
.dropdown-menu .dropdown-item {
  color: #212529 !important;          /* neutral dark text */
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background-color: #f1f3f5 !important; /* light gray background */
  color: #212529 !important;           /* keep text dark */
}

/* Keep delete option red */
.dropdown-menu .dropdown-item.text-danger {
  color: #dc3545 !important;
}
.dropdown-menu .dropdown-item.text-danger:hover,
.dropdown-menu .dropdown-item.text-danger:focus {
  background-color: #f8d7da !important; /* pale red bg */
  color: #dc3545 !important;
}

/* Actions cell: pill-shaped trigger + consistent size */
.smart-table td[data-col="actions"] .btn.dropdown-toggle {
  border-radius: 999px !important;
  padding: 6px 14px !important;
  line-height: 1.1 !important;
}

/* Slightly round the dropdown too */
.smart-table td[data-col="actions"] .dropdown-menu {
  border-radius: 10px !important;
}


/* === Page title always left-aligned (in case any global CSS centers H2s) */
.page-title { text-align: left !important; }

/* Caret next to title */
.caret-toggle .bi {
  font-size: 1rem;
  color: inherit;
  transition: transform .15s ease-in-out;
}
.caret-toggle[aria-expanded="true"] .bi {
  transform: rotate(180deg);
}

/* Actions dropdown: neutral grays, not blue */
.dropdown-menu .dropdown-item {
  color: #212529 !important;
}
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background-color: #f1f3f5 !important;
  color: #212529 !important;
}

/* Keep Delete red but with subtle red hover */
.dropdown-menu .dropdown-item.text-danger {
  color: #dc3545 !important;
}
.dropdown-menu .dropdown-item.text-danger:hover,
.dropdown-menu .dropdown-item.text-danger:focus {
  background-color: #f8d7da !important;
  color: #dc3545 !important;
}
.page-title { font-size: 1.25rem; font-weight: 600; }

/* Force page title block to align left */
/* Force page title left-aligned within task list container */
.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  padding: 0;
}

/* Title micro-elevation: matches the soft card hover used on update_progress */
.title-elevate {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: transform .18s ease, box-shadow .18s ease,
              background-color .18s ease, border-color .18s ease;
}

.title-elevate:hover {
  transform: translateY(-1px);
  /* subtle depth + a whisper of cyan like your card hover */
  box-shadow: 0 6px 12px rgba(0,0,0,.12), 0 0 8px rgba(0,188,212,.15);
  background: #ffffff;
  border-color: rgba(0,0,0,.12);
}

/* Dark mode parity */
body.dark-mode .title-elevate {
  background: #1f1f1f;
  border-color: #333;
}
body.dark-mode .title-elevate:hover {
  background: #222;
  box-shadow: 0 6px 14px rgba(0,0,0,.35), 0 0 10px rgba(0,188,212,.18);
  border-color: #3a3a3a;
}

/* Respect reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  .title-elevate, .title-elevate:hover {
    transform: none !important;
    transition: none !important;
  }
}


/* — Page title: always left on the task list page — */
.task-list-container h1,
.task-list-container h2,
.task-list-container h3 {
  text-align: left !important;
}

/* Make the header row stretch full width so it sits flush left */
.page-header {
  width: 100% !important;
  text-align: left !important;
  margin-left: 0 !important;
}
/* Neutralize dropdown active state (no blue) */
.dropdown-menu {
  --bs-dropdown-link-active-bg: #f1f3f5; /* light gray */
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: #f1f3f5 !important;
  color: #212529 !important;
}

/* Keep Delete red, including active */
.dropdown-item.text-danger.active,
.dropdown-item.text-danger:active {
  background-color: #f8d7da !important; /* pale red */
  color: #dc3545 !important;
}
/* Section spacing for task list page */
.task-list-container > .page-header,
.task-list-container form,
.task-list-container .table-responsive,
.task-list-container .mt-4 {
  margin-bottom: 2rem !important; /* add breathing room */
}

/* Optional subtle separator under the header (Asana-like, but soft) */
.page-header {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: .5rem;
  margin-bottom: 1.5rem;
}
/* === Task List Dark Mode Fixes === */

/* Ensure task IDs remain readable in dark mode */
body.dark-mode .task-link {
  color: #e5e7eb !important; /* light gray text */
}
body.dark-mode .task-link:hover {
  color: #ffffff !important; /* brighten fully on hover */
  text-decoration: underline;
}

/* Dropdown menu in dark mode */
body.dark-mode .dropdown-menu {
  background: #2f343b !important;   /* dark slate background */
  color: #f1f3f5 !important;        /* light text */
  border: 1px solid #444a52 !important;
}

/* Dropdown items in dark mode */
body.dark-mode .dropdown-item {
  color: #f1f3f5 !important;
}
body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
  background: #3c424a !important;  /* slightly lighter gray */
  color: #ffffff !important;
}

/* Keep Delete action red even in dark mode */
body.dark-mode .dropdown-item.text-danger {
  color: #f87171 !important; /* softer red */
}
body.dark-mode .dropdown-item.text-danger:hover {
  background: #7f1d1d !important;
  color: #ffffff !important;
}




/* === Task List: Compact Typography & Layout === */
.task-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.task-title { font-size: 1.15rem; font-weight: 600; letter-spacing: .2px; }

.task-nav-row {
  display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px;
}
.task-nav-row a {
  font-size: .9rem; padding: 6px 10px; border-radius: 8px; text-decoration: none;
  border: 1px solid rgba(128,128,128,.25);
}
.task-nav-row a:hover { background: rgba(128,128,128,.08); }

.task-actions { display: flex; align-items: center; gap: 10px; }

.column-picker .dropdown-menu {
  padding: 10px 10px; min-width: 220px; max-height: 320px; overflow: auto;
  font-size: .9rem;
}
.column-picker .form-check { margin-bottom: 6px; }

/* Smart, dense table */
.smart-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.smart-table thead th {
  font-size: .85rem; font-weight: 600; padding: 8px 10px; white-space: nowrap;
  border-bottom: 1px solid rgba(128,128,128,.3);
}
.smart-table tbody td {
  font-size: .9rem; padding: 8px 10px; vertical-align: middle;
  border-bottom: 1px solid rgba(128,128,128,.15);
}
.smart-table .cell-tight { white-space: nowrap; }
.smart-table .cell-w { max-width: 420px; }
.smart-table .cell-clip {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.smart-table .progress-cell { min-width: 120px; }

/* Thin separators & adaptive backgrounds */
.table-surface {
  background: transparent;
  backdrop-filter: none;
}

/* Dark mode friendliness via prefers-color-scheme */
@media (prefers-color-scheme: dark) {
  .task-nav-row a { border-color: rgba(255,255,255,.15); }
  .task-nav-row a:hover { background: rgba(255,255,255,.06); }
  .smart-table thead th { border-bottom-color: rgba(255,255,255,.25); }
  .smart-table tbody td { border-bottom-color: rgba(255,255,255,.12); }
}

.smart-table thead th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
/* Due date colors (global, all widths) */
.smart-table td.due-danger  { color: #c62828 !important; font-weight: 600; }
.smart-table td.due-warning { color: #ef6c00 !important; font-weight: 600; }
.smart-table td.due-neutral { color: inherit !important; opacity: .95; }

/* On laptop-ish widths, allow the longer headers to wrap to 2 lines */
@media (max-width: 1500px) {
/* Allow long header labels to wrap (instead of ellipsis) */
  .smart-table thead th[data-col="description"],
  .smart-table thead th[data-col="assigner"],
  .smart-table thead th[data-col="assignee"] {
    white-space: normal;       /* override thead's nowrap */
    line-height: 1.1;
    word-break: keep-all;
    hyphens: auto;
  }

/* Compact buttons and icons */
.btn-compact { padding: 4px 10px; font-size: .9rem; border-radius: 8px; }
.icon-compact { font-size: .95rem; line-height: 1; }

/* Offcanvas filter drawer width tweaks */
.offcanvas-filters { width: min(520px, 94vw); }
/* Unify the Filters/Tools/Task drawers palette & spacing */
.offcanvas-filters{
  background: #fff !important;
  color: #111 !important;
}
body.dark-mode .offcanvas-filters{
  background: #171a1f !important;
  color: rgba(255,255,255,.92) !important;
}

/* Consistent header & body spacing so content never overlaps */
.offcanvas-filters .offcanvas-header{
  min-height: 56px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body.dark-mode .offcanvas-filters .offcanvas-header{
  border-bottom-color: rgba(255,255,255,.12);
}
.offcanvas-filters .offcanvas-body{
  padding: 16px 16px 20px 16px;
}

/* Table responsiveness: allow horizontal scroll on very small screens */
.responsive-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Table responsiveness: allow horizontal scroll only on tight screens */
.responsive-wrap table { min-width: 760px; }

/* === Velrin task list clarity tweaks (override) === */
/* === Velrin task list clarity tweaks (updated: no zebra; clear background) === */
.smart-table tbody tr:nth-child(even) td {
  background-color: transparent !important;
}
@media (prefers-color-scheme: dark) {
  .smart-table tbody tr:nth-child(even) td {
    background-color: transparent !important;
  }
}

/* Make header action buttons truly compact and aligned */
.task-nav-row a { line-height: 1.2; }
.task-actions .btn, .btn-compact, .btn-velrin-outline.btn-sm, .btn-velrin-primary.btn-sm {
  padding: 6px 10px !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
}

/* Keep offcanvas body inputs nicely spaced */
.offcanvas-filters .form-label { font-size: 0.9rem; }
.offcanvas-filters .form-control, .offcanvas-filters .form-select { font-size: 0.95rem; }

/* Ensure table never overlaps the sidebar layout */
.task-list-container .responsive-wrap { overflow-x: auto; }
/* === Smart table: clear backgrounds; keep subtle separators === */
/* === Smart table: clear backgrounds; keep subtle separators === */
.smart-table tbody td {
  background-color: transparent !important; /* keep body cells transparent */
}
/* header color handled above */

/* we already have subtle separators via border-bottom on .smart-table td/th */
/* === Scope dark-mode overrides away from smart-table === */
body.dark-mode .smart-table td,
body.dark-mode .smart-table th {
  background-color: transparent !important;
}
/* === Due date colors: ensure they win over .table td color rules === */
.smart-table td.due-danger,
.smart-table tbody td.due-danger {
  color: #c62828 !important; /* red: due today or overdue */
}

.smart-table td.due-warning,
.smart-table tbody td.due-warning {
  color: #ef6c00 !important; /* orange: due within 3 days */
}

.smart-table td.due-neutral,
.smart-table tbody td.due-neutral {
  color: inherit !important;  /* normal text */
  opacity: 0.95;
}
.smart-table td.due-danger { text-decoration: underline; text-underline-offset: 2px; }

/* --- Task List: centered content rail, no edge-to-edge on large screens --- */
main.main-content[data-page="tasks"] .task-list-container.task-page-wrap {
  max-width: clamp(1200px, 92vw, 1600px);
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(16px, 2.5vw, 28px);
}

/* table wrapper remains flexible and scrollable when needed */
main.main-content[data-page="tasks"] .task-page-wrap .responsive-wrap,
main.main-content[data-page="tasks"] .task-page-wrap .smart-table {
  width: 100%;
}

/* keep last column visible; allow horizontal scroll when genuinely tight */
main.main-content[data-page="tasks"] .responsive-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* Sidebar collapsed → expand main area (reclaim the sidebar width) */
.sidebar.collapsed ~ main.main-content {
  width: calc(100vw - 60px) !important;  /* 60px = collapsed sidebar width */
  margin-left: 60px !important;
}
/* Sidebar open (default) → main content width = viewport - sidebar */

/* Make sure the table actually stretches */
.task-page-wrap .responsive-wrap,
.task-page-wrap .smart-table {
  width: 100%;
}

/* Optional: while collapsed, keep things visually centered */
.sidebar.collapsed ~ main.main-content:has(.task-page-wrap) .task-page-wrap {
  margin-inline: auto;
}

/* Centered inner wrapper that can expand nicely */
.task-list-container.task-page-wrap {
  box-sizing: border-box !important;
  width: 100% !important;
  margin-inline: auto !important;  /* stays centered */
  align-items: stretch !important;
}

/* Table container: allow horizontal scroll on tight screens (prevents right overflow) */
.task-page-wrap .responsive-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.task-page-wrap .smart-table {
  width: 100%;
}

/* === Task pages sizing (no :has()) === */
@media (max-width: 992px) {
  main.main-content,
  .sidebar.collapsed ~ main.main-content {
    width: 100vw;
    margin-left: 0;
    padding: 72px 16px 24px 16px;
  }
}

/* Ensure the task table stretches within the content area */
.task-list-container.task-page-wrap,
.task-page-wrap .responsive-wrap,
.task-page-wrap .smart-table {
  max-width: none;
  width: 100%;
}

.smart-table th,
.smart-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;               /* default: keep rows compact */
}

/* Allow wrapping on specific cells if you prefer (opt-in) */
/* .smart-table td.cell-wrap { white-space: normal; } */

/* Nav row should wrap instead of pushing layout wide */
.task-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

/* Due date colors must override generic table text colors */
.smart-table td.due-danger,
.smart-table tbody td.due-danger { color: #c62828 !important; font-weight: 600; }

.smart-table td.due-warning,
.smart-table tbody td.due-warning { color: #ef6c00 !important; font-weight: 600; }

.smart-table td.due-neutral,
.smart-table tbody td.due-neutral { color: inherit !important; opacity: .95; }
@media (max-width: 1200px) {
  .smart-table { min-width: 900px; }
}
@media (max-width: 992px) {
  .smart-table { min-width: 760px; }
}
/* --- Click-to-sort indicators --- */
.smart-table th.sortable { cursor: pointer; user-select: none; }
.smart-table th.sortable::after { content: ''; margin-left: 6px; opacity: .5; }
.smart-table th.sortable.th-sort-asc::after  { content: '▲'; }
.smart-table th.sortable.th-sort-desc::after { content: '▼'; }

/* Column hiding — ensure it wins against table skins */
.smart-table th.col-hidden,
.smart-table td.col-hidden {
  display: none !important;
}

/* --- Column width rails (prevents crowding/overlap) --- */
/* Column width rails (safe minimums) */
/* --- Column width rails (compact) --- */
.smart-table th[data-col="id"], .smart-table td[data-col="id"]         { width: 140px; min-width: 120px; }
.smart-table th[data-col="title"], .smart-table td[data-col="title"]   { min-width: 160px; }
.smart-table th[data-col="description"], .smart-table td[data-col="description"] { min-width: 180px; } /* was 320 */
.smart-table th[data-col="assigner"], .smart-table td[data-col="assigner"],
.smart-table th[data-col="assignee"], .smart-table td[data-col="assignee"] { min-width: 120px; }
.smart-table th[data-col="status"], .smart-table td[data-col="status"] { width: 110px; min-width: 100px; }
.smart-table th[data-col="priority"], .smart-table td[data-col="priority"] { width: 110px; min-width: 100px; }
.smart-table th[data-col="due"], .smart-table td[data-col="due"]       { width: 120px; min-width: 110px; }
.smart-table th[data-col="progress"], .smart-table td[data-col="progress"] { width: 120px; min-width: 110px; }
.smart-table th[data-col="actions"], .smart-table td[data-col="actions"]   { width: 120px; min-width: 110px; }


.smart-table th[data-col="sel"], .smart-table td[data-col="sel"]         { width: 54px;  min-width: 54px; }  /* checkbox column */
.smart-table th[data-col="created"], .smart-table td[data-col="created"] { width: 140px; min-width: 120px; } /* date column */

/* === Rails for Workspace & Project smart-tables === */
.smart-table th[data-col="name"],    .smart-table td[data-col="name"]    { min-width: 200px; }
.smart-table th[data-col="plan"],    .smart-table td[data-col="plan"]    { width: 140px; min-width: 120px; }
.smart-table th[data-col="projects"],.smart-table td[data-col="projects"]{ width: 120px; min-width: 100px; text-align: center; }
.smart-table th[data-col="tasks"],   .smart-table td[data-col="tasks"]   { width: 120px; min-width: 100px; text-align: center; }
.smart-table th[data-col="desc"],    .smart-table td[data-col="desc"]    { min-width: 260px; }
.smart-table th[data-col="actions"], .smart-table td[data-col="actions"] { width: 220px; min-width: 180px; }


/* Ensure the ID text itself can ellipsis */
td[data-col="id"] .task-link { display:inline-block; max-width:100%; overflow:hidden; text-overflow:ellipsis; }

/* At high zoom / smaller viewports, allow wrapping on the text-heavy columns */
@media (max-width: 1440px) {
  .smart-table td[data-col="title"],
  .smart-table td[data-col="description"] { white-space: normal; }
  .smart-table th, .smart-table td { padding: 6px 8px; }
}

@media (max-width: 1400px) {
  .smart-table thead th {
    font-size: 0.95rem;
  }
}
/* Let the task page use the entire content width even if base.html wraps in .container */
/* Break out of Bootstrap's container on the task page */
main.main-content:has(.task-page-wrap) > .container,
main.main-content:has(.task-page-wrap) > .container-lg,
main.main-content:has(.task-page-wrap) > .container-xl,
main.main-content .container:has(.task-page-wrap) {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Keep the inner wrapper full-width and centered */
.task-list-container.task-page-wrap {
  max-width: none !important;
  width: 100% !important;
  margin-inline: auto !important;
}

/* The scroll container and table should always span 100% of their parent */
.task-page-wrap .responsive-wrap,
.task-page-wrap .smart-table {
  width: 100% !important;
}

/* ---- FINAL GUARD: make sure task pages clear the fixed top navbar ---- */
/* ---- FINAL GUARD: make sure task pages clear the fixed top navbar ---- */
main.main-content[data-page="tasks"] {
  /* let JS set the real value; 120px is a safe fallback */
  padding-top: var(--content-top-pad, 120px) !important;
  padding-right: var(--rail-gutter, 24px) !important;
  padding-left: var(--rail-gutter, 24px) !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Sidebar open vs collapsed margins – let base.js keep these in sync. */
.sidebar ~ main.main-content[data-page="tasks"] { margin-left: 250px !important; }
.sidebar.collapsed ~ main.main-content[data-page="tasks"] { margin-left: 60px !important; }
/* Inner rail/gutter for the task page content */
.task-content-fluid {
  padding-left: clamp(16px, 2.5vw, 40px) !important;
  padding-right: clamp(16px, 2.5vw, 40px) !important;
}
/* === FINAL GUARD: task list fills the rail at all widths === */
main.main-content { max-width: none !important; }

main.main-content .task-list-container.task-page-wrap,
main.main-content .task-page-wrap .responsive-wrap,
main.main-content .task-page-wrap .smart-table {
  max-width: none !important;
  width: 100% !important;
}

/* Drive layout from margin + width so the content never “spills” to the right */
main.main-content {
  box-sizing: border-box;
  margin-left: 250px;                        /* open sidebar width */
  width: calc(100vw - 250px);                /* fill the remainder – no right gap */
  padding: 0 clamp(24px, 2.5vw, 40px) 32px;
  transition: margin-left .24s ease, width .24s ease; /* match sidebar timing */
}

.sidebar.collapsed ~ main.main-content {
  margin-left: 60px;                         /* collapsed sidebar width */
  width: calc(100vw - 60px);                 /* keep table full-width of content rail */
}

/* Comfy left/right gutter so the table never hugs the sidebar */
:root { --rail-gutter: clamp(24px, 4vw, 72px); }
main.main-content[data-page="tasks"] {
  padding-left: var(--rail-gutter) !important;
  padding-right: var(--rail-gutter) !important;
}
/* === Task table: universal responsive behavior (final override) === */
/* Density + legibility: slightly smaller, consistent table text */
.smart-table thead th { font-size: 0.86rem !important; padding: 6px 10px !important; }
.smart-table tbody td { font-size: 0.86rem !important; padding: 8px 10px !important; }

/* Very large displays: nudge text down a hair to prevent “zoomed” look */
@media (min-width: 1920px) {
  .smart-table thead th,
  .smart-table tbody td { font-size: 0.88rem !important; }
}


/* Page frame: gently inset from both edges on ANY screen, including TVs */
.task-content-fluid {
  /* side gutters: 20px on tiny screens, scale up to 64px on huge ones */
  padding-left: clamp(20px, 3.5vw, 64px) !important;
  padding-right: clamp(20px, 3.5vw, 64px) !important;
}

/* The scroll container: never crop horizontally; always allow scrolling */
.responsive-wrap {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

/* Table sizing: never “collapse away” columns; scroll instead if needed */
/* Smart table: scale-aware so it can fit on small laptops without page zoom */
.smart-table {
  table-layout: fixed !important;
  width: calc(100% / var(--tbl-scale, 1)) !important;
  min-width: var(--smart-min, 1150px) !important;
  transform: translateZ(0) scale(var(--tbl-scale, 1)); /* crisper text when scaled */
  transform-origin: left top;
  will-change: transform;
}

/* keep the picker interactive and open while clicking inside it */
.column-picker .dropdown-menu { z-index: 2000; overscroll-behavior: contain; }
.column-picker .form-check input.col-toggle,
.column-picker .form-check label { pointer-events: auto; }

/* Text overflow safety so cells don’t bulge */
.smart-table th,
.smart-table td {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Column picker: actually hide things when JS adds .col-hidden */
.smart-table .col-hidden {
  display: none !important;
}

/* Keep Actions column usable (dropdowns can overflow) */
.smart-table td[data-col="actions"] { overflow: visible !important; }

/* Extra polish on ultra-wide displays: keep the grid visually centered */
@media (min-width: 1600px) {
  .task-content-fluid {
    max-width: 96vw;              /* let the rail grow on TVs/projectors */
    margin-inline: auto;
  }
}

/* Safety: if JS hasn’t run yet, don’t let the title hide under the fixed navbar */
main.main-content { padding-top: max(72px, var(--content-top-pad, 0px)); }

/* Ensure the column picker interactions don’t get eaten by dropdown closing */
.column-picker .dropdown-menu { overscroll-behavior: contain; }
.column-picker .form-check input.col-toggle,
.column-picker .form-check label { pointer-events: auto; }

/* === Dark-mode legibility tweaks (outline buttons & notes) === */
/* === Dark-mode legibility tweaks (outline buttons & notes) === */
@media (prefers-color-scheme: dark) {
  .btn-velrin-outline,
  .btn-velrin-outline:visited {
    color: #e9ecef;           /* light gray text for contrast */
    border-color: #e9ecef;    /* matching border */
  }
  .btn-velrin-outline:hover,
  .btn-velrin-outline:focus {
    background-color: rgba(233,236,239,.10);
    color: #f8f9fa;
    border-color: #f8f9fa;
  }
  .audit-note {               /* stronger muted note in dark mode */
    color: rgba(255,255,255,.80) !important;
  }
}

/* If you use Bootstrap 5's color modes via data attribute, these ensure coverage */
[data-bs-theme="dark"] .btn-velrin-outline,
[data-bs-theme="dark"] .btn-velrin-outline:visited {
  color: #e9ecef;
  border-color: #e9ecef;
}
[data-bs-theme="dark"] .btn-velrin-outline:hover,
[data-bs-theme="dark"] .btn-velrin-outline:focus {
  background-color: rgba(233,236,239,.10);
  color: #f8f9fa;
  border-color: #f8f9fa;
}
[data-bs-theme="dark"] .audit-note {
  color: rgba(255,255,255,.80) !important;
}
/* === Notifications: prevent horizontal overflow & improve dark-mode legibility === */

/* Make the message link shrink/ellipsis correctly next to the action button */
.list-group-item.d-flex { gap: .5rem; }              /* subtle space between message & actions */
.notification-link { flex: 1 1 auto; min-width: 0; } /* allow the text to shrink */
.notification-timestamp { opacity: .8; }

/* Multi-line clamp + safe wrapping for long or unbroken content */
.notif-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;          /* show at most 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;        /* break very long URLs/tokens */
}

/* Enhanced filter UI width */
.notif-filter-wrap { max-width: 280px; }
.notif-filter { min-width: 180px; }

/* Dark-mode polish for input group + select */
@media (prefers-color-scheme: dark) {
  .notif-filter-wrap .input-group-text {
    background-color: rgba(255,255,255,.08);
    color: #e9ecef;
    border-color: rgba(255,255,255,.15);
  }
  .notif-filter {
    background-color: rgba(255,255,255,.04);
    color: #e9ecef;
    border-color: rgba(255,255,255,.15);
  }
}
/* Also support Bootstrap's explicit dark theme */
[data-bs-theme="dark"] .notif-filter-wrap .input-group-text {
  background-color: rgba(255,255,255,.08);
  color: #e9ecef;
  border-color: rgba(255,255,255,.15);
}
[data-bs-theme="dark"] .notif-filter {
  background-color: rgba(255,255,255,.04);
  color: #e9ecef;
  border-color: rgba(255,255,255,.15);
}
/* === Notifications: themed container + readable "read" state === */
.notif-list { background-color: var(--bs-body-bg); } /* light mode keeps body bg */
@media (prefers-color-scheme: dark) {
  .notif-list { background-color: rgba(255,255,255,.03); } /* subtle fill in dark */
  .notif-read { background-color: rgba(255,255,255,.035); } /* gentle contrast for read */
}
[data-bs-theme="dark"] .notif-list { background-color: rgba(255,255,255,.03); }
[data-bs-theme="dark"] .notif-read { background-color: rgba(255,255,255,.035); }

/* Ensure read text uses theme-aware secondary color, not too dim */
.notif-read .notification-link.text-body-secondary { opacity: 1; }

/* Keep items tidy even with long messages */
.list-group-item.d-flex { gap: .5rem; }
.notification-link { flex: 1 1 auto; min-width: 0; }
.notif-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;     /* 2-line clamp */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* === Backlog: keep titles from forcing horizontal scroll === */
.title-col { /* optional width hint, remove if you prefer auto */
  /* width: 38%; */
}
.cell-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;          /* show at most 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;         /* break very long tokens/URLs */
  overflow-wrap: anywhere;
  line-height: 1.3;
}
/* Backlog table title clipping */
.title-col { max-width: 380px; }
@media (max-width: 1200px) { .title-col { max-width: 320px; } }
@media (max-width: 992px)  { .title-col { max-width: 280px; } }
@media (max-width: 768px)  { .title-col { max-width: 220px; } }
.cell-title {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ===== Reports: filled filter toolbar (light/dark) ===== */
.reports-toolbar {
  background: var(--panel-bg, rgba(0,0,0,0.03));
  border: 1px solid rgba(0,0,0,0.08);
}
html[data-theme="dark"] .reports-toolbar {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

/* Make long titles behave in tables */
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* (Optional) tighten small column cells */
.cell-tight { white-space: nowrap; }

/* Ensure smart-table rail widths play nice here too (same rails as task list) */
.smart-table [data-col="id"]       { width: 120px; min-width: 110px; }
.smart-table [data-col="title"]    { min-width: 180px; }
.smart-table [data-col="user"]     { min-width: 120px; }
.smart-table [data-col="status"]   { width: 110px; min-width: 100px; text-align: center; }
.smart-table [data-col="priority"] { width: 110px; min-width: 100px; text-align: center; }
.smart-table [data-col="progress"] { width: 120px; min-width: 110px; text-align: center; }
.smart-table [data-col="due"]      { width: 120px; min-width: 110px; text-align: center; }
.smart-table [data-col="created"]  { width: 130px; min-width: 120px; text-align: center; }
.smart-table [data-col="actions"]  { width: 130px; min-width: 120px; }

/* Robust two-up layout for report charts (scoped) */
.reports-row { display: flex; flex-wrap: wrap; }
.reports-row > .col { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) {
  .reports-row > .col { flex: 0 0 50%; max-width: 50%; }
}
/* === Reports: robust two-up layout (immune to .row overrides) === */
.reports-charts { 
  display: flex !important; 
  flex-direction: column; 
  gap: 1rem; 
  width: 100%;
}
@media (min-width: 768px) {
  .reports-charts { flex-direction: row; }
}
.reports-card {
  flex: 1 1 0;
  min-width: 320px;
}
.report-chart {
  width: 100% !important;
  height: 320px !important; /* keeps good aspect horizontally */
}

/* optional: tidy the filter bar */
.reports-toolbar {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
}
/* Scope row direction changes ONLY to the dashboard grid */
#dashboard-grid .row {
        flex-direction: column;
}
/* === Reports: robust two-up layout (immune to .row overrides) === */
.reports-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}
.reports-row > .col {
  flex: 1 1 100%;
  max-width: 100%;
}
@media (min-width: 768px) {
  .reports-row > .col {
    flex: 0 0 calc(50% - .5rem);
    max-width: calc(50% - .5rem);
  }
}

/* Reports cards behave nicely in the flex row */
.reports-card {
  flex: 1 1 auto;
  min-width: 320px;
}

/* Consistent chart sizing */
.report-chart {
  width: 100% !important;
  height: 320px !important;
}

/* Match Velrin button styles in reports */
.reports-toolbar .btn {
  border-radius: 9999px;
}
/* === Reports: robust two-up layout (independent of .row rules) === */
.reports-charts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}
.reports-charts > .reports-card,
.reports-charts > .col {
  flex: 1 1 100%;
  max-width: 100%;
}
@media (min-width: 768px) {
  .reports-charts > .reports-card,
  .reports-charts > .col {
    flex: 0 0 calc(50% - .5rem);
    max-width: calc(50% - .5rem);
  }
}

/* Keep cards tidy and canvases predictable */
.reports-card { min-width: 320px; }
.report-chart { width: 100% !important; height: 320px !important; }

/* === Reports: two-up grid layout (wins over any .row/.col overrides) === */
.reports-charts {
  display: grid !important;
  grid-template-columns: 1fr;   /* stacked on phones */
  gap: 1rem;
  align-items: stretch;
}

@media (min-width: 768px) {
  .reports-charts {
    grid-template-columns: 1fr 1fr; /* side-by-side from md+ */
  }
}

/* Make sure cards and canvases behave nicely inside grid */
.reports-card { min-width: 0; }
.report-chart { width: 100% !important; height: 320px !important; }
/* === FINAL authoritative layout for reports === */
.reports-charts {
  display: grid !important;
  grid-template-columns: 1fr; /* stack on phones */
  gap: 1rem;
  align-items: stretch;
}
@media (min-width: 768px) {
  .reports-charts { grid-template-columns: 1fr 1fr; } /* side-by-side from md+ */
}

/* Make sure cards never stretch the full container height */
.reports-card { height: auto !important; }

/* Keep canvas height reasonable; Chart.js is set to maintainAspectRatio:false */
.report-chart { height: 320px !important; width: 100% !important; }
/* Reports layout helpers */
.report-chart { height: 320px; max-height: 42vh; }
.card .card-body { position: relative; } /* helps Chart.js measure correctly */

/* Reports: allow chart cards to expand (override global .card max-width:500px) */
#adminReportsGrid .card,
#userReportsGrid .card {
  max-width: none !important;
  flex: 1 1 auto; /* harmless in grid, useful if flex is used */
}
/* Ensure action cells center contents across tables */
td[data-col="actions"] { text-align: center; }

.task-nav-row { margin-bottom: .5rem; }

/* keep action menus neat across tables */
.custom-dropdown-fix { min-width: 12rem; }

.page-header{display:flex;align-items:center;justify-content:space-between}
.title-elevate{transition:box-shadow .2s ease}
.title-elevate:hover{box-shadow:0 2px 10px rgba(0,0,0,.06)}
.page-title{font-size:1.5rem}
.caret-toggle{border-radius:10px}

/* === Kanban: fluid grid and compact density ================================= */

/* Sidebar-aware main width (uses the sb-collapsed class we standardized in base) */
html:not(.sb-collapsed) .task-content-fluid { --sidebar-w: 260px; }
html.sb-collapsed .task-content-fluid { --sidebar-w: 74px; }

/* Column min width responds to sidebar state */
html:not(.sb-collapsed) .kanban-compact { --kb-col-min: 240px; } /* sidebar open -> slightly narrower */
html.sb-collapsed .kanban-compact      { --kb-col-min: 280px; } /* sidebar collapsed -> a bit wider */

/* Compact density on Kanban page only */
.kanban-compact {
  --kb-font-scale: 0.94;
  --kb-col-min: 260px;          /* min width per column */
  --kb-gap: 12px;               /* gap between columns */
  --kb-header-py: .55rem;       /* column header vertical padding */
  --kb-body-pad: .6rem;         /* card area padding */
  --kb-card-pad: .5rem .6rem;   /* individual card padding */
  --kb-title-size: 1.425rem;    /* page title slightly smaller */
}

/* Page title scale + hover stays intact */
.kanban-compact .page-title { font-size: var(--kb-title-size); }

/* The grid itself: expands/contracts harmoniously with the sidebar */
.kanban-compact #kanban-container.kanban-container {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--kb-col-min);  /* fixed column width */
  grid-template-columns: none;
  gap: var(--kb-gap);
  width: 100%;
  overflow-x: auto !important;            /* ← never hide our safety scroll */
  overscroll-behavior-inline: contain;    /* nice trackpad feel */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;                    /* smooth horizontal drag on touchpads */
}

/* Zoom-to-fit rail: JS sets --kb-scale based on column count & viewport */
.kanban-compact #kanban-container {
  /* scale is already driven by JS via --kb-scale */
  transform: translateZ(0) scale(var(--kb-scale));
  transform-origin: left top;

  /* compensate the scaled width so the rail always fits the viewport */
  width: calc(100% / var(--kb-scale));

  /* make sidebar open/close feel smooth */
  transition: transform .22s ease, width .22s ease;
  will-change: transform, width;

  /* keep layout steady when scrollbars appear/disappear */
  scrollbar-gutter: stable both-edges;
}

/* Column framing */
.kanban-compact .kanban-column {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .75rem;
  background: var(--bs-body-bg);
  min-width: 0; /* prevent grid overflow/cropping */
}

/* Column header/body spacing */
.kanban-compact .kanban-column-header {
  padding: var(--kb-header-py) .85rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-size: calc(1rem * var(--kb-font-scale));
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: space-between;
}
.kanban-compact .kanban-column-body {
  padding: var(--kb-body-pad);
  max-height: calc(100vh - 325px);
  overflow: auto;
}

/* Cards: slightly tighter */
.kanban-compact .kanban-card {
  padding: var(--kb-card-pad);
  font-size: calc(1rem * var(--kb-font-scale));
  margin-bottom: .5rem;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .75rem;
  position: relative;
  transition: background-color .2s, box-shadow .2s;
}
.kanban-compact .kanban-card:hover { background-color: #f1f1f1; box-shadow: 0 3px 12px rgba(0,0,0,.06); }
body.dark-mode .kanban-compact .kanban-card:hover { background-color: #2a2a2a; }

/* Clamp descriptions (works with your 'desc' class in kanban_cards.html) */
.kanban-compact .kanban-card .desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Overdue accent remains subtle in compact density */
.kanban-compact .kanban-card.overdue {
  border-left: 3px solid #dc3545;
  padding-left: .5rem;
}

/* Reduce nav row and toolbar footprint */
.kanban-compact .task-nav-row a { font-size: .95rem; padding: .25rem .4rem; }
.kanban-compact .btn.btn-sm { padding: .28rem .6rem; }

/* Dark mode borders */
body.dark-mode .kanban-compact .kanban-column { border-color: rgba(255,255,255,.12); }
body.dark-mode .kanban-compact .kanban-column-header { border-bottom-color: rgba(255,255,255,.12); }

/* === Kanban XS density (smaller columns & text) === */
.kanban-compact.kanban-dense {
  --kb-font-scale: 0.86;      /* was 0.94 */
  --kb-col-min: 200px;        /* was 220px */
  --kb-gap: 10px;             /* was 12px */
  --kb-header-py: .45rem;     /* was .55rem */
  --kb-body-pad: .45rem;      /* was .6rem */
  --kb-card-pad: .4rem .5rem; /* was .5rem .6rem */
}

/* slightly smaller column header text */
.kanban-compact.kanban-dense .kanban-column-header { 
  font-size: .95rem; 
}

/* smaller card title + meta */
.kanban-compact.kanban-dense .kanban-card h5 { 
  font-size: .95rem; 
  margin-bottom: .25rem; 
}
.kanban-compact.kanban-dense .kanban-card small { 
  font-size: .75rem; 
}

/* calmer hover on dense cards (avoid looking “bulky”) */
.kanban-compact.kanban-dense .kanban-card:hover { 
  transform: scale(1.01);    /* override any larger global hover */
}

/* Keep Eject button interactive even if the card has an overlay/stretched link */
.kanban-card .eject-btn {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

/* Keep the Eject button above any stretched-link/overlay */
.kanban-card { position: relative; }
.kanban-card .eject-btn {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

/* Kanban: ensure card buttons remain clickable (even if 'stretched-link' sneaks back in) */
.kanban-card { position: relative; }
.kanban-card .kanban-card-link { position: static; }
.kanban-card .kanban-card-link::after { display: none !important; }
.kanban-card .eject-btn { position: relative; z-index: 5; pointer-events: auto; }

/* Slightly tighter header bottom to read as one piece */
.table-shell .smart-table thead th {
  border-bottom-color: rgba(0,0,0,.12);
}

/* Dark mode border nuance */
@media (prefers-color-scheme: dark) {
  .table-shell {
    border-color: rgba(255,255,255,.14);
    background: var(--bs-body-bg, #1f1f1f);
  }
  .table-shell .smart-table thead th {
    border-bottom-color: rgba(255,255,255,.18);
  }
}
.table-shell.rounded-4 { border-radius: 18px; }
.table-shell.shadow-sm  { box-shadow: 0 6px 16px rgba(0,0,0,.06); }

/* Rounded header corners */
.table-shell .smart-table thead th:last-child {
  border-top-right-radius: inherit;
}

/* Rounded bottom corners (last row) */
.table-shell .smart-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: inherit;
}
.table-shell .smart-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: inherit;
}
/* Strong rounded container for task list table (clips header & body) */
.table-shell { 
  border-radius: 14px;                /* rounded like widgets */
  overflow: hidden !important;        /* force clipping at the shell */
  background: var(--bs-body-bg, #fff);
  border: 1px solid rgba(0,0,0,.08);
}

/* make the header cells take the curve explicitly (win the cascade) */
.table-shell .smart-table thead th:first-child  { border-top-left-radius: 14px !important; }
.table-shell .smart-table thead th:last-child   { border-top-right-radius: 14px !important; }
.table-shell .smart-table tbody tr:last-child td:first-child { border-bottom-left-radius: 14px !important; }

/* Strong rounded container for tables (clips header & body) */
.table-shell{
  border-radius:14px;
  overflow:hidden !important;
  background:var(--bs-body-bg,#fff);
  border:1px solid rgba(0,0,0,.08);
}
.table-shell>.table-responsive{
  border-radius:inherit !important;
  overflow:hidden !important;
  background:inherit;
}
.table-shell .smart-table{
  border-collapse:separate !important;
  border-spacing:0 !important;
  border-radius:inherit !important;
  overflow:hidden !important;
}
.table-shell .smart-table thead th:first-child{border-top-left-radius:14px !important;}
.table-shell .smart-table thead th:last-child{border-top-right-radius:14px !important;}
.table-shell .smart-table tbody tr:last-child td:first-child{border-bottom-left-radius:14px !important;}
.table-shell .smart-table tbody tr:last-child td:last-child{border-bottom-right-radius:14px !important;}
.table-shell .smart-table thead th,
.table-shell .smart-table tbody td{background-clip:padding-box !important;}

/* ===== Rounded tables: ensure all 4 corners are curved & clipped ===== */
.table-shell { --tbl-radius: 18px; border-radius: var(--tbl-radius); overflow: hidden !important; }
.table-shell.rounded-4 { border-radius: var(--tbl-radius); }

/* Top corners (thead) */
.table-shell .smart-table thead th:first-child  { border-top-left-radius: var(--tbl-radius) !important; }
.table-shell .smart-table thead th:last-child   { border-top-right-radius: var(--tbl-radius) !important; }

/* Bottom corners for tbody-only tables */
.table-shell .smart-table tbody tr:last-of-type td:first-child { border-bottom-left-radius: var(--tbl-radius) !important; }
.table-shell .smart-table tbody tr:last-of-type td:last-child  { border-bottom-right-radius: var(--tbl-radius) !important; }
.table-shell .smart-table tbody tr:last-of-type td { border-bottom: 0 !important; }

/* If a table has a <tfoot>, curve that instead */
.table-shell .smart-table tfoot th:first-child,
.table-shell .smart-table tfoot td:first-child  { border-bottom-left-radius: var(--tbl-radius) !important; }
.table-shell .smart-table tfoot th:last-child,
.table-shell .smart-table tfoot td:last-child   { border-bottom-right-radius: var(--tbl-radius) !important; }
.table-shell .smart-table tfoot th,
.table-shell .smart-table tfoot td { border-top: 0 !important; }



/* ===== Rounded tables: ensure all 4 corners are curved & clipped ===== */
.table-shell { --tbl-radius: 18px; border-radius: var(--tbl-radius); overflow: hidden !important; }
.table-shell > .table-responsive { border-radius: inherit !important; overflow: hidden !important; background: inherit !important; }
.table-shell .smart-table { border-collapse: separate !important; border-spacing: 0 !important; border-radius: inherit !important; overflow: hidden !important; background-clip: padding-box !important; }*/
/* Top corners (thead) */
.table-shell .smart-table thead th:first-child  { border-top-left-radius: var(--tbl-radius) !important; }
.table-shell .smart-table thead th:last-child   { border-top-right-radius: var(--tbl-radius) !important; }
/* Bottom corners: tbody or tfoot */
.table-shell .smart-table tbody tr:last-of-type td:first-child { border-bottom-left-radius: var(--tbl-radius) !important; }
.table-shell .smart-table tbody tr:last-of-type td:last-child  { border-bottom-right-radius: var(--tbl-radius) !important; }
.table-shell .smart-table tfoot th:first-child,
.table-shell .smart-table tfoot td:first-child  { border-bottom-left-radius: var(--tbl-radius) !important; }
.table-shell .smart-table tfoot th:last-child,
.table-shell .smart-table tfoot td:last-child   { border-bottom-right-radius: var(--tbl-radius) !important; }

/* === Backlog “Kanban slab” look (matches Kanban column vibe) === */
.table-shell.kanban-slab{
  /* outer outline + glow, clear body */
  background: transparent;
  border-radius: 12px;
  border: 1px solid rgba(0, 188, 212, 0.22);          /* Velrin cyan outline */
  box-shadow:
    0 8px 28px rgba(0,0,0,.25),                       /* depth */
    0 0 24px rgba(0, 188, 212, .08);                  /* subtle cyan bloom */
}
body.dark-mode .table-shell.kanban-slab{
  border-color: rgba(0, 188, 212, 0.35);
  box-shadow:
    0 8px 28px rgba(0,0,0,.40),
    0 0 28px rgba(0, 188, 212, .10);
}

/* keep the scroll container and table background clear inside the slab */
.table-shell.kanban-slab > .table-responsive{ background: transparent; }
.table-glass,
.table-glass thead th,
.table-glass tbody td,
.table-glass tbody th{ background: transparent !important; }

/* lighter, elegant row dividers (works in both themes) */
.table-shell.kanban-slab .smart-table > :not(caption) > * > *{
  border-color: rgba(128,128,128,.18);
}
body.dark-mode .table-shell.kanban-slab .smart-table > :not(caption) > * > *{
  border-color: rgba(255,255,255,.08);
}

/* header underline like a card header, not a “solid block” */
.table-shell.kanban-slab .smart-table thead th{
  font-weight: 600;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-bottom-color: rgba(0,0,0,.12);
}
body.dark-mode .table-shell.kanban-slab .smart-table thead th{
  border-bottom-color: rgba(255,255,255,.14);
}

/* soft hover tint to echo the cyan accent */
.table-shell.kanban-slab .smart-table tbody tr:hover td{
  background: rgba(0, 188, 212, .06) !important;
}

/* === Backlog/Task tables as Kanban slabs ================================= */
:root{
  --slab-border-light: rgba(0,0,0,.12);
  --slab-border-dark:  rgba(255,255,255,.12);
  --slab-shadow-light: 0 10px 26px rgba(0,0,0,.16), 0 0 0 1px rgba(255,255,255,.02) inset;
  --slab-shadow-dark:  0 10px 26px rgba(0, 220, 255, .10), 0 0 0 1px rgba(255,255,255,.03) inset;
}

/* Outer shell gets the outline + glow (like Kanban columns) */
.table-shell.kanban-slab{
  border-radius: 14px;
  background: transparent;                 /* clear panel */
  border: 1px solid var(--slab-border-light);
  box-shadow: var(--slab-shadow-light);
}

/* Dark mode tune-up */
body.dark-mode .table-shell.kanban-slab{
  border-color: var(--slab-border-dark);
  box-shadow: var(--slab-shadow-dark);
}

/* Make the table itself “glass” (transparent) but keep the row separators */
.table.table-glass{
  background: transparent !important;
}
.table.table-glass > :not(caption) > *{
  background: transparent !important;       /* cells/thead transparent */
  box-shadow: none !important;              /* kill BS row shadows */
  border-color: rgba(255,255,255,.08);      /* horizontal separators */
}
body:not(.dark-mode) .table.table-glass > :not(caption) > *{
  border-color: rgba(0,0,0,.08);            /* separators in light mode */
}

/* Keep the corners rounded all around */
.table-shell.kanban-slab .table-responsive{
  border-radius: inherit;
  overflow: hidden;                          /* clips the rounded corners */
}

/* Optional: a tiny hover lift like Kanban cards */
.table-shell.kanban-slab:hover{
  transform: translateY(-1px);
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 12px 30px rgba(0,0,0,.18), 0 0 0 1px rgba(255,255,255,.03) inset;
}
body.dark-mode .table-shell.kanban-slab:hover{
  box-shadow: 0 12px 30px rgba(0, 220, 255, .12), 0 0 0 1px rgba(255,255,255,.04) inset;
}

/* === FINAL OVERRIDES: Glass "Kanban slab" table (Backlog, etc.) === */
.table-shell.kanban-slab {
  background: transparent !important;
  border: 1px solid rgba(0,0,0,.08) !important;     /* light mode border */
  box-shadow: 0 8px 26px rgba(0,0,0,.12), 0 0 22px rgba(0,188,212,.10) !important;
  overflow: visible !important;                      /* let the glow show outside the shell */
}

/* Force glass inside the slab (both modes) */
.table-shell.kanban-slab > .table-responsive,
.table-shell.kanban-slab .table-glass,
.table-shell.kanban-slab .table-glass > :not(caption) > * {
  background: transparent !important;
  box-shadow: none !important;
}

/* Dark-mode: cyan border + neon-soft glow, thin separators */
body.dark-mode .table-shell.kanban-slab {
  background: transparent !important;
  border-color: rgba(0,188,212,.35) !important;
  box-shadow:
    0 8px 28px rgba(0,0,0,.40),
    0 0 28px rgba(0,188,212,.14) !important;
}

body.dark-mode .table-shell.kanban-slab .table-glass thead th,
body.dark-mode .table-shell.kanban-slab .table-glass tbody td {
  background: transparent !important;
  border-bottom-color: rgba(255,255,255,.12) !important;
}

/* Let the outer glow breathe if the inner wrapper tried to clip it */
.table-shell.kanban-slab > .table-responsive { overflow: visible !important; }

/* Optional: gentle hover pop to match Kanban columns */
.table-shell.kanban-slab:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 32px rgba(0,0,0,.42),
    0 0 36px rgba(0,188,212,.18) !important;
  transition: box-shadow .18s ease, transform .18s ease;
}
.table-shell.kanban-slab .table-glass tbody tr:hover td {
  background: rgba(0,0,0,.02) !important;
}
body.dark-mode .table-shell.kanban-slab .table-glass tbody tr:hover td {
  background: rgba(255,255,255,.03) !important;
}

/* === Backlog slab: final look & feel (authoritative overrides) === */
/* === Backlog: Kanban-style slab (final, authoritative) ===================== */
#backlogTableShell {
  --tbl-radius: 8px;                                 /* smaller corners */
  border-radius: var(--tbl-radius) !important;
  background: transparent !important;
  border: 1px solid rgba(0,188,212,.28) !important;  /* crisp cyan outline */
  box-shadow:
    0 10px 28px rgba(0,0,0,.16),
    0 0 26px rgba(0,188,212,.12) !important;         /* subtle neon-soft glow */
  overflow: visible !important;                       /* don't clip glow */
}

/* Keep table & wrapper glassy and clipped to the rounded shell */
#backlogTableShell > .table-responsive,
#backlogTableShell .table.table-glass,
#backlogTableShell .table.table-glass > :not(caption) > * {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: inherit !important;
}

/* Elegant, thin separators + card-like header line */
#backlogTableShell .smart-table > :not(caption) > * > * {
  border-color: rgba(128,128,128,.18) !important;
}
#backlogTableShell .smart-table thead th {
  background: transparent !important;
  border-bottom: 1px solid rgba(0,0,0,.12) !important;
}

/* Gentle cyan-tinted hover */
#backlogTableShell .smart-table tbody tr:hover td {
  background: rgba(0,188,212,.06) !important;
}

/* Ensure all four corners clip */
#backlogTableShell .table-responsive,
#backlogTableShell .smart-table {
  border-radius: inherit !important;
  overflow: hidden !important;
}

/* Dark mode: stronger outline + glow, thinner separators */
body.dark-mode #backlogTableShell {
  border-color: rgba(0,188,212,.38) !important;
  box-shadow:
    0 10px 32px rgba(0,0,0,.45),
    0 0 30px rgba(0,188,212,.16) !important;
}
body.dark-mode #backlogTableShell .smart-table > :not(caption) > * > * {
  border-color: rgba(255,255,255,.10) !important;
}
body.dark-mode #backlogTableShell .smart-table thead th {
  border-bottom-color: rgba(255,255,255,.14) !important;
}
body.dark-mode #backlogTableShell .smart-table tbody tr:hover td {
  background: rgba(255,255,255,.03) !important;
}

/* Dark mode: stronger neon-soft glow */
body.dark-mode #backlogTableShell {
  border-color: rgba(0,188,212,.38) !important;
  box-shadow:
    0 10px 30px rgba(0,0,0,.45),
    0 0 28px rgba(0,188,212,.16) !important;
}

/* Keep everything inside “glass” and unclipped */
#backlogTableShell > .table-responsive,
#backlogTableShell .table.table-glass,
#backlogTableShell .table.table-glass > :not(caption) > * {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: inherit !important;
}

/* Thinner, elegant row dividers (light + dark) */
#backlogTableShell .smart-table > :not(caption) > * > * {
  border-color: rgba(128,128,128,.18) !important;
}
body.dark-mode #backlogTableShell .smart-table > :not(caption) > * > * {
  border-color: rgba(255,255,255,.10) !important;
}

/* Header reads as one piece with the slab */
#backlogTableShell .smart-table thead th {
  background-color: transparent !important;
  border-bottom: 1px solid rgba(0,0,0,.12) !important;
}
body.dark-mode #backlogTableShell .smart-table thead th {
  border-bottom-color: rgba(255,255,255,.14) !important;
}

/* Gentle hover tint to echo the Kanban vibe */
#backlogTableShell .smart-table tbody tr:hover td {
  background: rgba(0,188,212,.06) !important;
}
body.dark-mode #backlogTableShell .smart-table tbody tr:hover td {
  background: rgba(255,255,255,.03) !important;
}

/* Ensure all four corners actually clip */
#backlogTableShell .table-responsive,
#backlogTableShell .smart-table {
  border-radius: inherit !important;
  overflow: hidden !important;
}


/* === Backlog slab + glass table (2025-09-04) ============================= */

/* Outer “slab” container around the backlog table */
/* Backlog slab: clear background + compact radius */
#backlogTableShell.table-shell.kanban-slab{
  border-radius: 8px;
  background: transparent !important;              /* force clear in light mode too */
  border: 1px solid rgba(16,24,40,.12);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  backdrop-filter: blur(6px) saturate(120%);
  box-shadow:
    0 1px 2px rgba(16,24,40,.05),
    0 10px 24px rgba(16,24,40,.08);
}
/* Dark mode: neon-soft glow & cyan outline */
body.dark-mode #backlogTableShell.table-shell.kanban-slab{
  background: transparent !important;
  border-color: rgba(0,188,212,.35) !important;
  box-shadow:
    0 8px 28px rgba(0,0,0,.40),
    0 0 28px rgba(0,188,212,.14) !important;
}

/* Match the slab glow to our Kanban look in dark mode */
body.dark-mode #backlogTableShell.table-shell.kanban-slab {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(13, 17, 23, 0.55);
  /* subtle luminous rim + depth */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 8px 28px rgba(0, 0, 0, 0.60),
    0 0 32px rgba(63, 131, 248, 0.12); /* faint blue glow */
}

/* Inherit rounding on the inner scroller, and clip inner corners cleanly */
#backlogTableShell .table-responsive {
  border-radius: inherit !important;
  overflow: clip; /* prevents header background from bleeding past rounded corners */
}

/* Make the table sheet “glass” — transparent, with only row separators */
#backlogTableShell .table-glass {
  background: transparent !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

/* Header cells: subtle sheet tint so columns remain readable */
#backlogTableShell .table-glass thead th {
  background: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  border-bottom: 1px solid rgba(16, 24, 40, 0.12) !important;
}
body.dark-mode #backlogTableShell .table-glass thead th {
  background: rgba(20, 24, 29, 0.70);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}

/* Clear default cell backgrounds; keep only separators */
#backlogTableShell .table-glass > :not(caption) > * > * {
  background: transparent !important;
  box-shadow: none !important;
}

/* Crisp horizontal row separators */
#backlogTableShell .table-glass tbody tr {
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}
body.dark-mode #backlogTableShell .table-glass tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

/* Gentle hover to feel modern without “Excel” vibes */
#backlogTableShell .table-glass tbody tr:hover {
  background: rgba(2, 132, 199, 0.06); /* faint cyan tint */
  transform: translateY(-1px);
  transition: transform .12s ease, background-color .12s ease;
}
body.dark-mode #backlogTableShell .table-glass tbody tr:hover {
  background: rgba(63, 131, 248, 0.10);
}

/* Tighten cells just a touch so the slab feels more compact */
#backlogTableShell .table-glass td,
#backlogTableShell .table-glass th {
  padding-top: .55rem !important;
  padding-bottom: .55rem !important;
}

/* Backlog "glass-grid": transparent cells + vertical separators */
#backlogTableShell .table-glass,
#backlogTableShell .table-glass thead th,
#backlogTableShell .table-glass tbody td{
  background: transparent !important; /* clear table body/header cells */
}

/* Horizontal + vertical dividers for a true grid (Backlog only) */
#backlogTableShell .table-glass > :not(caption) > tr > *{
  border-bottom: 1px solid rgba(128,128,128,.18) !important;
  border-right:  1px solid rgba(128,128,128,.18) !important;
}
#backlogTableShell .table-glass th,
#backlogTableShell .table-glass td{ border-left: none; }
#backlogTableShell .table-glass > :not(caption) > tr > *:last-child{ border-right: none; }

/* Dark mode grid color */
body.dark-mode #backlogTableShell .table-glass > :not(caption) > tr > *{
  border-bottom-color: rgba(255,255,255,.10) !important;
  border-right-color:  rgba(255,255,255,.10) !important;
}

/* === Transparent 'halo' shell for task tables (Admin/User/Backlog/etc.) === */
:root{
  --halo-border: rgba(15,23,42,.15);      /* light-mode border */
  --halo-inner:  rgba(15,23,42,.04);      /* light inner ring */
  --halo-shadow: rgba(2,6,23,.08);        /* light outer drop */
  --tbl-grid-border: rgba(0,0,0,.08);     /* light grid lines */
}

/* If your app uses a .dark-mode class, target it directly */
body.dark-mode{
  --halo-border: rgba(255,255,255,.18);   /* crisper border in dark */
  --halo-inner:  rgba(255,255,255,.06);   /* gentle inner ring */
  --halo-shadow: rgba(0,0,0,.55);         /* deeper drop in dark */
  --tbl-grid-border: rgba(255,255,255,.14); /* subtle grid lines in dark */
}

/* The shell itself: transparent background + halo */
.table-shell.halo-shell{
  /* slightly tighter radius than default tables for a modern feel */
  --tbl-radius: 12px;
  border-radius: var(--tbl-radius) !important;

  background: transparent !important;
  border: 1px solid var(--halo-border) !important;

  /* subtle “glass halo” (inner hairline + soft outer) */
  box-shadow:
    0 0 0 1px var(--halo-inner),
    0 16px 32px var(--halo-shadow) !important;
}

/* Ensure the child scroller inherits transparency */
.table-shell.halo-shell > .table-responsive{
  background: transparent !important;
  border-radius: inherit !important;
  overflow: hidden !important; /* keeps rounded corners clipping */
}

/* Make the table truly clear—cells and header—while keeping the grid */
.table-shell.halo-shell .smart-table{
  background: transparent !important;
  border-collapse: separate !important; /* we rely on borders, not row backgrounds */
  border-spacing: 0 !important;
}

.table-shell.halo-shell .smart-table>:not(caption)>*>*{
  background-color: transparent !important;       /* clear cells */
  border-color: var(--tbl-grid-border) !important;/* thin grid lines */
}

/* Header: transparent with a crisp bottom rule */
.table-shell.halo-shell .thead-darkgray th{
  background: transparent !important;
  color: var(--bs-body-color) !important;
  border-bottom: 1px solid var(--tbl-grid-border) !important;
}

/* Hover state: very subtle veil so rows still feel interactive */
.table-shell.halo-shell .smart-table tbody tr:hover > *{
  background-color: rgba(127,127,127,.06) !important;
}
body.dark-mode .table-shell.halo-shell .smart-table tbody tr:hover > *{
  background-color: rgba(255,255,255,.05) !important;
}
/* Modal visibility in dark mode */
body.dark-mode .modal-content {
  background-color: #1f1f1f !important;
  color: #e9ecef !important;
  border-color: #444 !important;
}
body.dark-mode .modal-header .btn-close {
  filter: invert(1) grayscale(100%);
}
/* Backlog-only: nudge outline button contrast in dark mode */
body.dark-mode #backlogList .btn-velrin-outline {
  color: #f1f5f9 !important;
  border-color: #f1f5f9 !important;
}
/* Backlog Filters: clear input outlines */
#backlogFiltersDrawer .form-control,
#backlogFiltersDrawer .form-select {
  border: 1px solid rgba(0,0,0,.22);
}
#backlogFiltersDrawer .form-control:focus,
#backlogFiltersDrawer .form-select:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14,165,233,.25);
  outline: none;
}

/* Dark mode input contrast */
body.dark-mode #backlogFiltersDrawer .form-control,
body.dark-mode #backlogFiltersDrawer .form-select {
  background-color: rgba(255,255,255,.05);
  color: #e9ecef;
  border-color: rgba(255,255,255,.18);
}
body.dark-mode #backlogFiltersDrawer .form-control::placeholder {
  color: rgba(233,236,239,.7);
}
body.dark-mode #backlogFiltersDrawer .form-control:focus,
body.dark-mode #backlogFiltersDrawer .form-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56,189,248,.25);
  outline: none;
}
/* Date input visibility in dark mode */
body.dark-mode input[type="date"]{
  color: var(--bs-body-color, #e9ecef);
  background-color: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.28);
}

/* Make the calendar icon visible on Chromium/WebKit */
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(1) brightness(1.2);
  opacity: .9;
}

/* Improve hover/focus affordance */
body.dark-mode input[type="date"]:hover{
  background-color: rgba(255,255,255,.10);
}
body.dark-mode input[type="date"]:focus{
  outline: 2px solid rgba(0,153,255,.45);
  outline-offset: 0;
  box-shadow: 0 0 0 2px rgba(0,153,255,.25);
}

/* === Create Task — dark-mode form fixes (authoritative) === */
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  background-color: rgba(255,255,255,.06) !important;
  color: #f1f3f5 !important;
  border-color: rgba(255,255,255,.18) !important;
}
body.dark-mode .form-control::placeholder {
  color: rgba(255,255,255,.55) !important;
}

/* Calendar/addon pill to the right of the input */
body.dark-mode .input-group .input-group-text {
  background-color: rgba(255,255,255,.06) !important;
  color: #e9ecef !important;            /* <-- makes the calendar icon visible */
  border-color: rgba(255,255,255,.18) !important;
}
body.dark-mode .input-group .input-group-text .bi,
body.dark-mode .input-group .input-group-text svg {
  color: #e9ecef !important;
  fill: currentColor !important;
}

/* If your calendar icon is a button instead of .input-group-text */
body.dark-mode .input-group .btn {
  background-color: rgba(255,255,255,.06) !important;
  color: #e9ecef !important;
  border-color: rgba(255,255,255,.18) !important;
}

/* Help/counter text like “1000 characters remaining” */
body.dark-mode .form-text,
body.dark-mode .text-muted,
body.dark-mode .char-counter,
body.dark-mode .chars-remaining {
  color: rgba(255,255,255,.82) !important;
}
/* === Global form legibility in dark mode (safe defaults) === */
body.dark-mode .form-text,
body.dark-mode .text-muted{ color: rgba(255,255,255,.82) !important; }

body.dark-mode .form-control,
body.dark-mode .form-select{
  background-color:#1f2329 !important;
  color:#e9ecef !important;
  border-color:rgba(255,255,255,.18) !important;
}

/* Make native date picker icon visible on dark */
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator{ filter: invert(1) opacity(.85); }
body.dark-mode input[type="date"]::-moz-calendar-picker-indicator{ filter: invert(1) opacity(.85); }
/* Subtle top breathing room for Task Summary title bar */
#taskSummaryPage .page-title-bar{ margin-top:6px; }

/* --- Widget shell --- */
.widget { background: #121418; border: 1px solid #242834; border-radius: 14px; padding: 16px; }
.widget-header { border-bottom: 1px solid #242834; padding-bottom: 10px; margin-bottom: 12px; }
.widget h2 { font-size: 1rem; font-weight: 600; color: #e5e7eb; display: flex; align-items: center; }
.action-link { font-size: .85rem; color: #9aa3b2; text-decoration: none; }
.action-link:hover { color: #cbd5e1; text-decoration: underline; }

/* --- Notifications --- */
.list-clean { display: flex; flex-direction: column; gap: 8px; }
.notification-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid #242834; border-radius: 10px; }
.notification-text { display: inline-flex; gap: 8px; align-items: baseline; color: #e5e7eb; text-decoration: none; }
.notification-text:hover { color: #fff; }
.notification-row .timestamp { font-size: .8rem; color: #9aa3b2; }
.truncate { display: inline-block; max-width: 52ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { border: 0; background: transparent; padding: 4px 6px; color: #9aa3b2; }
.icon-btn:hover { color: #e5e7eb; }

/* --- Admin Tasks card grid --- */
.task-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 992px) { .task-card-grid { grid-template-columns: 1fr; } }
.task-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid #242834; border-radius: 12px; background: #0e1116; min-height: 140px; }
.task-card-title { font-weight: 600; color: #e5e7eb; line-height: 1.2; }
.task-card-body { font-size: .9rem; color: #9aa3b2; flex: 1; }
.task-card-footer { display: flex; justify-content: space-between; align-items: center; }
.badge.status-pending { background: #3b82f6; }
.badge.status-in-progress { background: #22c55e; }
.badge.status-completed { background: #10b981; }
.badge.status-overdue { background: #ef4444; }

/* --- Task Summary --- */
.status-container { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.status-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border: 1px solid #242834; border-radius: 12px; text-decoration: none; }
.status-box .label { color: #9aa3b2; font-size: .9rem; }
.status-box .value { color: #e5e7eb; font-weight: 700; font-size: 1.1rem; }
.status-box:hover { border-color: #334155; background: #0e1116; }
.status-box.pending { box-shadow: inset 0 0 0 1px rgba(59,130,246,.25); }
.status-box.in-progress { box-shadow: inset 0 0 0 1px rgba(34,197,94,.25); }
.status-box.completed { box-shadow: inset 0 0 0 1px rgba(16,185,129,.25); }
.status-box.overdue { box-shadow: inset 0 0 0 1px rgba(239,68,68,.25); }

/* === Dashboard widgets — unified look (centered headers, neutral colors, dark-mode safe) === */

/* Color tokens (scoped to dashboard area only to avoid global side-effects) */
.dashboard-container {
  --w-bg: #ffffff;
  --w-fg: #111111;
  --w-fg-muted: #6b7280;
  --w-border: rgba(0,0,0,.12);
  --w-surface: #f7f7f8;
  --w-chip: #f1f5f9;

  /* Chart helpers (legend/tick text) */
  --chart-legend: #6b7280;
}
body.dark-mode .dashboard-container,
.dark-mode-container {
  --w-bg: #121418;
  --w-fg: #e5e7eb;
  --w-fg-muted: #9aa3b2;
  --w-border: #242834;
  --w-surface: #0e1116;
  --w-chip: #101318;

  --chart-legend: #cbd5e1;
}

/* Widget shell */
.dashboard-container .widget {
  background: var(--w-bg) !important;
  border: 1px solid var(--w-border) !important;
  border-radius: 14px !important;
  padding: 14px 14px 16px 14px !important;
}

/* Center every widget title, keep an optional right-aligned action link */
.dashboard-container .widget h2 {
  margin: 0 !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: var(--w-fg) !important;
  text-align: center !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.dashboard-container .widget .widget-header {
  display: flex;
  align-items: center;
  justify-content: center !important;
  position: relative;               /* allows an action-link to float right */
  border-bottom: 1px solid var(--w-border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.dashboard-container .widget .widget-action-right,
.dashboard-container .widget .action-link {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  color: var(--w-fg-muted) !important;
  text-decoration: none;
}
.dashboard-container .widget .action-link:hover {
  text-decoration: underline;
  color: var(--w-fg) !important;
}

/* Notifications — neutral rows, no odd background colors */
.dashboard-container #widget-notifications .list-clean {
  display: flex; flex-direction: column; gap: 8px;
}
.dashboard-container #widget-notifications .notification-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--w-border);
  border-radius: 10px;
  background: transparent;
}
.dashboard-container #widget-notifications .notification-text {
  color: var(--w-fg) !important; text-decoration: none;
  display: inline-flex; gap: 8px; align-items: baseline;
}
.dashboard-container #widget-notifications .notification-text:hover { color: var(--w-fg); }
.dashboard-container #widget-notifications .timestamp { font-size: .8rem; color: var(--w-fg-muted); }
.dashboard-container #widget-notifications .truncate {
  display: inline-block; max-width: 52ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dashboard-container #widget-notifications .icon-btn {
  border: 0; background: transparent; padding: 4px 6px; color: var(--w-fg-muted);
}
.dashboard-container #widget-notifications .icon-btn:hover { color: var(--w-fg); }

/* Admin tasks — simple cards, visible in dark mode, consistent sizes */
.dashboard-container #widget-admin-tasks .task-card-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
@media (max-width: 992px) { .dashboard-container #widget-admin-tasks .task-card-grid { grid-template-columns: 1fr; } }
.dashboard-container #widget-admin-tasks .task-card {
  display: flex; flex-direction: column; gap: 10px; min-height: 140px;
  padding: 12px; border: 1px solid var(--w-border); border-radius: 12px; background: var(--w-surface);
}
.dashboard-container #widget-admin-tasks .task-card-title { font-weight: 600; color: var(--w-fg); line-height: 1.25; }
.dashboard-container #widget-admin-tasks .task-card-body { font-size: .9rem; color: var(--w-fg-muted); flex: 1; }
.dashboard-container #widget-admin-tasks .task-card-footer { display: flex; justify-content: space-between; align-items: center; }
.dashboard-container #widget-admin-tasks .badge[class*="status-"] {
  background: var(--w-chip); color: var(--w-fg); border: 1px solid var(--w-border);
}
.dashboard-container #widget-admin-tasks .btn.btn-primary { padding: .25rem .5rem; }

/* Task Summary — neat small stats */
.dashboard-container #widget-task-summary .status-container {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.dashboard-container #widget-task-summary .status-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 10px; text-decoration: none !important;
  border: 1px solid var(--w-border); border-radius: 12px; background: var(--w-surface);
}
.dashboard-container #widget-task-summary .status-box .label { color: var(--w-fg-muted); font-size: .9rem; }
.dashboard-container #widget-task-summary .status-box .value { color: var(--w-fg); font-weight: 700; font-size: 1.1rem; }
.dashboard-container #widget-task-summary .status-box:hover { background: var(--w-chip); }

/* Charts — make sure canvases have some height, and legends use neutral color */
.dashboard-container #widget-overdue-tasks canvas,
.dashboard-container #widget-tasks-per-user canvas { width: 100% !important; height: 220px !important; }
