/* ===================== CSS Variables & Theme ===================== */
:root {
  --primary: #1a237e;
  --primary-light: #3949ab;
  --primary-dark: #0d1452;
  --accent: #c9a84c;
  --accent-light: #dfc06a;
  --success: #2e7d32;
  --warning: #f57f17;
  --danger: #c62828;
  --info: #0277bd;

  --bg-primary: #f5f6fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #1a1f36;
  --bg-header: #ffffff;
  --bg-hover: #f0f2f5;
  --bg-modal-overlay: rgba(0,0,0,0.5);
  --bg-input: #f8f9fa;

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888a0;
  --text-sidebar: #a0a3bd;
  --text-sidebar-active: #ffffff;
  --text-on-primary: #ffffff;

  --border-color: #e2e5f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: 0.3s ease;
}

[data-theme="dark"] {
  --bg-primary: #0f1119;
  --bg-secondary: #1a1d2e;
  --bg-card: #1a1d2e;
  --bg-sidebar: #0a0c14;
  --bg-header: #1a1d2e;
  --bg-hover: #252838;
  --bg-input: #252838;

  --text-primary: #e8e8f0;
  --text-secondary: #a0a3bd;
  --text-muted: #6b6d85;

  --border-color: #2a2d40;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: visible;
  transition: background var(--transition), color var(--transition);
}

html {
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }

/* ===================== Scrollbar ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===================== Auth Pages ===================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 20px;
}

.auth-container {
  display: flex;
  max-width: 960px;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.auth-card {
  flex: 1;
  background: var(--bg-card);
  padding: 40px;
  max-width: 460px;
}

.auth-banner {
  flex: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.auth-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
}

.banner-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}

.banner-content > i {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.banner-content h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.banner-content p {
  opacity: 0.8;
  margin-bottom: 30px;
}

.banner-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.banner-feature {
  background: rgba(255,255,255,0.1);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo i {
  font-size: 48px;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-header p {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-block {
  width: 100%;
  padding: 14px !important;
  font-size: 1.05rem;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

/* ===================== Forms ===================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  transition: border-color var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.multi-select {
  height: 120px;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

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

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,35,126,0.3);
}

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

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-icon.danger:hover {
  background: rgba(198,40,40,0.1);
  color: var(--danger);
}

/* ===================== Alerts ===================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(198,40,40,0.1);
  color: var(--danger);
  border-right: 4px solid var(--danger);
}

.alert-success {
  background: rgba(46,125,50,0.1);
  color: var(--success);
  border-right: 4px solid var(--success);
}

/* ===================== Header ===================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 500;
  transition: background var(--transition);
  overflow: visible;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}

.logo-brand i {
  font-size: 1.6rem;
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

/* ===================== Notifications Dropdown ===================== */
.notifications-dropdown {
  position: relative;
}

.notification-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.notification-btn:hover {
  background: var(--bg-hover);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 9999;
}

.dropdown-menu.align-left {
  left: auto;
  right: 0;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-menu {
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-header h4 { font-size: 0.95rem; }
.dropdown-header a { color: var(--primary); font-size: 0.85rem; }

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  transition: background var(--transition);
}

.notification-item:hover {
  background: var(--bg-hover);
}

.notification-item.unread {
  background: rgba(26,35,126,0.04);
}

.notification-item.unread:hover {
  background: rgba(26,35,126,0.08);
}

.no-notifications {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 600; font-size: 0.85rem; }
.notification-message { color: var(--text-muted); font-size: 0.8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notification-time { color: var(--text-muted); font-size: 0.75rem; }

/* ===================== User Menu ===================== */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.user-btn:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.85rem;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.user-dropdown {
  width: 280px;
  left: 0;
  right: auto;
}

.user-info-card {
  padding: 20px;
  text-align: center;
}

.user-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.5rem;
  overflow: hidden;
}

.user-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-full-name {
  font-weight: 700;
  font-size: 1rem;
}

.user-email {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.user-role-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-hover);
  border-radius: 20px;
  font-size: 0.8rem;
  margin-top: 8px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item.logout {
  color: var(--danger);
}

/* ===================== Sidebar ===================== */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 400;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

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

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-sidebar);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.sidebar-nav a i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.sidebar-nav a.active {
  background: var(--primary);
  color: white;
}

.sidebar-nav .badge {
  margin-right: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
}

.nav-divider {
  padding: 16px 14px 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-sidebar);
  opacity: 0.5;
  font-weight: 600;
  letter-spacing: 1px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer-info p {
  color: var(--text-sidebar);
  opacity: 0.5;
  font-size: 0.75rem;
}

/* ===================== Main Content ===================== */
.main-content {
  margin-right: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 24px;
  min-height: calc(100vh - var(--header-height));
}

