/*
Theme Name: MeisterTask Pro
Theme URI: https://yoursite.com
Author: Your Team
Author URI: https://yoursite.com
Description: A complete Task Management System inspired by MeisterTask — featuring Kanban boards, team roles (Manager, Editor, Viewer), email invitations, daily reporting, and a full dashboard. Built for WordPress with custom post types and AJAX-powered interactions.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: meistertask-pro
Tags: task-management, kanban, team, dashboard, project-management
*/

/* =====================================================
   IMPORTS & VARIABLES
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Brand Colors */
  --mt-primary:       #4f91ff;
  --mt-primary-dark:  #2563eb;
  --mt-primary-light: #e8f0fe;
  --mt-accent:        #06c0a5;
  --mt-accent-light:  #d4f5f1;
  --mt-danger:        #f04438;
  --mt-warning:       #f79009;
  --mt-success:       #17b26a;

  /* Sidebar */
  --sidebar-bg:       #1a1f2e;
  --sidebar-hover:    #252c3f;
  --sidebar-active:   #2e3650;
  --sidebar-text:     #8b94b0;
  --sidebar-text-active: #ffffff;
  --sidebar-width:    240px;
  --sidebar-collapsed: 64px;

  /* Content */
  --bg-base:          #f4f6fb;
  --bg-card:          #ffffff;
  --bg-card-hover:    #f9fafc;
  --border-color:     #e8ecf4;
  --border-hover:     #c5cfe0;

  /* Text */
  --text-primary:     #111827;
  --text-secondary:   #6b7280;
  --text-muted:       #9ca3af;
  --text-inverse:     #ffffff;

  /* Typography */
  --font-sans:        'DM Sans', -apple-system, sans-serif;
  --font-mono:        'DM Mono', monospace;

  /* Spacing */
  --header-height:    56px;
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        16px;
  --radius-xl:        24px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.16);

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --duration-fast: 120ms;
  --duration-base: 220ms;
  --duration-slow: 380ms;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--mt-primary); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--mt-primary-dark); }

img { max-width: 100%; height: auto; display: block; }

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

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

/* =====================================================
   SIDEBAR
   ===================================================== */
.mt-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: width var(--duration-slow) var(--ease-out);
  overflow: hidden;
}

.mt-sidebar.collapsed { width: var(--sidebar-collapsed); }

/* Logo */
.mt-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  height: var(--header-height);
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
  white-space: nowrap;
}

.mt-sidebar__logo-icon {
  width: 32px; height: 32px;
  background: var(--mt-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.5px;
}

.mt-sidebar__logo-text {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
  opacity: 1;
  transition: opacity var(--duration-base);
}

.mt-sidebar.collapsed .mt-sidebar__logo-text { opacity: 0; }

/* Nav sections */
.mt-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: none;
}
.mt-sidebar__nav::-webkit-scrollbar { display: none; }

.mt-sidebar__section {
  margin-bottom: 4px;
}

.mt-sidebar__section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 12px 20px 6px;
  white-space: nowrap;
  transition: opacity var(--duration-base);
}
.mt-sidebar.collapsed .mt-sidebar__section-label { opacity: 0; }

.mt-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  margin: 1px 8px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 450;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast), color var(--duration-fast);
  text-decoration: none;
}

.mt-nav-item:hover {
  background: var(--sidebar-hover);
  color: #d4d9eb;
}

.mt-nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

.mt-nav-item .nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.mt-nav-item .nav-label {
  transition: opacity var(--duration-base), transform var(--duration-base);
}
.mt-sidebar.collapsed .mt-nav-item .nav-label { opacity: 0; }

