* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
  position: relative;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 400px;
}

.auth-container h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: #f0f2f5;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.tab.active {
  background: #667eea;
  color: white;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: white;
}

.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: #667eea;
}

.auth-form button {
  width: 100%;
  padding: 0.75rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-form button:hover {
  background: #5568d3;
}

.error {
  color: #e74c3c;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

header {
  background: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.5rem;
  color: #333;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-display {
  color: #666;
}

#logout-btn {
  padding: 0.5rem 1rem;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.role-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #667eea;
  color: white;
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.header-users-wrap {
  position: relative;
}

.header-users-btn {
  padding: 0.45rem 0.9rem;
  background: #f0f2f5;
  color: #333;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.header-users-btn:hover {
  background: #e8ebf0;
  border-color: #cfd6dd;
}

.header-users-wrap--open .header-users-btn {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.header-users-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(360px, calc(100vw - 2rem));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e1e5e9;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  z-index: 200;
}

.header-users-dropdown-inner {
  padding: 1rem 1rem 1.1rem;
}

.header-users-title {
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eef0f3;
  font-weight: 600;
}

.panel-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1d26;
  line-height: 1.3;
  word-wrap: break-word;
}

.role-panel h2 {
  margin-bottom: 1rem;
  color: #333;
}

.admin-pending-block h3,
.admin-users-block h3 {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-item {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
}

.stat-label {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.25rem;
}

.create-task {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.create-task h2 {
  margin-bottom: 1rem;
  color: #333;
}

#create-task-form input,
#create-task-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
}

#create-task-form textarea {
  min-height: 80px;
  resize: vertical;
}

#create-task-form input:focus,
#create-task-form textarea:focus {
  outline: none;
  border-color: #667eea;
}

#create-task-form button {
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

#create-task-form button:hover {
  background: #5568d3;
}

.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.task-card {
  background: white;
  padding: 0;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s;
  overflow: hidden;
}

.task-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.task-card__summary {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1rem 2.1rem;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.task-card__summary::-webkit-details-marker {
  display: none;
}

.task-card__summary::before {
  content: '';
  position: absolute;
  left: 0.85rem;
  top: 1.2rem;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid #888;
  border-bottom: 2px solid #888;
  transform: rotate(-45deg);
  transition: transform 0.15s ease, top 0.15s ease;
  flex-shrink: 0;
}

details[open] > .task-card__summary::before {
  top: 1.35rem;
  transform: rotate(45deg);
}

.task-card__summary-inner {
  flex: 1;
  min-width: 0;
}

.task-card__summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.45rem 0.75rem;
}

.task-card__summary-row--top {
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.35rem;
}

.task-card__summary-row--top .task-title {
  flex: 1;
  min-width: 0;
}

.task-card__summary-row--top .task-status {
  flex-shrink: 0;
  max-width: 48%;
  text-align: right;
  line-height: 1.35;
}

.task-card__summary-row--meta {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.35;
}

.task-card__summary-part {
  display: inline-block;
}

.task-card__summary-date {
  width: 100%;
  flex-basis: 100%;
  color: #888;
  font-size: 0.8rem;
}

.task-card__body {
  padding: 0 1.25rem 1.25rem;
  margin-left: 0;
  border-top: 1px solid #f0f2f5;
}

/* Legacy: старые карточки без details */
.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.task-header .task-title {
  flex: 1;
  min-width: 0;
}

.task-header .task-status {
  flex-shrink: 0;
  max-width: 48%;
  text-align: right;
  line-height: 1.35;
}

.task-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.task-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-pending {
  background: #fff3e0;
  color: #f57c00;
}

.status-in_progress {
  background: #e3f2fd;
  color: #1565c0;
}

.status-completed {
  background: #e8f5e9;
  color: #2e7d32;
}

.task-description {
  color: #666;
  margin: 0.5rem 0;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.task-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.task-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f2f5;
}

.task-actions button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.btn-take {
  background: #667eea;
  color: white;
}

.btn-complete {
  background: #2e7d32;
  color: white;
}

.btn-delete {
  background: #e74c3c;
  color: white;
}

