/* ========== CSS Variables ========== */
:root {
  --primary: #ea484b;
  --primary-dark: #d13d40;
  --primary-light: #fde8e8;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --urgent: #DC2626;
  --bg: #F5F3F0;
  --bg-card: #FFFFFF;
  --bg-sidebar: #2C1810;
  --text: #2C1810;
  --text-light: #7C6F64;
  --text-sidebar: #D4C5B9;
  --border: #E2E8F0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-sm: 4px;
  --sidebar-width: 240px;
  --transition: 0.2s ease;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* ========== Login ========== */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #2C1810 0%, #ea484b 100%);
}
.login-card {
  background: white; border-radius: 16px; padding: 48px; width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-img { width: 120px; height: 120px; object-fit: contain; margin-bottom: 12px; border-radius: 12px; }
.login-logo h1 { font-size: 24px; color: var(--text); }
.login-logo p { color: var(--text-light); font-size: 14px; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; }

/* ========== Forms ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; transition: border var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input[type="color"] { height: 40px; padding: 4px; cursor: pointer; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  transition: all var(--transition);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: white; }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 12px; }
.btn-icon { padding: 6px; border-radius: var(--radius-sm); color: var(--text-light); transition: all var(--transition); }
.btn-icon:hover { background: var(--bg); color: var(--text); }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width); background: var(--bg-sidebar); color: var(--text-sidebar);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-header {
  padding: 20px; display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: white; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.sidebar-nav { flex: 1; padding: 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text-sidebar); transition: all var(--transition);
  margin-bottom: 2px; font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-item i { width: 20px; text-align: center; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-info {
  display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 8px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-details span { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px !important; opacity: 0.6; }
.sidebar-footer .btn-icon { color: var(--text-sidebar); }
.sidebar-footer .btn-icon:hover { color: white; background: rgba(255,255,255,0.1); }

/* Main */
.main-content {
  margin-left: var(--sidebar-width); flex: 1; padding: 24px; min-height: 100vh;
}
.view { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ========== Page Header ========== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 24px; font-weight: 700; }
.page-header-actions { display: flex; gap: 8px; align-items: center; }

/* ========== Filters ========== */
.filters-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
  padding: 12px; background: white; border-radius: var(--radius); box-shadow: var(--shadow);
}
.filters-bar select, .filters-bar input {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: white;
}
.filter-search { min-width: 200px; }

/* ========== Cards ========== */
.card {
  background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }

/* ========== Dashboard ========== */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 20px;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: #D1FAE5; color: var(--success); }
.stat-icon.yellow { background: #FEF3C7; color: var(--warning); }
.stat-icon.red { background: #FEE2E2; color: var(--danger); }
.stat-icon.purple { background: #EDE9FE; color: #7C3AED; }
.stat-icon.indigo { background: #E0E7FF; color: #4F46E5; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-light); }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ========== Dashboard Grid ========== */
.dash-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; }
.dash-main { min-width: 0; }
.dash-sidebar-right { display: flex; flex-direction: column; gap: 16px; }

.dash-section { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.dash-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.dash-section-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dash-section-header h3 i { color: var(--primary); }
.dash-section-actions { display: flex; gap: 6px; }
.filter-inline { padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; background: white; }

.dash-panel { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.dash-panel-danger { border-left: 3px solid var(--danger); }
.dash-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dash-panel-header h4 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dash-panel-header h4 i { font-size: 13px; color: var(--text-light); }
.dash-panel-header .badge { background: var(--bg); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.dash-panel-body { padding: 8px; }

.dash-task-item { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); }
.dash-task-item:hover { background: var(--bg); }
.dash-task-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.dash-task-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-light); }
.dash-task-date.overdue { color: var(--danger); font-weight: 600; }

.dash-cal-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; border-radius: var(--radius-sm); transition: background var(--transition); }
.dash-cal-item:hover { background: var(--bg); }
.dash-cal-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-cal-info { min-width: 0; }
.dash-cal-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-cal-date { font-size: 11px; color: var(--text-light); }
.dash-cal-type { text-transform: capitalize; }

.dash-note-item { padding: 10px 12px; margin: 4px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); }
.dash-note-item:hover { background: var(--bg); }
.dash-note-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.dash-note-preview { font-size: 12px; color: var(--text-light); }

.dash-project-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; border-radius: var(--radius-sm); transition: background var(--transition); }
.dash-project-item:hover { background: var(--bg); }
.dash-project-color { width: 8px; height: 32px; border-radius: 4px; flex-shrink: 0; }
.dash-project-info { flex: 1; min-width: 0; }
.dash-project-name { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.dash-project-progress { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-light); }