/* ===================== Page Header ===================== */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header h1 i {
  color: var(--primary);
}

.page-subtitle {
  color: var(--text-muted);
  margin-top: 4px;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

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

/* ===================== Filters ===================== */
.filters-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filters-row select {
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  outline: none;
  min-width: 150px;
  cursor: pointer;
}

.filters-row select:focus {
  border-color: var(--primary-light);
}

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  flex: 1;
  max-width: 400px;
}

.search-input i {
  color: var(--text-muted);
}

.search-input input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  width: 100%;
  outline: none;
}

/* ===================== Stats Grid ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: rgba(26,35,126,0.1); color: var(--primary); }
.stat-icon.orange { background: rgba(245,127,23,0.1); color: var(--warning); }
.stat-icon.green { background: rgba(46,125,50,0.1); color: var(--success); }
.stat-icon.purple { background: rgba(156,39,176,0.1); color: #9c27b0; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===================== Dashboard ===================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dashboard-card:last-child {
  grid-column: 1 / -1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 16px 20px;
}

/* ===================== Cards ===================== */
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}

.detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.detail-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-card-body {
  padding: 20px;
}

/* ===================== Projects Grid ===================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.project-card-header {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.project-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,0.3);
}

.project-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-status.pending { background: rgba(255,193,7,0.9); color: #333; }
.project-status.active { background: rgba(26,35,126,0.9); color: white; }
.project-status.on_hold { background: rgba(255,152,0,0.9); color: white; }
.project-status.completed { background: rgba(46,125,50,0.9); color: white; }
.project-status.cancelled { background: rgba(100,100,100,0.9); color: white; }

.project-card-body {
  padding: 16px;
}

.project-card-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.project-card-body p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-client {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.project-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.project-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar.large {
  height: 12px;
  border-radius: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: inherit;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.project-tasks-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===================== Project Detail ===================== */