.btn-translate {
  background: #9b59b6;
  color: white;
}

.btn-edit {
  background: #4f6fd8;
  color: white;
}

.btn-download-zip {
  background: #27ae60;
  color: white;
}

.task-actions button:hover {
  opacity: 0.85;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #999;
}

.file-upload {
  margin-bottom: 0.75rem;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px dashed #e1e5e9;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: #666;
  background: #fafbfc;
  transition: all 0.2s;
}

.file-label:hover {
  border-color: #667eea;
  color: #667eea;
  background: #f0f2ff;
}

.file-label input {
  display: none;
}

#file-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.file-preview-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  text-align: center;
}

.file-preview-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
}

.file-preview-item .file-name {
  font-size: 0.7rem;
  color: #666;
  margin-top: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
}

.file-preview-item .file-preview-size {
  font-size: 0.65rem;
  color: #888;
  margin-top: 0.1rem;
}

.file-label.file-label--over-limit #file-label-text {
  color: #c0392b;
  font-weight: 600;
}

.file-preview-item .file-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #e74c3c;
  color: white;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.file-icon {
  width: 64px;
  height: 64px;
  background: #667eea;
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.attachments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.attachment-item {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.attachment-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.attachment-item img:hover {
  transform: scale(1.06);
}

.attachment-item.file-attachment {
  padding: 0.5rem;
}

.attachment-item.file-attachment a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
}

.attachment-item.file-attachment .file-name {
  font-size: 0.75rem;
  color: #64748b;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  margin-top: 0.1rem;
}

.translations-display {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.translations-display h4 {
  margin-bottom: 0.75rem;
  color: #333;
}

.translation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.translation-block {
  position: relative;
  background: white;
  padding: 0.75rem;
  border-radius: 6px;
  border-left: 3px solid #667eea;
}

.translation-block strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #667eea;
  font-size: 0.85rem;
}

.translation-block p, .translation-block .translation-content {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  padding-right: 1.5rem; /* Make room for the copy button */
}

.translation-block__copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.translation-block__copy-btn:hover {
  background: #f1f5f9;
  color: #667eea;
}

.translation-block__copy-btn svg {
  width: 15px;
  height: 15px;
}

.translation-note {
  margin-top: 0.8rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e7ebf2;
}

.translation-note strong {
  display: block;
  margin-bottom: 0.3rem;
  color: #4b587c;
  font-size: 0.88rem;
}

.translation-note p, .translation-note .translation-note-content {
  margin: 0;
  color: #444;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  padding: 1.25rem;
  box-sizing: border-box;
}

.modal-overlay--confirm {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: default;
  z-index: 1100;
}

.modal-overlay--dialog {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: default;
}

.confirm-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.25rem;
  max-width: 420px;
  width: 100%;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  cursor: default;
  animation: confirm-pop 0.2s ease-out;
}

@keyframes confirm-pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.confirm-dialog__title {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1d26;
  line-height: 1.35;
}

.confirm-dialog__text {
  margin: 0 0 1.35rem;
  font-size: 0.95rem;
  color: #5c6370;
  line-height: 1.5;
}

.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.confirm-dialog__btn {
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.confirm-dialog__btn--secondary {
  background: #f1f3f6;
  color: #3d4450;
  border: 1px solid #e2e6ec;
}

.confirm-dialog__btn--secondary:hover {
  background: #e8ebf0;
}

.confirm-dialog__btn--primary {
  background: #667eea;
  color: #fff;
  box-shadow: 0 1px 2px rgba(102, 126, 234, 0.35);
}

.confirm-dialog__btn--primary:hover {
  background: #5a6fd6;
}

.confirm-dialog__btn--primary.confirm-dialog__btn--danger {
  background: #dc4a3d;
  box-shadow: 0 1px 2px rgba(220, 74, 61, 0.35);
}

.confirm-dialog__btn--primary.confirm-dialog__btn--danger:hover {
  background: #c73e32;
}

.modal-overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-content--edit {
  max-width: 760px;
}

.edit-task-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.edit-task-form input,
.edit-task-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.edit-task-form textarea {
  min-height: 230px;
  resize: vertical;
}

.edit-attachments-box {
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  padding: 0.75rem;
  background: #fafbff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edit-attachments-section-title {
  font-size: 0.85rem;
  color: #53607a;
  margin-bottom: 0.45rem;
}

.edit-attachments-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #b7c2dd;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  color: #33446b;
  background: #eef2ff;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

#edit-task-new-attachments {
  display: none;
}