.mt-nav-item .nav-badge {
  margin-left: auto;
  background: var(--mt-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  transition: opacity var(--duration-base);
}
.mt-sidebar.collapsed .mt-nav-badge { opacity: 0; }

/* Project items in sidebar */
.mt-project-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px;
  margin: 1px 8px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  text-decoration: none;
}
.mt-project-item:hover { background: var(--sidebar-hover); color: #d4d9eb; }
.mt-project-item.active { background: var(--sidebar-active); color: #fff; }

.mt-project-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Sidebar footer */
.mt-sidebar__footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.mt-user-widget {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.mt-user-widget:hover { background: var(--sidebar-hover); }

.mt-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--mt-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.mt-avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.mt-avatar--lg { width: 40px; height: 40px; font-size: 15px; }
.mt-avatar--xl { width: 52px; height: 52px; font-size: 18px; }

.mt-user-info { min-width: 0; transition: opacity var(--duration-base); }
.mt-user-info .name { font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-user-info .role { font-size: 11px; color: var(--sidebar-text); white-space: nowrap; }
.mt-sidebar.collapsed .mt-user-info { opacity: 0; }

/* Collapse toggle */
.mt-sidebar__toggle {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 101;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base), background var(--duration-fast);
}
.mt-sidebar__toggle:hover { background: var(--mt-primary); border-color: var(--mt-primary); }
.mt-sidebar__toggle:hover svg { color: #fff; }
.mt-sidebar__toggle svg { width: 12px; height: 12px; color: var(--text-secondary); transition: transform var(--duration-slow) var(--ease-out), color var(--duration-fast); }
.mt-sidebar.collapsed .mt-sidebar__toggle svg { transform: rotate(180deg); }

/* =====================================================
   MAIN CONTENT AREA
   ===================================================== */
.mt-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--duration-slow) var(--ease-out);
}

.mt-sidebar.collapsed ~ .mt-main { margin-left: var(--sidebar-collapsed); }

/* Top header */
.mt-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}

.mt-header__breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}
.mt-header__breadcrumb .current { color: var(--text-primary); font-weight: 500; }
.mt-header__breadcrumb .sep { color: var(--text-muted); }

.mt-header__actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}

.mt-header__search {
  position: relative;
}
.mt-header__search input {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 12px 7px 34px;
  font-size: 13px;
  color: var(--text-primary);
  width: 220px;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.mt-header__search input:focus {
  outline: none;
  border-color: var(--mt-primary);
  box-shadow: 0 0 0 3px rgba(79,145,255,.15);
}
.mt-header__search .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.mt-icon-btn {
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast);
  position: relative;
}
.mt-icon-btn:hover { background: var(--bg-base); color: var(--text-primary); }

.mt-icon-btn .badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--mt-danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* Page content */
.mt-page {
  flex: 1;
  padding: 28px 28px 40px;
  max-width: 1400px;
  width: 100%;
}

.mt-page-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
}

.mt-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.mt-page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--mt-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--mt-primary-dark); color: #fff; box-shadow: 0 4px 12px rgba(79,145,255,.35); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-base); color: var(--text-primary); }

.btn-danger {
  background: var(--mt-danger);
  color: #fff;
}
.btn-danger:hover { background: #c0392b; box-shadow: 0 4px 12px rgba(240,68,56,.3); }

.btn-sm { font-size: 13px; padding: 6px 12px; }
.btn-lg { font-size: 15px; padding: 11px 22px; }
.btn-icon { padding: 8px; }

/* =====================================================
   CARDS
   ===================================================== */
.mt-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 22px;
  transition: box-shadow var(--duration-base), border-color var(--duration-base);
}
.mt-card:hover { box-shadow: var(--shadow-md); }

.mt-card--flat { box-shadow: none; }
.mt-card--flat:hover { box-shadow: var(--shadow-sm); }

.mt-card__header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.mt-card__title {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
}
.mt-card__action { margin-left: auto; }

/* =====================================================
   DASHBOARD STATS
   ===================================================== */
.mt-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.mt-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--duration-base), transform var(--duration-base);
}
.mt-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.mt-stat-card__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 18px;
}

.mt-stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.8px;
  line-height: 1;
  margin-bottom: 4px;
}

.mt-stat-card__label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 450;
}