.project-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.project-detail-main {
  min-width: 0;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-description {
  margin-top: 16px;
}

.detail-description p {
  color: var(--text-secondary);
  line-height: 1.8;
}

.detail-progress {
  margin-top: 16px;
}

/* ===================== Task List ===================== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: 1px solid transparent;
}

.task-card-item:hover {
  border-color: var(--border-color);
  transform: translateX(-4px);
}

.task-card-item.done {
  opacity: 0.7;
}

.task-check {
  position: relative;
  width: 22px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}

.task-check input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  transition: all var(--transition);
}

.task-check input:checked ~ .checkmark {
  background: var(--success);
  border-color: var(--success);
}

.task-check input:checked ~ .checkmark::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.7rem;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-weight: 600;
  display: block;
}

.task-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.8rem;
}

.task-priority {
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.task-priority.low { background: rgba(46,125,50,0.1); color: var(--success); }
.task-priority.medium { background: rgba(255,193,7,0.1); color: #f9a825; }
.task-priority.high { background: rgba(245,127,23,0.1); color: var(--warning); }
.task-priority.urgent { background: rgba(198,40,40,0.1); color: var(--danger); }

.task-right {
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-due {
  white-space: nowrap;
}

/* ===================== Steps ===================== */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-item {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.step-item.completed {
  background: rgba(46,125,50,0.05);
  border-color: rgba(46,125,50,0.2);
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-check {
  position: relative;
  width: 22px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-check input {
  position: absolute;
  opacity: 0;
}

.step-check .checkmark {
  border-radius: 50%;
}

.step-check input:checked ~ .checkmark {
  background: var(--success);
  border-color: var(--success);
}

.step-check input:checked ~ .checkmark::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.6rem;
}

.step-info {
  flex: 1;
}

.step-title {
  font-weight: 600;
}

.step-title.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.step-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.step-actions {
  display: flex;
  gap: 4px;
}

/* ===================== Task Stats Bar ===================== */
.task-stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-mini {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-mini span {
  font-size: 1.2rem;
  font-weight: 800;
}

.stat-mini.todo { background: rgba(33,150,243,0.1); color: #1565c0; }
.stat-mini.in_progress { background: rgba(255,152,0,0.1); color: #e65100; }
.stat-mini.review { background: rgba(156,39,176,0.1); color: #7b1fa2; }
.stat-mini.done { background: rgba(46,125,50,0.1); color: var(--success); }

/* ===================== Tasks Table ===================== */
.tasks-table-wrapper {
  overflow-x: auto;
}

.tasks-table {
  width: 100%;
  border-collapse: collapse;
}

.tasks-table th {
  padding: 12px 16px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.tasks-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.task-row {
  cursor: pointer;
  transition: background var(--transition);
}

.task-row:hover {
  background: var(--bg-hover);
}

.task-title-cell {
  font-weight: 600;
}

/* ===================== Status & Priority Badges ===================== */
.status-badge {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.todo { background: rgba(33,150,243,0.1); color: #1565c0; }
.status-badge.in_progress { background: rgba(255,152,0,0.1); color: #e65100; }
.status-badge.review { background: rgba(156,39,176,0.1); color: #7b1fa2; }
.status-badge.done { background: rgba(46,125,50,0.1); color: var(--success); }
.status-badge.cancelled { background: rgba(100,100,100,0.1); color: #666; }
.status-badge.active { background: rgba(46,125,50,0.1); color: var(--success); }
.status-badge.inactive { background: rgba(198,40,40,0.1); color: var(--danger); }

.priority-badge {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ===================== Kanban ===================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 400px;
}

.kanban-column {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 200px;
}

.kanban-column-header {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-column-header .count {
  background: rgba(0,0,0,0.1);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.kanban-column-header.todo { background: rgba(33,150,243,0.15); }
.kanban-column-header.in_progress { background: rgba(255,152,0,0.15); }
.kanban-column-header.review { background: rgba(156,39,176,0.15); }
.kanban-column-header.done { background: rgba(46,125,50,0.15); }

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.kanban-card {
  display: block;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.kanban-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 4px;
}

.kanban-card-project,
.kanban-card-assignee,
.kanban-card-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kanban-card.urgent {
  border-right: 3px solid var(--danger);
}

.kanban-card.high {
  border-right: 3px solid var(--warning);
}

.kanban-card.done {
  opacity: 0.7;
}

/* ===================== Kanban Drag & Drop ===================== */
.kanban-card {
  cursor: grab;
  user-select: none;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.4;
  transform: rotate(3deg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.kanban-cards.drag-over {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  min-height: 100px;
  border: 2px dashed var(--primary);
  transition: all 0.2s;
}

.kanban-cards.drag-over .kanban-card {
  pointer-events: none;
}

.kanban-card.dragging + .kanban-card {
  border-top: 2px solid var(--primary);
}

/* ===================== Comments ===================== */
.comments-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-form { width: 100%; }

.comment-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-input-wrapper textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  resize: none;
  outline: none;
}

.comment-input-wrapper textarea:focus {
  border-color: var(--primary-light);
}

.comment-tools {
  display: flex;
  gap: 6px;
  align-items: center;
}

.comment-tool-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
}

.comment-tool-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.comment-tool-btn.recording {
  background: #c62828 !important;
  color: white !important;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.comment-tool-btn input[type="file"] {
  display: none;
}

.comment-file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.comment-file-preview .preview-item {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.comment-file-preview .preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-file-preview .preview-item .remove-file {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(198,40,40,0.9);
  color: white;
  border: none;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* مرفقات التعليق */
.comment-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.comment-file-item {
  max-width: 100%;
}

.comment-image {
  max-width: 200px;
  max-height: 150px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition);
}

.comment-image:hover {
  transform: scale(1.05);
}

.comment-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.comment-audio i {
  color: var(--primary);
  font-size: 1.2rem;
}

.comment-audio audio {
  height: 36px;
  max-width: 220px;
}

.comment-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.comment-file-link:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

@media (max-width: 768px) {
  .comment-image {
    max-width: 140px;
    max-height: 100px;
  }
  .comment-audio audio {
    max-width: 150px;
  }
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  display: flex;
  gap: 12px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
  background: var(--bg-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.comment-user {
  font-weight: 700;
  font-size: 0.85rem;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.no-comments {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===================== Members ===================== */
.members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.member-item:hover {
  background: var(--bg-hover);
}

.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-info {
  flex: 1;
}

.member-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.member-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.no-members {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===================== Attachments ===================== */
.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.attachment-item i {
  color: var(--primary);
}

.attachment-name {
  flex: 1;
  font-weight: 500;
}

.attachment-size {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.no-attachments {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===================== Activity ===================== */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.activity-item i {
  font-size: 0.5rem;
  color: var(--primary);
  margin-top: 6px;
}

.activity-content p {
  font-size: 0.85rem;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.no-activity {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===================== Task List Mini ===================== */
.task-list-mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  transition: background var(--transition);
}

.task-item-mini:hover {
  background: var(--bg-hover);
}

.task-item-mini.urgent {
  border-right: 3px solid var(--danger);
}

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

.task-status-dot.todo { background: #1565c0; }
.task-status-dot.in_progress { background: #e65100; }
.task-status-dot.review { background: #7b1fa2; }
.task-status-dot.done { background: var(--success); }

.task-info {
  flex: 1;
}

.task-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.task-project {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===================== Comments Mini ===================== */
.comments-list-mini {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item-mini {
  display: flex;
  gap: 10px;
}

.comment-item-mini .comment-avatar {
  width: 32px;
  height: 32px;
}

/* ===================== Project Mini ===================== */
.project-list-mini {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-item-mini {
  display: block;
}

.project-item-mini .project-info span {
  display: block;
  margin-bottom: 4px;
}

.project-item-mini .project-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.progress-bar-mini {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-mini .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: inherit;
}

.project-progress {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===================== Users Grid ===================== */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}

.user-card.inactive {
  opacity: 0.7;
}

.user-card:hover {
  box-shadow: var(--shadow-md);
}

.user-card-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.user-card-header h3 {
  margin: 12px 0 8px;
  font-size: 1.1rem;
}

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.role-badge.admin { background: rgba(26,35,126,0.1); color: var(--primary); }
.role-badge.team { background: rgba(33,150,243,0.1); color: #1565c0; }
.role-badge.client { background: rgba(46,125,50,0.1); color: var(--success); }

.user-card-body {
  padding: 16px 20px;
}

.user-card-body p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.user-card-body i {
  width: 16px;
  color: var(--text-muted);
}

.user-card-footer {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
}

.user-actions {
  display: flex;
  gap: 4px;
}

/* ===================== Notifications Page ===================== */
.notifications-page-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-page-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.notification-page-item:hover {
  background: var(--bg-hover);
}

.notification-page-item.unread {
  border-right: 4px solid var(--primary);
}

.notification-page-item .notification-icon {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
}

.notification-page-item .notification-icon.warning { background: rgba(245,127,23,0.1); color: var(--warning); }
.notification-page-item .notification-icon.chat { background: rgba(33,150,243,0.1); color: #1565c0; }

.notification-page-item .notification-content h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.notification-page-item .notification-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.notification-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ===================== Settings ===================== */
.settings-form {
  max-width: 800px;
}

.settings-form small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-actions {
  margin-top: 24px;
}

/* ===================== Chat ===================== */
.modal-chat {
  max-width: 480px;
  height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  display: flex;
  margin-bottom: 8px;
}

.chat-message.mine {
  justify-content: flex-end;
}

.chat-message-content {
  max-width: 80%;
  background: var(--bg-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border-bottom-right-radius: 4px;
}

.chat-message.mine .chat-message-content {
  background: var(--primary);
  color: white;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: var(--radius-md);
}

.chat-sender {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: var(--primary);
}

.chat-message.mine .chat-sender {
  color: rgba(255,255,255,0.8);
}

.chat-message-content p {
  font-size: 0.9rem;
  line-height: 1.4;
}

.chat-time {
  display: block;
  font-size: 0.7rem;
  margin-top: 4px;
  opacity: 0.7;
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
}

.chat-input-area form {
  display: flex;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--primary-light);
}

/* ===================== Modal ===================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-modal-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  overflow-y: auto;
  padding: 40px 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* ===================== Status Select ===================== */
.status-select {
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  outline: none;
}

/* ===================== Empty State ===================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--border-color);
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  margin-bottom: 16px;
}

.full-width {
  grid-column: 1 / -1;
}

/* ===================== Error Page ===================== */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.error-content i {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.error-content h1 {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary);
}

.error-content h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.error-content p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.error-detail {
  font-size: 0.85rem !important;
  color: var(--danger) !important;
}

/* ===================== Client Fields ===================== */
.client-fields {
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.client-fields .form-group {
  margin-bottom: 12px;
}

.client-fields .form-group:last-child {
  margin-bottom: 0;
}

.client-fields label {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===================== Task Assignee ===================== */
.task-assignee-display {
  display: flex;
  align-items: center;
  gap: 6px;
}

.assignee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.task-assignee-display i {
  font-size: 1.3rem;
  color: var(--text-muted);
}

/* ===================== Project List View ===================== */
.project-list-view {
  margin-top: 16px;
}

.project-list-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-list-progress .progress-bar {
  flex: 1;
  max-width: 120px;
}

.project-list-progress .progress-text {
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ===================== View Toggle ===================== */
.view-toggle {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

/* ===================== Responsive ===================== */
@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .project-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-right: 0;
  }

  .search-box {
    width: auto;
  }

  .search-box input {
    width: 120px;
  }

  .user-name {
    display: none;
  }

  .auth-container {
    flex-direction: column;
  }

  .auth-card {
    max-width: 100%;
  }

  .auth-banner {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: 1fr;
    overflow-x: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .notification-menu {
    width: 300px;
  }

  .filters-row {
    flex-direction: column;
  }

  .search-input {
    max-width: 100%;
  }

  .users-grid {
    grid-template-columns: 1fr;
  }
}

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

  .page-header h1 {
    font-size: 1.3rem;
  }

  .header {
    padding: 0 12px;
  }

  .main-content {
    padding: 16px;
  }
}