.edit-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.edit-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #d9dfed;
  background: white;
}

.edit-attachment-chip__name {
  font-size: 0.82rem;
  color: #3f4a62;
  max-width: 300px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.edit-attachment-chip__btn {
  border: none;
  background: #f2f4f8;
  color: #3f4a62;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.edit-attachments-empty {
  font-size: 0.82rem;
  color: #7a849a;
}

.edit-task-form input:focus,
.edit-task-form textarea:focus {
  outline: none;
  border-color: #4f6fd8;
}

.edit-task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.edit-task-cancel-btn,
.edit-task-submit-btn {
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.05rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.edit-task-cancel-btn {
  background: #f1f3f6;
  color: #3d4450;
  border: 1px solid #e2e6ec;
}

.edit-task-submit-btn {
  background: #4f6fd8;
  color: white;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h2 {
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

#translation-task-info {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

#translation-task-info p, #translation-task-info .task-description-info {
  color: #555;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
}

.modal-attachments ul {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
}

.modal-attachments li {
  margin-bottom: 0.25rem;
}

.modal-attachments a {
  color: #667eea;
  text-decoration: none;
}

.modal-attachments a:hover {
  text-decoration: underline;
}

.translation-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.translation-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.translation-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  min-height: 120px;
  resize: vertical;
}

.translation-field textarea:focus {
  outline: none;
  border-color: #9b59b6;
}

.btn-submit-translation {
  width: 100%;
  padding: 0.75rem;
  background: #9b59b6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit-translation:hover {
  background: #8e44ad;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.turnstile-box {
  margin-bottom: 1rem;
  min-height: 65px;
}

#auth-error.auth-success {
  color: #1a7f37 !important;
  background: #e6ffed;
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.admin-pending-block {
  margin-bottom: 1.5rem;
}

.admin-pending-block h3 {
  font-size: 1rem;
  color: #333;
  margin-bottom: 0.75rem;
}

.pending-registrations-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pending-reg-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
}

.pending-reg-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.pending-reg-info strong {
  color: #333;
}

.pending-reg-date {
  color: #666;
  font-size: 0.875rem;
}

.pending-reg-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-pending-approve,
.btn-pending-reject {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-pending-approve {
  background: #27ae60;
  color: white;
}

.btn-pending-approve:hover {
  background: #219a52;
}

.btn-pending-reject {
  background: #fdf2f2;
  color: #c0392b;
  border: 1px solid #e1a5a5;
}

.btn-pending-reject:hover {
  background: #fadbd8;
}

.empty-hint,
.pending-reg-error {
  color: #666;
  font-size: 0.95rem;
}

.pending-reg-error {
  color: #c0392b;
}

.admin-users-block {
  margin-bottom: 1.5rem;
}

.admin-users-block h3 {
  font-size: 1rem;
  color: #333;
  margin-bottom: 0.75rem;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-user-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
}

.admin-user-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.admin-user-info strong {
  color: #333;
}

.admin-user-status {
  font-size: 0.85rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: #f0f3f6;
  color: #444;
}

.admin-user-status--approved {
  background: #e6ffed;
  color: #1a7f37;
}

.admin-user-status--pending {
  background: #fff8e6;
  color: #946200;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-user-self-hint {
  font-size: 0.875rem;
  color: #666;
}

.btn-user-delete {
  padding: 0.5rem 1rem;
  border: 1px solid #e1a5a5;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  background: #fdf2f2;
  color: #c0392b;
}

.btn-user-delete:hover {
  background: #fadbd8;
}

.btn-user-password {
  padding: 0.5rem 1rem;
  border: 1px solid #b8c4e0;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  background: #edf2ff;
  color: #2f4f9f;
}

.btn-user-password:hover {
  background: #dfe8ff;
}

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  left: 1.25rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  max-width: min(420px, 100%);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: toast-in 0.25s ease;
  border: 1px solid transparent;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-text {
  flex: 1;
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
}

.toast-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
}

.toast-close:hover {
  opacity: 1;
}

.toast--error {
  background: #fff5f5;
  border-color: #f5c6cb;
  color: #721c24;
}

.toast--success {
  background: #e8f8ef;
  border-color: #b7e1c1;
  color: #1e4620;
}

.toast--info {
  background: #eef4ff;
  border-color: #c5d5f5;
  color: #1a3a6e;
}

@media (min-width: 1200px) {
  .container {
    max-width: 1180px;
  }

  .create-task {
    padding: 1.4rem 1.5rem;
  }

  .task-card .task-card__summary {
    padding: 1.35rem 1.5rem 1.35rem 2.25rem;
  }

  .task-card .task-card__body {
    padding: 0 1.5rem 1.4rem;
  }

  .task-card .task-card__summary::before {
    left: 1rem;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  header {
    padding: 0.9rem 1.2rem;
    align-items: flex-start;
    gap: 0.7rem;
  }

  header h1 {
    font-size: 1.35rem;
  }

  .header-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
  }

  .container {
    max-width: 900px;
    margin: 1.25rem auto;
    padding: 0 0.9rem;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .stat-item {
    min-width: 0;
    padding: 0.95rem 0.75rem;
  }

  .create-task {
    padding: 1.25rem;
  }

  .task-card .task-card__summary {
    padding: 1.15rem 1.25rem 1.15rem 2.05rem;
  }

  .task-card .task-card__body {
    padding: 0 1.25rem 1.2rem;
  }

  .filters {
    gap: 0.45rem;
    margin-bottom: 1.2rem;
  }

  .filter-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
  }

  .task-card__summary-row--top {
    gap: 0.75rem;
  }

  .task-card__summary-row--top .task-status {
    max-width: 55%;
  }

  .attachments-list {
    gap: 0.65rem;
  }

  .attachment-item img {
    max-width: 170px;
    max-height: 170px;
  }

  .translation-fields,
  .translation-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
  }

  .modal-content {
    width: min(94vw, 760px);
    padding: 1.35rem;
  }

  .confirm-dialog {
    max-width: 520px;
  }
}

