* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

.app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Login Screen */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #000 url('login-bg.jpg') center / cover no-repeat;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.login-brand {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 32px;
}

.login-field {
  margin-bottom: 14px;
}

.login-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.login-field input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
}

.user-badge {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 24px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #e2e8f0;
  color: #475569;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: #22c55e;
  color: white;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: #e2e8f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
}

.btn-icon:hover {
  background: #cbd5e1;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.week-nav span {
  font-weight: 500;
  min-width: 200px;
  text-align: center;
}

/* Filters */
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group {
  position: relative;
}

.filter-dropdown {
  position: relative;
}

.filter-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  min-width: 130px;
}

.filter-btn:hover {
  border-color: #cbd5e1;
}

.filter-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
}

.filter-value {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
}

.filter-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
}

.filter-menu.active {
  display: block;
}

.filter-search {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.filter-search:focus {
  outline: none;
}

.filter-options {
  max-height: 250px;
  overflow-y: auto;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
}

.filter-option:hover {
  background: #f1f5f9;
}

.filter-option.selected {
  background: #dbeafe;
}

.filter-option .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Board */
.board-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow-x: auto;
}

.board {
  border-collapse: collapse;
}

.board th,
.board td {
  border: 1px solid #e2e8f0;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.board th {
  background: #f8fafc;
  font-weight: 600;
  position: sticky;
  top: 0;
  white-space: nowrap;
}