.mt-stat-card__trend {
  position: absolute;
  top: 18px; right: 18px;
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; gap: 3px;
  padding: 3px 8px;
  border-radius: 20px;
}
.mt-stat-card__trend.up { background: #dcfce7; color: #16a34a; }
.mt-stat-card__trend.down { background: #fee2e2; color: #dc2626; }

/* Color variants */
.mt-stat-card--blue .mt-stat-card__icon   { background: #eff6ff; color: var(--mt-primary); }
.mt-stat-card--green .mt-stat-card__icon  { background: #f0fdf4; color: var(--mt-success); }
.mt-stat-card--orange .mt-stat-card__icon { background: #fff7ed; color: var(--mt-warning); }
.mt-stat-card--red .mt-stat-card__icon    { background: #fef2f2; color: var(--mt-danger); }
.mt-stat-card--teal .mt-stat-card__icon   { background: #f0fdfa; color: var(--mt-accent); }

/* =====================================================
   KANBAN BOARD
   ===================================================== */
.mt-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 60vh;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.mt-column {
  min-width: 280px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mt-column__header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.mt-column__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.mt-column__count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 500;
}

.mt-column__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mt-column__add {
  margin-top: 8px;
}

.mt-column__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast);
}

.mt-column__body.drag-over {
  background: var(--mt-primary-light);
  outline: 2px dashed var(--mt-primary);
  outline-offset: -2px;
}

/* Task cards */
.mt-task-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 14px;
  cursor: pointer;
  transition: box-shadow var(--duration-base), border-color var(--duration-base), transform var(--duration-base);
  position: relative;
}
.mt-task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.mt-task-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg) scale(1.02);
  box-shadow: var(--shadow-xl);
  z-index: 200;
}

.mt-task-card__priority-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.priority-high   { background: var(--mt-danger); }
.priority-medium { background: var(--mt-warning); }
.priority-low    { background: var(--mt-success); }
.priority-none   { background: var(--border-color); }

.mt-task-card__label {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.mt-task-card__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.mt-task-card__meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-muted);
  flex-wrap: wrap;
}

.mt-task-card__meta-item {
  display: flex; align-items: center; gap: 4px;
}

.mt-task-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.mt-assignees {
  display: flex; align-items: center;
}
.mt-assignees .mt-avatar + .mt-avatar { margin-left: -8px; }
.mt-assignees .mt-avatar { border: 2px solid var(--bg-card); }

.mt-task-due {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.mt-task-due.overdue { background: #fee2e2; color: var(--mt-danger); }
.mt-task-due.today   { background: #fff7ed; color: var(--mt-warning); }
.mt-task-due.upcoming { background: #f0fdf4; color: var(--mt-success); }
.mt-task-due.future  { background: var(--bg-base); color: var(--text-muted); }

/* =====================================================
   TASK LIST VIEW
   ===================================================== */
.mt-tasklist {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.mt-tasklist__head {
  display: grid;
  grid-template-columns: 40px 1fr 140px 120px 120px 100px 80px;
  gap: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-base);
}

.mt-tasklist__head th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
}

.mt-tasklist__row {
  display: grid;
  grid-template-columns: 40px 1fr 140px 120px 120px 100px 80px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--duration-fast);
  cursor: pointer;
}
.mt-tasklist__row:hover { background: var(--bg-card-hover); }
.mt-tasklist__row:last-child { border-bottom: none; }

.mt-tasklist__cell { padding: 0 8px; font-size: 13px; }

.mt-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-hover);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.mt-check:hover { border-color: var(--mt-primary); background: var(--mt-primary-light); }
.mt-check.done { background: var(--mt-success); border-color: var(--mt-success); }

/* =====================================================
   STATUS BADGES
   ===================================================== */
.mt-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.mt-badge--todo     { background: #f3f4f6; color: #6b7280; }
.mt-badge--progress { background: #eff6ff; color: #2563eb; }
.mt-badge--review   { background: #fef9c3; color: #a16207; }
.mt-badge--done     { background: #dcfce7; color: #16a34a; }
.mt-badge--blocked  { background: #fee2e2; color: #dc2626; }

.mt-badge--manager  { background: #ede9fe; color: #7c3aed; }
.mt-badge--editor   { background: #e0f2fe; color: #0369a1; }
.mt-badge--viewer   { background: #f0fdf4; color: #15803d; }
.mt-badge--admin    { background: #fef2f2; color: #b91c1c; }

/* Priority badges */
.mt-priority--high   { background: #fee2e2; color: var(--mt-danger); }
.mt-priority--medium { background: #fff7ed; color: var(--mt-warning); }
.mt-priority--low    { background: #f0fdf4; color: var(--mt-success); }
.mt-priority--none   { background: #f3f4f6; color: var(--text-muted); }

/* =====================================================
   FORMS & INPUTS
   ===================================================== */
.mt-form-group { margin-bottom: 18px; }
.mt-form-group label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.mt-form-group .hint {
  font-size: 12px; color: var(--text-muted);
  margin-top: 5px;
}

.mt-input, .mt-select, .mt-textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  font-family: inherit;
}

.mt-input:focus, .mt-select:focus, .mt-textarea:focus {
  outline: none;
  border-color: var(--mt-primary);
  box-shadow: 0 0 0 3px rgba(79,145,255,.15);
  background: var(--bg-card);
}

.mt-input::placeholder, .mt-textarea::placeholder {
  color: var(--text-muted);
}

.mt-textarea {
  resize: vertical;
  min-height: 90px;
}

.mt-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* =====================================================
   MODAL / DRAWER
   ===================================================== */
.mt-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--duration-base);
  backdrop-filter: blur(2px);
}
.mt-overlay.open { opacity: 1; pointer-events: all; }

.mt-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.94) translateY(12px);
  transition: transform var(--duration-slow) var(--ease-out);
}
.mt-overlay.open .mt-modal {
  transform: scale(1) translateY(0);
}

.mt-modal__header {
  display: flex; align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}
.mt-modal__title { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.mt-modal__close {
  margin-left: auto;
  background: none; border: none;
  cursor: pointer; color: var(--text-muted);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast);
}
.mt-modal__close:hover { background: var(--bg-base); color: var(--text-primary); }

.mt-modal__body { padding: 20px 24px; }
.mt-modal__footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* Task Detail Drawer (right side) */
.mt-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  z-index: 300;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.mt-drawer.open { transform: translateX(0); }

.mt-drawer__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 12px;
}

.mt-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.mt-drawer__section {
  margin-bottom: 24px;
}

.mt-drawer__section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* =====================================================
   TEAM / MEMBERS
   ===================================================== */
.mt-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.mt-member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: box-shadow var(--duration-base), transform var(--duration-base);
  cursor: pointer;
}
.mt-member-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.mt-member-card__name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.mt-member-card__email { font-size: 12px; color: var(--text-muted); }
.mt-member-card__actions {
  display: flex; gap: 8px; margin-top: 4px;
  width: 100%;
}
.mt-member-card__actions .btn { flex: 1; font-size: 12px; padding: 6px 8px; }

/* Invite box */
.mt-invite-box {
  background: linear-gradient(135deg, var(--mt-primary-light) 0%, #e8f5ff 100%);
  border: 1.5px dashed #93c5fd;
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}
.mt-invite-box h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.mt-invite-box p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.mt-invite-form {
  display: flex; gap: 8px;
  max-width: 500px; margin: 0 auto;
}
.mt-invite-form .mt-input { flex: 1; background: var(--bg-card); }
.mt-invite-role-select { width: 140px; background: var(--bg-card); }

/* =====================================================
   DAILY REPORTS
   ===================================================== */
.mt-report-feed {
  display: flex; flex-direction: column; gap: 14px;
}

.mt-report-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: box-shadow var(--duration-base);
}
.mt-report-entry:hover { box-shadow: var(--shadow-sm); }

.mt-report-entry__header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.mt-report-entry__meta { flex: 1; min-width: 0; }
.mt-report-entry__name { font-size: 14px; font-weight: 600; }
.mt-report-entry__time { font-size: 12px; color: var(--text-muted); }

.mt-report-entry__content { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.mt-report-entry__tasks {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 6px;
}

.mt-report-task-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
}
.mt-report-task-item .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-done     { background: var(--mt-success); }
.status-progress { background: var(--mt-primary); }
.status-blocked  { background: var(--mt-danger); }

/* Report submit form */
.mt-report-compose {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}
.mt-report-compose__header {
  font-size: 15px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

/* =====================================================
   PROGRESS BARS
   ===================================================== */
.mt-progress {
  height: 6px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
}
.mt-progress__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--mt-primary);
  transition: width 0.6s var(--ease-out);
}
.mt-progress__fill--success { background: var(--mt-success); }
.mt-progress__fill--warning { background: var(--mt-warning); }
.mt-progress__fill--danger  { background: var(--mt-danger); }

/* =====================================================
   TIMELINE / ACTIVITY LOG
   ===================================================== */
.mt-activity {
  display: flex; flex-direction: column; gap: 0;
}

.mt-activity-item {
  display: flex; gap: 14px;
  padding-bottom: 18px;
  position: relative;
}
.mt-activity-item::before {
  content: '';
  position: absolute;
  left: 15px; top: 34px; bottom: 0;
  width: 1px;
  background: var(--border-color);
}
.mt-activity-item:last-child::before { display: none; }

.mt-activity-item__avatar { flex-shrink: 0; position: relative; z-index: 1; }

.mt-activity-item__content {
  flex: 1; padding-top: 4px;
}
.mt-activity-item__text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.mt-activity-item__text strong { color: var(--text-primary); font-weight: 500; }
.mt-activity-item__time { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* =====================================================
   TABLES
   ===================================================== */
.mt-table {
  width: 100%;
  border-collapse: collapse;
}
.mt-table th {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
  text-align: left;
  padding: 10px 16px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-color);
}
.mt-table td {
  font-size: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.mt-table tbody tr:hover { background: var(--bg-card-hover); }
.mt-table tbody tr:last-child td { border-bottom: none; }

/* =====================================================
   EMPTY STATES
   ===================================================== */
.mt-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.mt-empty__icon {
  font-size: 48px; margin-bottom: 14px;
  opacity: 0.4;
}
.mt-empty__title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.mt-empty__text { font-size: 14px; max-width: 280px; margin: 0 auto 18px; }

/* =====================================================
   TOOLTIPS
   ===================================================== */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1a1f2e;
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: 999;
}

/* =====================================================
   DROPDOWN MENUS
   ===================================================== */
.mt-dropdown {
  position: relative;
  display: inline-flex;
}

.mt-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 500;
  opacity: 0; transform: scale(0.95) translateY(-8px);
  pointer-events: none;
  transform-origin: top right;
  transition: opacity var(--duration-fast), transform var(--duration-fast);
}
.mt-dropdown__menu.open {
  opacity: 1; transform: scale(1) translateY(0);
  pointer-events: all;
}

.mt-dropdown__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast);
  text-decoration: none;
}
.mt-dropdown__item:hover { background: var(--bg-base); }
.mt-dropdown__item.danger { color: var(--mt-danger); }
.mt-dropdown__item.danger:hover { background: #fff5f5; }

.mt-dropdown__divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* =====================================================
   NOTIFICATIONS PANEL
   ===================================================== */
.mt-notif-panel {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 600;
}

.mt-notif-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px; font-weight: 600;
}

.mt-notif-item {
  display: flex; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.mt-notif-item:hover { background: var(--bg-base); }
.mt-notif-item.unread { background: #f8faff; }
.mt-notif-item__text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.mt-notif-item__text strong { color: var(--text-primary); }
.mt-notif-item__time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* =====================================================
   TABS
   ===================================================== */
.mt-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  gap: 0;
  margin-bottom: 24px;
}

.mt-tab {
  padding: 10px 18px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.mt-tab:hover { color: var(--text-primary); }
.mt-tab.active { color: var(--mt-primary); border-bottom-color: var(--mt-primary); }

/* =====================================================
   TOASTS
   ===================================================== */
#mt-toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.mt-toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.3s var(--ease-out);
}
.mt-toast.removing { animation: toastOut 0.25s var(--ease-in) forwards; }

.mt-toast--success { border-left: 3px solid var(--mt-success); }
.mt-toast--error   { border-left: 3px solid var(--mt-danger); }
.mt-toast--info    { border-left: 3px solid var(--mt-primary); }
.mt-toast--warning { border-left: 3px solid var(--mt-warning); }

@keyframes toastIn  { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(20px); } }

/* =====================================================
   AVATAR COLORS
   ===================================================== */
.avatar-color-0 { background: #4f91ff; }
.avatar-color-1 { background: #06c0a5; }
.avatar-color-2 { background: #f79009; }
.avatar-color-3 { background: #7c3aed; }
.avatar-color-4 { background: #f04438; }
.avatar-color-5 { background: #0369a1; }
.avatar-color-6 { background: #15803d; }
.avatar-color-7 { background: #b45309; }

/* =====================================================
   CHART DONUT (CSS only)
   ===================================================== */
.mt-donut {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: conic-gradient(
    var(--mt-success)  0% var(--pct-done),
    var(--mt-primary)  var(--pct-done) var(--pct-prog),
    var(--mt-warning)  var(--pct-prog) var(--pct-rev),
    var(--border-color) var(--pct-rev) 100%
  );
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.mt-donut::after {
  content: '';
  width: 60px; height: 60px;
  background: var(--bg-card);
  border-radius: 50%;
  position: absolute;
}
.mt-donut-label {
  position: absolute; z-index: 1;
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
  :root { --sidebar-width: 200px; }
}

@media (max-width: 768px) {
  .mt-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    transition: transform var(--duration-slow) var(--ease-out);
  }
  .mt-sidebar.mobile-open { transform: translateX(0); }
  .mt-main { margin-left: 0 !important; }
  .mt-board { flex-direction: column; }
  .mt-column { min-width: 100%; max-width: 100%; }
  .mt-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .mt-tasklist__head, .mt-tasklist__row {
    grid-template-columns: 40px 1fr 100px 80px;
  }
  .mt-tasklist__head th:nth-child(n+4):not(:nth-child(4)),
  .mt-tasklist__row .mt-tasklist__cell:nth-child(n+4):not(:nth-child(4)) { display: none; }
  .mt-page { padding: 16px; }
  .mt-drawer { width: 100%; }
}

@media (max-width: 480px) {
  .mt-stats-grid { grid-template-columns: 1fr; }
  .mt-header__search { display: none; }
}

/* =====================================================
   LOADING SKELETON
   ===================================================== */
.skeleton {
  background: linear-gradient(90deg, #f0f2f5 25%, #e8eaf0 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* =====================================================
   ADMIN OVERRIDES
   ===================================================== */
.mt-admin-notice {
  background: var(--mt-primary-light);
  border-left: 4px solid var(--mt-primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
  .mt-sidebar, .mt-header, .mt-icon-btn, .btn { display: none !important; }
  .mt-main { margin-left: 0 !important; }
}