@media (max-width: 600px) {
  .auth-container {
    max-width: none;
    margin: 0 0.75rem;
    padding: 1.25rem 1rem;
    border-radius: 10px;
  }

  .auth-container h1 {
    font-size: 1.9rem;
    line-height: 1.2;
  }

  header {
    padding: 0.8rem 0.9rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  header h1 {
    font-size: 1.2rem;
    line-height: 1.25;
  }

  .header-right {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #user-display {
    width: 100%;
    font-size: 0.9rem;
  }

  #logout-btn {
    margin-left: auto;
  }

  .header-users-wrap {
    width: 100%;
  }

  .header-users-btn {
    width: 100%;
    text-align: left;
  }

  .header-users-dropdown {
    left: 0;
    right: auto;
    width: min(100%, calc(100vw - 1.8rem));
  }

  .container {
    margin: 1rem auto;
    padding: 0 0.6rem;
  }

  .create-task,
  .translations-display {
    padding: 1rem;
  }

  .task-card .task-card__summary {
    padding: 0.85rem 1rem 0.85rem 1.85rem;
  }

  .task-card .task-card__body {
    padding: 0 1rem 1rem;
  }

  .task-card .task-card__summary::before {
    left: 0.65rem;
    top: 1.05rem;
  }

  details[open] > .task-card .task-card__summary::before {
    top: 1.15rem;
  }

  #create-task-form button,
  .task-actions button,
  .btn-submit-translation {
    min-height: 42px;
  }

  .filters {
    gap: 0.4rem;
    margin-bottom: 1rem;
  }

  .filter-btn {
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
  }

  .task-card__summary-row--top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .task-card__summary-row--top .task-status {
    max-width: 100%;
    text-align: left;
  }

  .task-title {
    font-size: 1rem;
  }

  .task-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  .attachments-list {
    gap: 0.55rem;
  }

  .attachment-item img {
    max-width: 140px;
    max-height: 140px;
  }

  .attachment-item.file-attachment .file-name {
    max-width: 90px;
  }

  .translation-fields,
  .translation-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .stat-item {
    min-width: 0;
    padding: 0.85rem 0.5rem;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-label {
    text-align: center;
    line-height: 1.2;
  }

  .pending-reg-card,
  .admin-user-card {
    flex-direction: column;
    align-items: stretch;
  }

  .pending-reg-actions,
  .admin-user-actions {
    width: 100%;
  }

  .btn-pending-approve,
  .btn-pending-reject,
  .btn-user-delete {
    flex: 1;
    min-height: 40px;
  }

  .modal-overlay {
    padding: 0.6rem;
  }

  .modal-content {
    width: 100%;
    max-height: 94vh;
    padding: 1rem 0.85rem;
    border-radius: 10px;
  }

  .edit-task-actions {
    flex-direction: column-reverse;
  }

  .edit-task-cancel-btn,
  .edit-task-submit-btn {
    width: 100%;
    min-height: 42px;
  }

  .edit-attachment-chip__name {
    max-width: 190px;
  }

  .modal-header h2 {
    font-size: 1.05rem;
  }

  .confirm-dialog {
    max-width: none;
    width: 100%;
    padding: 1rem 0.9rem;
  }

  .confirm-dialog__actions {
    justify-content: stretch;
  }

  .confirm-dialog__btn {
    width: 100%;
    min-height: 42px;
  }

  .toast-container {
    right: 0.55rem;
    left: 0.55rem;
    bottom: 0.65rem;
  }

  .toast {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .task-actions button {
    width: 100%;
  }
}

/* === Photographer attachments === */

.photographer-attachments-block {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: #f0faf5;
  border-radius: 8px;
  border-left: 4px solid #27ae60;
}

.photographer-attachments-title {
  margin-bottom: 0.6rem;
  color: #1e7e45;
  font-size: 0.95rem;
  font-weight: 600;
}

.photographer-photo-item {
  position: relative;
}

.photographer-photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #e74c3c;
  color: white;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 0.15s;
}

.photographer-photo-delete:hover {
  background: #c0392b;
}

.btn-upload-photo {
  background: #27ae60;
  color: white;
}

.btn-upload-photo:hover {
  background: #219a52;
}

/* === Translator header button === */

.header-translator-wrap {
  display: flex;
  align-items: center;
}

.header-translator-create-btn {
  padding: 0.5rem 1rem;
  background: #9b59b6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.header-translator-create-btn:hover {
  background: #8e44ad;
}

/* Translator create modal textarea */
#translator-create-form .translation-field textarea {
  min-height: 90px;
}

