* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  background-color: #f0f4f8;
  color: #2d3748;
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 40px;
}

/* Шапка (Navbar) */
.navbar {
  background-color: #0f172a;
  color: #ffffff;
  padding: 12px 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  background: #10b981;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-sub {
  font-size: 12px;
  color: #94a3b8;
}

.badge-role {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.badge-user {
  background-color: #1e3a8a;
  color: #93c5fd;
}

.badge-admin {
  background-color: #064e3b;
  color: #6ee7b7;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

.role-switcher {
  background-color: #1e293b;
  padding: 3px;
  border-radius: 8px;
  display: flex;
  gap: 3px;
}

.role-btn {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.role-btn.active {
  background-color: #334155;
  color: #ffffff;
}

/* Центральная большая кнопка НОВАЯ ЗАЯВКА */
.center-action-card {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.btn-new-ticket {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 16px 36px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-new-ticket:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-new-ticket:active {
  transform: translateY(0);
}

/* Кнопки */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-green {
  background-color: #10b981;
  color: white;
}

.btn-green:hover {
  background-color: #059669;
}

.btn-gray {
  background-color: #e2e8f0;
  color: #475569;
}

.btn-gray:hover {
  background-color: #cbd5e1;
}

.btn-outline {
  background: white;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.btn-outline:hover {
  background: #f8fafc;
}

/* Контейнер */
.main-container {
  max-width: 1400px;
  margin: 10px auto 0;
  padding: 0 20px;
}

/* Статистика */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06);
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

/* Цветовые акценты полосок слева у карточек */
.stat-card.card-total::before {
  background-color: #3b82f6;
}

.stat-card.card-pending::before {
  background-color: #f59e0b;
}

.stat-card.card-urgent::before {
  background-color: #ef4444;
}

.stat-card.card-done::before {
  background-color: #10b981;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-grey {
  background: #eff6ff;
  color: #3b82f6;
}

.icon-orange {
  background: #fef3c7;
  color: #d97706;
}

.icon-red {
  background: #fee2e2;
  color: #dc2626;
}

.icon-green {
  background: #d1fae5;
  color: #059669;
}

.val-orange {
  color: #d97706;
}

.val-red {
  color: #dc2626;
}

.val-green {
  color: #059669;
}

.icon-grey {
  background: #f1f5f9;
  color: #64748b;
}

.icon-orange {
  background: #fef3c7;
  color: #d97706;
}

.icon-red {
  background: #fee2e2;
  color: #dc2626;
}

.icon-green {
  background: #d1fae5;
  color: #059669;
}

.label-orange {
  color: #b45309;
}

.val-orange {
  color: #d97706;
}

.label-red {
  color: #b91c1c;
}

.val-red {
  color: #dc2626;
}

.label-green {
  color: #047857;
}

.val-green {
  color: #059669;
}

/* Карточки-контейнеры */
.card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 15px;
}

/* Фильтры */
.filter-card {
  padding: 15px 20px;
}

.filter-wrapper {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  font-size: 13px;
}

.search-box input:focus {
  border-color: #3b82f6;
}

.filter-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

@media(min-width: 768px) {
  .filter-controls {
    width: auto;
  }
}

.filter-controls select {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  outline: none;
  font-size: 13px;
}

.btn-reset {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 13px;
}

.btn-reset:hover {
  color: #0f172a;
}

/* Таблица */
.table-card {
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1000px;
}

th,
td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
}

/* Выделение телефона жирным шрифтом без переносов */
td:nth-child(6) {
  font-weight: 600;
  white-space: nowrap;
}

/* Расцветка строк таблицы */
tr.row-done {
  background-color: #dcfce7 !important;
  color: #14532d;
}

tr.row-paused {
  background-color: #fef9c3 !important;
  color: #713f12;
}

tr.row-urgent {
  background-color: #fee2e2 !important;
  color: #7f1d1d;
}

tr.row-normal {
  background-color: #ffffff;
}

tr:hover {
  filter: brightness(0.97);
}

.urgency-tag-urgent {
  color: #dc2626;
  font-weight: 800;
}

.text-italic {
  font-style: italic;
}

/* Действия в таблице */
.table-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-icon-check {
  border-color: #86efac;
  color: #16a34a;
}

.btn-icon-check:hover {
  background: #dcfce7;
}

.btn-icon-check.active-done {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.btn-icon-check.active-done:hover {
  background: #15803d;
}

.btn-icon-delete {
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-icon-delete:hover {
  background: #fee2e2;
}

/* Пагинация */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #64748b;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.pagination-controls select {
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  outline: none;
  font-size: 13px;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-current {
  font-weight: 600;
  color: #0f172a;
  padding: 0 8px;
}

/* Модальные окна */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 15px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  overflow-y: auto;
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

/* Анимированное диалоговое окно успешного создания с плавной анимацией */
.success-dialog {
  max-width: 380px;
  text-align: center;
  padding: 30px 24px;
}

.success-icon-wrap {
  font-size: 48px;
  color: #10b981;
  margin-bottom: 15px;
  animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  60% {
    transform: scale(1.1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

.success-dialog h3 {
  font-size: 18px;
  color: #0f172a;
  margin-bottom: 8px;
}

.success-dialog p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}

.btn-ok {
  width: 100%;
  justify-content: center;
  padding: 10px;
  font-size: 15px;
}

.modal-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.req {
  color: #dc2626;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  font-size: 13px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #3b82f6;
}

.admin-section {
  border-top: 2px dashed #e2e8f0;
  padding-top: 14px;
  margin-top: 10px;
}

.admin-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.phone-cell {
  cursor: pointer;
  transition: color 0.15s;
}

.phone-cell:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Зона Drag-and-Drop для файлов */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone.dragover {
  border-color: #059669;
  background: #ecfdf5;
}

.dropzone i {
  font-size: 28px;
  color: #059669;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 13px;
  color: #475569;
}

.dropzone-text span {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
}

.selected-files-list {
  font-size: 12px;
  color: #059669;
  margin-top: 6px;
  font-weight: 600;
}