.dash-projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dash-project-card {
  background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  cursor: pointer; transition: all var(--transition);
}
.dash-project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.dash-project-card .dash-project-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.dash-project-card .dash-project-desc { font-size: 12px; color: var(--text-light); margin-bottom: 12px; }
.dash-project-card .dash-project-progress { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-light); margin-bottom: 8px; }
.dash-project-card .dash-project-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-light); }

.dash-empty { padding: 16px; text-align: center; font-size: 13px; color: var(--text-light); }
.dash-more { padding: 8px 12px; text-align: center; font-size: 12px; color: var(--primary); cursor: pointer; }
.dash-more:hover { text-decoration: underline; }

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

/* ========== Kanban Board ========== */
.kanban-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; min-height: 400px;
}
.kanban-column {
  background: var(--bg); border-radius: var(--radius); padding: 12px;
  min-height: 200px;
}
.kanban-column-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px; margin-bottom: 12px; font-weight: 600; font-size: 14px;
}
.kanban-column-header .badge {
  background: rgba(0,0,0,0.1); padding: 2px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
}
.kanban-list { min-height: 100px; }
.kanban-card {
  background: white; border-radius: var(--radius-sm); padding: 12px;
  margin-bottom: 8px; box-shadow: var(--shadow); cursor: grab;
  border-left: 3px solid transparent; transition: all var(--transition);
}
.kanban-card:hover { box-shadow: var(--shadow-lg); }
.kanban-card.sortable-ghost { opacity: 0.4; }
.kanban-card.sortable-drag { box-shadow: var(--shadow-lg); transform: rotate(2deg); }
.kanban-card-title { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.kanban-card-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--text-light);
}
.kanban-card-meta .tag {
  padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600;
}
.priority-laag { background: #D1FAE5; color: #065F46; }
.priority-normaal { background: #fde8e8; color: #d13d40; }
.priority-hoog { background: #FEF3C7; color: #92400E; }
.priority-urgent { background: #FEE2E2; color: #991B1B; }
.kanban-card-assignee {
  width: 22px; height: 22px; border-radius: 50%; font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center; color: white; font-weight: 700;
}
.kanban-card-assignees {
  display: inline-flex; align-items: center;
}
.kanban-card-assignees .kanban-card-assignee {
  margin-left: -6px; border: 2px solid white;
}
.kanban-card-assignees .kanban-card-assignee:first-child {
  margin-left: 0;
}

/* Multi-select dropdown */
.user-multiselect {
  position: relative;
}
.ums-trigger {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; cursor: pointer; background: var(--bg-card);
  min-height: 40px; transition: border-color 0.15s;
}
.ums-trigger:hover { border-color: var(--primary); }
.ums-placeholder { color: var(--text-light); font-size: 14px; }
.ums-badges { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.ums-badge {
  width: 26px; height: 26px; border-radius: 50%; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
}
.ums-count { color: var(--text-light); font-size: 12px; white-space: nowrap; }
.ums-arrow { color: var(--text-light); font-size: 12px; margin-left: auto; }
.ums-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto; z-index: 1000; padding: 4px;
}
.ums-dropdown.open { display: block; }
.ums-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius-sm);
  cursor: pointer; user-select: none; font-size: 13px;
}
.ums-option:hover { background: #F1F5F9; }
.ums-option input[type="checkbox"] {
  cursor: pointer; margin: 0; flex-shrink: 0; width: 16px; height: 16px;
}
.ums-option-badge {
  width: 24px; height: 24px; min-width: 24px; border-radius: 50%; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; flex-shrink: 0;
}
.ums-option-name { flex: 1; }
.kanban-card-actions { display: flex; gap: 2px; margin-left: auto; }
.kanban-card-actions .btn-icon { font-size: 11px; padding: 3px; }

/* ========== Project Grid ========== */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px;
}
.project-card {
  background: white; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border-top: 4px solid var(--primary);
  cursor: pointer; transition: all var(--transition);
}
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.project-card-title { font-size: 16px; font-weight: 600; }
.project-card-status {
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.status-actief { background: #D1FAE5; color: #065F46; }
.status-gepauzeerd { background: #FEF3C7; color: #92400E; }
.status-afgerond { background: #DBEAFE; color: #1E40AF; }
.status-gearchiveerd { background: #F1F5F9; color: #64748B; }
.project-card-desc { font-size: 13px; color: var(--text-light); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-light); }
.project-progress { display: flex; align-items: center; gap: 8px; }
.progress-bar { width: 80px; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s; }

/* ========== Calendar ========== */
#calendar-container { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.fc { font-size: 13px; }
.fc .fc-toolbar-title { font-size: 18px; }
.fc .fc-button { font-size: 13px; }
.fc .fc-button-primary { background: var(--primary); border-color: var(--primary); }
.fc .fc-event { border-radius: 4px; padding: 2px 4px; font-size: 12px; cursor: pointer; }
.fc .fc-daygrid-day-number { font-size: 13px; }

/* Calendar type colors */
.cal-content { background: #3B82F6; border-color: #3B82F6; }
.cal-deadline { background: #EF4444; border-color: #EF4444; }
.cal-meeting { background: #8B5CF6; border-color: #8B5CF6; }
.cal-social { background: #EC4899; border-color: #EC4899; }
.cal-email { background: #F59E0B; border-color: #F59E0B; }
.cal-blog { background: #10B981; border-color: #10B981; }

/* ========== Notes ========== */
.notes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.note-card {
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  cursor: pointer; transition: all var(--transition); min-height: 150px;
  display: flex; flex-direction: column;
}
.note-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.note-card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.note-card-content { font-size: 13px; color: var(--text-light); flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.note-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 11px; color: var(--text-light); }

/* ========== Settings ========== */
.settings-section { margin-bottom: 32px; }
.settings-section h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.users-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.users-table th, .users-table td { padding: 12px 16px; text-align: left; font-size: 13px; }
.users-table th { background: var(--bg); font-weight: 600; color: var(--text-light); font-size: 12px; text-transform: uppercase; }
.users-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.users-table tr:hover td { background: #F8FAFC; }
.role-badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.role-admin { background: #FEE2E2; color: #991B1B; }
.role-manager { background: #FEF3C7; color: #92400E; }
.role-lid { background: #DBEAFE; color: #1E40AF; }

/* ========== Modal ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center; z-index: 1000;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: white; border-radius: 12px; width: 90%; max-width: 560px;
  max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}

/* ========== Toast ========== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius); color: white;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== Attachments ========== */
.attachments-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.attachments-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: var(--bg); border-radius: var(--radius-sm); font-size: 12px;
}
.attachment-item img { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; }
.attachment-item .btn-icon { font-size: 10px; }
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 20px;
  text-align: center; cursor: pointer; transition: all var(--transition);
  color: var(--text-light); font-size: 13px;
}
.upload-area:hover { border-color: var(--primary); color: var(--primary); }
.upload-area i { font-size: 24px; display: block; margin-bottom: 8px; }

/* ========== Color Picker ========== */
.color-options { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.color-option {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all var(--transition);
}
.color-option:hover { transform: scale(1.15); }
.color-option.active { border-color: var(--text); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text); }

/* ========== Empty State ========== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-light);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 16px; margin-bottom: 20px; }

/* ========== Chat Layout ========== */
.chat-layout {
  display: flex;
  height: calc(100vh - 48px);
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-sidebar {
  width: 260px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.chat-sidebar-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.chat-section {
  padding: 8px 0;
}

.chat-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-section-header .btn-icon {
  font-size: 11px;
  padding: 4px;
}

.chat-list {
  padding: 0 8px;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 14px;
}

.chat-list-item:hover {
  background: rgba(0,0,0,0.05);
}

.chat-list-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.chat-list-icon {
  width: 20px;
  text-align: center;
  font-weight: 700;
  color: var(--text-light);
  font-size: 15px;
}

.chat-list-item.active .chat-list-icon {
  color: var(--primary);
}

.chat-dm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

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

.chat-dm-name {
  display: block;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dm-preview {
  display: block;
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-empty-small {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}

/* ========== Chat Main ========== */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.chat-header-icon {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
}

.chat-header-title {
  font-size: 16px;
  font-weight: 600;
}

.chat-header-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.chat-header .chat-dm-avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

/* ========== Messages Area ========== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #FAFAFA;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.chat-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.chat-loading {
  text-align: center;
  padding: 32px;
  color: var(--text-light);
}

.chat-date-divider {
  text-align: center;
  margin: 20px 0 16px;
  position: relative;
}

.chat-date-divider span {
  background: #FAFAFA;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.chat-date-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

/* ========== Message Bubbles ========== */
.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 85%;
}

.chat-message.continued {
  margin-top: -2px;
}

.chat-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.chat-message-avatar-placeholder {
  width: 36px;
  flex-shrink: 0;
}

.chat-message-content {
  max-width: 100%;
  min-width: 0;
}

.chat-message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-message-sender {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.chat-message-time {
  font-size: 11px;
  color: var(--text-light);
}

.chat-message-text {
  background: white;
  padding: 10px 14px;
  border-radius: 4px 16px 16px 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-message.own {
  flex-direction: row-reverse;
  margin-left: auto;
}

.chat-message.own .chat-message-text {
  background: var(--primary);
  color: white;
  border-radius: 16px 4px 16px 16px;
}

.chat-message.own .chat-message-header {
  flex-direction: row-reverse;
}

/* ========== Mentions ========== */
.chat-mention {
  background: rgba(234, 72, 75, 0.15);
  color: var(--primary);
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.chat-message.own .chat-mention {
  background: rgba(255,255,255,0.2);
  color: white;
}

.chat-message-text a {
  color: var(--primary);
  text-decoration: underline;
}

.chat-message.own .chat-message-text a {
  color: white;
}

/* ========== Input Area ========== */
.chat-input-container {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: white;
  position: relative;
}

.chat-input-container textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  resize: none;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.4;
}

.chat-input-container textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.chat-input-container .btn {
  align-self: flex-end;
  padding: 10px 16px;
}

/* ========== Mentions Popup ========== */
.chat-mentions-popup {
  position: absolute;
  bottom: 100%;
  left: 20px;
  right: 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin-bottom: 4px;
}

.chat-mentions-popup.hidden {
  display: none;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 14px;
}

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

.mention-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.mention-item:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.mention-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 12px;
}

/* ========== Notification Badge ========== */
.nav-item {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Emoji Picker ========== */
.emoji-picker {
  position: absolute;
  bottom: 100%;
  right: 0;
  width: 320px;
  max-height: 380px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}

.emoji-picker.hidden {
  display: none;
}

.emoji-picker-header {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.emoji-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.emoji-search:focus {
  outline: none;
  border-color: var(--primary);
}

.emoji-picker-tabs {
  display: flex;
  padding: 4px;
  border-bottom: 1px solid var(--border);
  gap: 2px;
  overflow-x: auto;
}

.emoji-tab {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.emoji-tab:hover {
  background: var(--bg);
}

.emoji-tab.active {
  background: var(--primary-light);
}

.emoji-picker-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.emoji-category-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 4px 0;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-btn {
  padding: 4px;
  font-size: 20px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  line-height: 1;
}

.emoji-btn:hover {
  background: var(--bg);
  transform: scale(1.2);
}

.emoji-trigger {
  font-size: 16px;
  color: var(--text-light);
}

.emoji-trigger:hover {
  color: var(--primary);
}

/* Emoji picker in different contexts */
.form-group-with-emoji {
  position: relative;
}

.form-group-with-emoji .emoji-picker {
  right: 0;
  bottom: auto;
  top: 100%;
  margin-top: 4px;
  margin-bottom: 0;
}

.input-with-emoji {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.input-with-emoji textarea,
.input-with-emoji input[type="text"] {
  flex: 1;
}

.input-with-emoji .emoji-trigger {
  position: absolute;
  right: 8px;
  top: 8px;
}

.input-with-emoji textarea {
  padding-right: 36px;
}

/* Chat input emoji positioning */
.chat-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.chat-input-wrapper textarea {
  width: 100%;
  padding-right: 40px;
}

.chat-input-wrapper .emoji-trigger {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.chat-input-wrapper .emoji-picker {
  bottom: 100%;
  right: 0;
  margin-bottom: 4px;
}

/* ========== Image Converter ========== */
.converter-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.converter-upload-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.converter-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.converter-dropzone:hover,
.converter-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.converter-dropzone i {
  font-size: 48px;
  color: var(--text-light);
  margin-bottom: 16px;
  display: block;
}

.converter-dropzone.dragover i {
  color: var(--primary);
}

.converter-dropzone h3 {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text);
}

.converter-dropzone p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 12px;
}

.converter-formats {
  display: inline-block;
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-light);
  border: 1px solid var(--border);
}

.converter-settings {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.converter-quality label {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}

.converter-quality input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.converter-quality input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.converter-quality-hints {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.converter-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.converter-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.converter-file-preview {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.converter-file-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 20px;
  color: var(--text-light);
}

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

.converter-file-name {
  display: block;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.converter-file-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.converter-file-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--border);
  color: var(--text-light);
  text-transform: uppercase;
}

.converter-file-badge.webp {
  background: var(--primary-light);
  color: var(--primary);
}

.converter-file-arrow {
  color: var(--text-light);
  font-size: 14px;
}

.converter-file-target {
  min-width: 50px;
}

.converter-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.converter-results {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.converter-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.converter-results-header h3 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.converter-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.converter-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.converter-result-item.error {
  background: #FEE2E2;
}

.converter-result-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
}

.converter-result-icon.success {
  background: #D1FAE5;
  color: var(--success);
}

.converter-result-icon.error {
  background: #FEE2E2;
  color: var(--danger);
}

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

.converter-result-name {
  display: block;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.converter-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  flex-wrap: wrap;
}

.converter-result-error {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
}

.converter-result-saving {
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
}

.converter-result-saving.positive {
  background: #D1FAE5;
  color: var(--success);
}

.converter-result-saving.negative {
  background: #FEE2E2;
  color: var(--danger);
}

.converter-download-btns {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.converter-download-btns .btn {
  white-space: nowrap;
}

.converter-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.converter-stat {
  text-align: center;
  padding: 12px;
}

.converter-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.converter-stat-value.positive {
  color: var(--success);
}

.converter-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ========== SEO Metadata (Converter) ========== */
.converter-result-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.converter-result-card .converter-result-item {
  box-shadow: none;
  border-radius: 0;
}

.seo-section {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: var(--bg);
}

.seo-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.seo-section-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.seo-section-title i {
  color: var(--primary);
}

.seo-description-input-wrap {
  margin-bottom: 12px;
}

.seo-input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.seo-description-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color var(--transition);
  background: var(--bg-card);
}

.seo-description-input:focus {
  border-color: var(--primary);
  outline: none;
}

.seo-description-input::placeholder {
  color: #B0A8A0;
}

.seo-input-hint {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.seo-generated-fields {
  min-height: 30px;
}

.seo-field-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seo-field {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border: 1px solid var(--border);
}

.seo-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.seo-field-label i {
  font-size: 11px;
  width: 14px;
  text-align: center;
  color: var(--primary);
}

.seo-char-count {
  margin-left: auto;
  font-weight: 500;
  font-size: 11px;
}

.seo-field-value-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seo-field-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Segoe UI Mono', 'SF Mono', 'Consolas', monospace;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
}

.seo-field-input:focus {
  border-color: var(--primary);
  outline: none;
  background: white;
}

.seo-field-textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 60px;
  line-height: 1.4;
  transition: border-color var(--transition);
}

.seo-field-textarea:focus {
  border-color: var(--primary);
  outline: none;
  background: white;
}

.seo-field-textarea::placeholder {
  color: #B0A8A0;
}

.seo-copy-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  transition: all var(--transition);
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.seo-copy-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.seo-copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
  background: #D1FAE5;
}

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

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header span, .nav-item span, .user-details, #nav-settings span { display: none; }
  .sidebar-header { justify-content: center; padding: 16px; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { margin-left: 60px; padding: 16px; }
  .kanban-board { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Chat responsive */
  .chat-sidebar {
    width: 60px;
  }

  .chat-sidebar-header h3,
  .chat-section-header span,
  .chat-dm-info,
  .chat-list-name {
    display: none;
  }

  .chat-list-item {
    justify-content: center;
    padding: 12px;
  }

  .chat-section-header {
    justify-content: center;
  }

  .chat-section-header .btn-icon {
    display: none;
  }

  .notification-badge {
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    font-size: 9px;
  }
}