#translator-task-description {
  min-height: 60px;
}

@media (max-width: 600px) {
  .header-translator-wrap {
    width: 100%;
  }

  .header-translator-create-btn {
    width: 100%;
    min-height: 40px;
  }
}

/* === Pagination === */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-pagination {
  background: #f1f3f5;
  border: 1px solid #ced4da;
  color: #495057;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-pagination:hover:not(:disabled) {
  background: #e9ecef;
  border-color: #adb5bd;
}

.btn-pagination:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-weight: 500;
  color: #495057;
}

.pagination-settings {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #495057;
  font-weight: 500;
}

.items-per-page-select {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #495057;
  outline: none;
}

@media (max-width: 500px) {
  .pagination-container {
    flex-direction: column;
    gap: 1rem;
  }
}

.admin-note-display {
  margin-top: 0.8rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #fdf5e6;
  border: 1px solid #f5deb3;
  border-left: 4px solid #f39c12;
}

.admin-note-display strong {
  display: block;
  margin-bottom: 0.3rem;
  color: #d35400;
  font-size: 0.88rem;
}

.admin-note-display p, .admin-note-display .admin-note-content {
  margin: 0;
  color: #3e2723;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.linkified {
  color: #667eea;
  text-decoration: underline;
  word-break: break-all;
}

.linkified:hover {
  color: #5a6fd6;
}