.board th .project-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.board th .project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.board th .project-name {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.board th .project-name:hover {
  opacity: 0.8;
}

.board th .project-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Category group header (top row) */
.category-group-header {
  text-align: center !important;
  font-weight: 600 !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px !important;
  border-bottom: none !important;
}

.project-col-header {
  background: #f8fafc;
}

.group-border-left {
  border-left: 3px solid #94a3b8 !important;
}

.board th .delete-project {
  opacity: 0;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.board th:hover .delete-project {
  opacity: 1;
}

.board th .delete-project:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Categories Modal */
.categories-list {
  margin-bottom: 16px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 8px;
}

.category-item .category-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-item .category-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.category-item .category-type {
  font-size: 11px;
  color: #64748b;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

.category-item .delete-category {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.category-item .delete-category:hover {
  background: #fee2e2;
  color: #ef4444;
}

.add-category-form {
  display: flex;
  gap: 8px;
}

.add-category-form input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.add-category-form select {
  padding: 10px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
}

.add-category-form input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 2px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
}

.date-col,
.date-cell {
  width: 120px;
  min-width: 120px;
  position: sticky;
  left: 0;
  z-index: 10;
  background: white;
}

.date-col {
  background: #f8fafc;
}

.date-cell {
  font-weight: 500;
}

.date-cell.today {
  background: #dbeafe;
}

.date-cell .day-name {
  font-size: 12px;
  color: #64748b;
  text-transform: lowercase;
}

.date-cell .day-number {
  font-size: 16px;
}

/* Task cells */
.task-cell {
  width: 240px;
  min-width: 240px;
  min-height: 60px;
  cursor: pointer;
  transition: background 0.2s;
}

.task-cell:hover {
  background: #f8fafc;
}

.task-cell.drag-over {
  background: rgba(59, 130, 246, 0.08);
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.task-cell.today {
  background: #f0f9ff;
}

.task {
  background: #f1f5f9;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-left: 3px solid #3b82f6;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task[draggable] {
  cursor: grab;
}

.task[draggable]:active {
  cursor: grabbing;
}

.task.dragging {
  opacity: 0.3;
}

.task:hover {
  background: #e2e8f0;
  transform: translateX(2px);
}

.task.completed {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 6px,
      rgba(22, 163, 74, 0.18) 6px,
      rgba(22, 163, 74, 0.18) 7px
    ),
    rgba(22, 163, 74, 0.1);
  opacity: 0.75;
}

.task.completed .task-title {
  color: #6b7280;
}

.task-title {
  font-size: 13px;
  flex: 1;
  min-width: 0;
}

.task-member,
.task-no-member {
  flex-shrink: 0;
}

.task-member {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 4px 10px;
  background: #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
}

.task-member:hover {
  background: #cbd5e1;
}

.task-member .member-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.task-no-member {
  font-size: 11px;
  color: #94a3b8;
  padding: 4px 10px;
  cursor: pointer;
  background: #f1f5f9;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
}

.task-no-member:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* Member dropdown */
.member-dropdown {
  position: fixed;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 6px;
  z-index: 1000;
  min-width: 150px;
}

.member-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.member-dropdown-item:hover {
  background: #f1f5f9;
}

.member-dropdown-item .member-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.member-dropdown-item.no-member {
  color: #94a3b8;
  font-style: italic;
}

.add-task-btn {
  display: none;
  width: 100%;
  padding: 6px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
}

.task-cell:hover .add-task-btn {
  display: block;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input[type="color"] {
  height: 42px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .spacer {
  flex: 1;
}

/* Members Modal */
.members-list {
  margin-bottom: 16px;
}

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 8px;
}

.member-item .member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-item .member-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.member-item .delete-member {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.member-item .delete-member:hover {
  background: #fee2e2;
  color: #ef4444;
}

.add-member-form {
  display: flex;
  gap: 10px;
}

.add-member-form input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.add-member-form input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 2px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
}

/* Comments */
.comments-section {
  margin-top: 16px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.comments-section > label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

.comments-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.no-comments {
  font-size: 13px;
  color: #94a3b8;
  padding: 8px 0;
}

.comment {
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
}

.comment-time {
  font-size: 11px;
  color: #94a3b8;
}

.comment-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.comment:hover .comment-delete {
  opacity: 1;
}

.comment-delete:hover {
  color: #ef4444;
  background: #fee2e2;
}

.comment-text {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.4;
}

.comment-input {
  display: flex;
  gap: 6px;
}

.comment-member-select {
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  width: 110px;
  flex-shrink: 0;
}

.comment-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
}

.comment-input input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Celebration */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: celeb-fade-in 0.3s ease;
  overflow: hidden;
}

.celebration-overlay.fade-out {
  animation: celeb-fade-out 0.5s ease forwards;
}

.celebration-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.celebration-thumb {
  font-size: 180px;
  animation: celeb-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  filter: drop-shadow(0 0 40px rgba(34, 197, 94, 0.6));
}

.celebration-text {
  font-size: 42px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  animation: celeb-text-in 0.5s ease 0.3s both;
}

@keyframes celeb-text-in {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.celebration-particle {
  position: absolute;
  bottom: -50px;
  font-size: 32px;
  animation: celeb-float-up linear forwards;
  opacity: 0;
}

@keyframes celeb-bounce {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.3) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes celeb-float-up {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

@keyframes celeb-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes celeb-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Users Modal */
.users-list {
  margin-bottom: 16px;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 8px;
}

.user-item .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-item .user-icon {
  font-size: 20px;
}

.user-item .user-display-name {
  font-weight: 500;
  font-size: 14px;
}

.user-item .user-login {
  font-size: 12px;
  color: #94a3b8;
}

.user-self-badge {
  font-size: 11px;
  color: #3b82f6;
  background: #dbeafe;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.user-item .delete-user {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 16px;
}

.user-item .delete-user:hover {
  background: #fee2e2;
  color: #ef4444;
}

.add-user-form {
  display: flex;
  gap: 8px;
}

.add-user-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
}

.add-user-form input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* ===== CHATS ===== */
.chats-screen {
  height: 100vh;
  overflow: hidden;
}

.chats-layout {
  display: flex;
  height: 100vh;
}

.chats-sidebar {
  width: 320px;
  min-width: 320px;
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.chats-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
  gap: 10px;
}

.chats-sidebar-header h2 {
  font-size: 18px;
  flex: 1;
}

.chats-list {
  flex: 1;
  overflow-y: auto;
}

.chats-empty {
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

.chat-item {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-item:hover {
  background: #f8fafc;
}

.chat-item.active {
  background: #dbeafe;
  border-left: 3px solid #3b82f6;
}

.chat-item-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.chat-item-last {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-author {
  font-weight: 600;
  color: #475569;
}

.chat-item-empty {
  font-style: italic;
  color: #94a3b8;
}

/* Chat main area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  min-width: 0;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  gap: 10px;
  font-size: 16px;
}

.chat-placeholder-icon {
  font-size: 48px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}

.chat-header-name {
  font-size: 16px;
  font-weight: 600;
}

.chat-header-members {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-no-messages {
  text-align: center;
  color: #94a3b8;
  padding: 40px;
  font-size: 14px;
}

.chat-date-divider {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  padding: 10px 0;
  position: relative;
}

.chat-date-divider::before,
.chat-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: #e2e8f0;
}

.chat-date-divider::before {
  left: 0;
}

.chat-date-divider::after {
  right: 0;
}

.chat-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 16px;
  position: relative;
  word-wrap: break-word;
}

.chat-bubble.own {
  align-self: flex-end;
  background: #3b82f6;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble.other {
  align-self: flex-start;
  background: white;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.chat-bubble-author {
  font-size: 11px;
  font-weight: 600;
  color: #3b82f6;
  margin-bottom: 3px;
}

.chat-bubble-text {
  font-size: 14px;
  line-height: 1.4;
}

.chat-bubble-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}

/* Chat input */
.chat-input {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input input:focus {
  border-color: #3b82f6;
}

.chat-input .btn {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 18px;
  flex-shrink: 0;
}

/* Chat file preview bar */
.chat-file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: #e2e8f0;
  border-top: 1px solid #cbd5e1;
}

.file-preview-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}

.file-preview-icon {
  font-size: 20px;
}

.file-preview-name {
  font-size: 13px;
  color: #475569;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
}

.file-preview-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Chat attach button */
.chat-attach-btn {
  border-radius: 50% !important;
  width: 44px;
  height: 44px;
  padding: 0 !important;
  font-size: 18px;
  flex-shrink: 0;
}

/* Chat bubble images */
.chat-bubble-image {
  display: block;
  margin-bottom: 6px;
}

.chat-bubble-image img {
  max-width: 300px;
  max-height: 300px;
  border-radius: 10px;
  cursor: pointer;
  display: block;
}

.chat-bubble.own .chat-bubble-image img {
  margin-left: auto;
}

/* Chat file link */
.chat-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.06);
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 6px;
  word-break: break-all;
}

.chat-bubble.own .chat-file-link {
  color: white;
  background: rgba(255,255,255,0.15);
}

.chat-bubble.other .chat-file-link {
  color: #3b82f6;
}

/* Chat bubble delete */
.chat-bubble {
  position: relative;
}

.chat-bubble-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  color: rgba(0,0,0,0.2);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.chat-bubble:hover .chat-bubble-delete {
  opacity: 1;
}

.chat-bubble-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.chat-bubble.own .chat-bubble-delete {
  color: rgba(255,255,255,0.4);
}

.chat-bubble.own .chat-bubble-delete:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

/* Create chat modal - checkboxes */
.chat-members-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.chat-member-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}

.chat-member-checkbox:hover {
  background: #e2e8f0;
}

.chat-member-checkbox.disabled {
  opacity: 0.6;
  cursor: default;
}

.chat-member-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
}

.chat-member-tag {
  font-size: 11px;
  color: #94a3b8;
  margin-left: auto;
}

/* Chat back button - hidden on desktop */
.chat-back-btn {
  display: none;
}

/* Responsive — iPhone 15 Pro (393px) and all smartphones */
@media (max-width: 480px) {
  /* General */
  .app {
    padding: 10px;
  }

  /* Header */
  .header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .header h1 {
    font-size: 20px;
    text-align: center;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  .header-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    flex: 1 1 auto;
  }

  .user-badge {
    font-size: 11px;
    padding: 4px 10px;
    flex: 1 1 100%;
    text-align: center;
  }

  /* Controls */
  .controls {
    flex-direction: column;
    gap: 10px;
  }

  .week-nav {
    width: 100%;
    justify-content: space-between;
  }

  .week-nav span {
    min-width: auto;
    font-size: 13px;
  }

  .filters {
    width: 100%;
  }

  .filter-btn {
    min-width: 100px;
    font-size: 12px;
  }

  .filter-menu {
    min-width: 180px;
  }

  /* Board */
  .board-container {
    -webkit-overflow-scrolling: touch;
  }

  .task-cell {
    width: 160px;
    min-width: 160px;
  }

  .date-col,
  .date-cell {
    width: 70px;
    min-width: 70px;
  }

  .date-cell .day-number {
    font-size: 14px;
  }

  .date-cell .day-name {
    font-size: 11px;
  }

  .board th,
  .board td {
    padding: 6px;
  }

  .task {
    padding: 6px 8px;
  }

  .task-title {
    font-size: 12px;
  }

  .task-member {
    font-size: 10px;
    padding: 2px 6px;
  }

  .task-no-member {
    font-size: 10px;
    padding: 2px 6px;
  }

  .add-task-btn {
    display: block !important;
  }

  .category-group-header {
    font-size: 10px;
    padding: 4px 6px !important;
  }

  .board th .project-name {
    font-size: 12px;
  }

  /* Modals */
  .modal-content {
    width: calc(100% - 48px);
    max-width: none;
    padding: 14px;
    border-radius: 10px;
    max-height: 95vh;
    overflow-x: hidden;
  }

  .modal-header h2 {
    font-size: 16px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions .spacer {
    display: none;
  }

  .modal-actions .btn {
    flex: 1 1 auto;
  }

  .form-group input,
  .form-group select {
    max-width: 100%;
  }

  .add-category-form {
    flex-wrap: wrap;
  }

  .add-category-form input[type="text"] {
    flex: 1 1 100%;
  }

  .add-member-form {
    flex-wrap: wrap;
  }

  .add-member-form input[type="text"] {
    flex: 1 1 100%;
  }

  .add-user-form {
    flex-wrap: wrap;
  }

  .add-user-form input {
    flex: 1 1 100%;
  }

  .comment-input {
    flex-wrap: wrap;
  }

  .comment-member-select {
    width: 100%;
  }

  /* Chats — mobile messenger mode */
  .chats-layout {
    position: relative;
  }

  .chats-sidebar {
    width: 100%;
    min-width: 100%;
  }

  .chats-sidebar-header {
    padding: 10px 12px;
  }

  .chat-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
  }

  .chats-screen.chat-open .chats-sidebar {
    display: none;
  }

  .chats-screen.chat-open .chat-main {
    display: flex;
  }

  .chat-back-btn {
    display: inline-flex;
  }

  .chat-header {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .chat-header-actions {
    gap: 4px;
  }

  .chat-header-actions .btn {
    font-size: 11px;
    padding: 4px 8px;
  }

  .chat-bubble {
    max-width: 85%;
  }

  .chat-bubble-image img {
    max-width: 220px;
  }

  .chat-input {
    padding: 10px 8px;
  }

  .chat-input input {
    padding: 10px 12px;
    font-size: 14px;
  }

  .chat-messages {
    padding: 12px;
  }

  .chat-bubble-delete {
    opacity: 1;
  }

  /* Login */
  .login-card {
    padding: 32px 20px;
    margin: 0 16px;
    max-width: none;
  }

  .login-brand {
    font-size: 22px;
  }

  /* Celebration */
  .celebration-thumb {
    font-size: 100px;
  }

  .celebration-text {
    font-size: 28px;
  }
}
