* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  background: #f3f5f9;
  font-family: Arial, sans-serif;
  color: #222;
}
header {
  background: #fff;
  box-shadow: 0 1px 0 #ececec;
}
.topbar {
  display: flex;
  align-items: center;
  position: relative;
  padding: 18px 0 0 32px;
}
.logo-img {
  height: 42px;
  width: auto;
  margin-left: 24px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.logo-img:hover {
  opacity: 0.8;
}
.burger-menu {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.burger-bar {
  width: 26px;
  height: 3px;
  background: #232323;
  border-radius: 2px;
}
.telegram-link {
  position: absolute;
  right: 32px;
  top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  box-shadow: 0 2px 10px #e2e8f0;
  transition: background 0.3s, box-shadow 0.3s;
  text-decoration: none;
}
.telegram-link:hover {
  background: #1abc9c;
  box-shadow: 0 4px 16px rgba(26, 188, 156, 0.4);
}
.telegram-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 255px;
  height: 100vh;
  background: #f7f7f7;
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.07);
  z-index: 2000;
  border-radius: 0 0 6px 0;
  transform: translateX(-110%);
  transition: transform 0.35s cubic-bezier(0.57,0.04,0.45,1.01);
  padding: 32px 0 0 24px;
  overflow-y: auto;
}
.sidebar.open {
  transform: translateX(0);
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar li {
  font-size: 1.15em;
  color: #232a38;
  margin-bottom: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s;
}
.sidebar li:hover {
  color: #1abc9c;
}

.page { display: none; }
.page.active { display: block; }

.main-title {
  font-size: 2em;
  font-weight: bold;
  margin-top: 40px;
  margin-bottom: 8px;
  text-align: center;
  color: #202a40;
}
.main-desc {
  color: #313957;
  margin-bottom: 24px;
  margin-top: 0;
  font-size: 1.02em;
  text-align: center;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: calc(3 * 330px + 2 * 14px);
  margin: 0 auto;
  padding: 0;
}
.card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 2px 14px #e2e8f0;
  width: 100%;
  max-width: 330px;
  height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.card:hover {
  box-shadow: 0 6px 30px #d6dee7;
  transform: translateY(-8px);
}
.card-illustration {
  width: 145px;
  min-height: 128px;
  margin: 28px auto 12px;
  display: block;
  align-self: center;
  object-fit: contain;
}
.card-title {
  font-size: 1.12em;
  font-weight: bold;
  color: #21304c;
  margin-left: 16px;
  margin-bottom: 12px;
  margin-top: 0;
}
.card-link {
  color: #bbb;
  font-size: 1em;
  text-decoration: none;
  margin-left: 16px;
  margin-top: 2px;
  transition: color 0.18s;
}
.card-link:hover {
  color: #1abc9c;
  text-decoration: underline;
}

.center-panel {
  width: 1120px;
  min-height: 500px;
  margin: 52px auto 0;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 8px 46px #e2e8f0;
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page-back {
  text-align: left;
  width: 90%;
  margin-bottom: 8px;
}
.arrow-img {
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: transform 0.2s;
}
.arrow-img:hover {
  transform: scale(1.1);
}
.center-title {
  font-size: 1.54em;
  font-weight: bold;
  color: #1a253e;
  margin-bottom: 8px;
  margin-top: 0;
  text-align: left;
  width: 90%;
  letter-spacing: 0.01em;
}
.subtitle {
  color: #6e7483;
  font-size: 0.99em;
  margin-bottom: 12px;
  width: 90%;
  text-align: left;
}
.center-content {
  background: #fafbfc;
  border-radius: 18px;
  min-height: 300px;
  width: 92%;
  box-shadow: 0 1px 0 #ececec;
  overflow-x: auto;
  padding: 0;
}

/* ===== ТАБЛИЦА ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  background: #fff;
  font-size: 0.95em;
}
.data-table thead {
  background: #1abc9c;
  color: white;
  font-weight: 600;
}
.data-table th {
  padding: 14px 10px;
  text-align: center;
  border: 1px solid #ddd;
}
.data-table td {
  padding: 14px 10px;
  text-align: center;
  border: 1px solid #ddd;
  color: #333;
}
.data-table tbody tr:nth-child(odd) {
  background: #f9fafb;
}
.data-table tbody tr:hover {
  background: #f0f7f6;
}
.data-table tbody td:first-child {
  text-align: left;
  font-weight: 500;
  color: #1a253e;
}

/* ===== ЗТК ПОИСК И ФИЛЬТР ===== */
.ztk-search {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  padding: 16px;
}
.ztk-search .search-input {
  flex: 1;
  min-width: 200px;
  padding: 12px 14px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 0.95em;
  transition: border-color 0.2s;
}
.ztk-search .search-input:focus {
  outline: none;
  border-color: #1abc9c;
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.1);
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}
.status-badge.status-растаможен {
  background: #d4edda;
  color: #155724;
}
.status-badge.status-ожидает-оплаты {
  background: #fff3cd;
  color: #856404;
}
.status-badge.status-ожидает-оплату-утилизационного-сбора {
  background: #f8d7da;
  color: #721c24;
}
.status-badge.status-ожидает-растаможивания {
  background: #d1ecf1;
  color: #0c5460;
}

/* ===== ПОИСК КОНТЕЙНЕРА ===== */
.search-container {
  padding: 20px;
  background: #fff;
}
.alert-box {
  display: flex;
  align-items: center;
  background: #fef3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  gap: 12px;
}
.alert-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.alert-text {
  color: #856404;
  font-size: 0.95em;
  font-weight: 500;
}
.search-group {
  display: flex;
  gap: 10px;
  align-items: center;
}
.search-input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1em;
  font-family: monospace;
  transition: border-color 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: #1abc9c;
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.1);
}
.char-counter {
  font-size: 0.9em;
  color: #666;
  font-weight: 600;
  min-width: 35px;
  text-align: center;
}
.search-btn {
  padding: 12px 28px;
  background: #1abc9c;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.search-btn:hover {
  background: #16a085;
  box-shadow: 0 2px 8px rgba(26, 188, 156, 0.3);
}
.search-btn:active {
  background: #138d75;
}

/* ===== ОШИБКИ ===== */
.error-notification {
  position: fixed;
  top: 32px;
  right: 40px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  padding: 22px 22px 15px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 340px;
  max-width: 370px;
  z-index: 9999;
  opacity: 0;
  transform: translateX(350px);
  transition: all 0.35s cubic-bezier(0.71,0.24,0.27,0.94);
}
.error-notification.show {
  opacity: 1;
  transform: translateX(0);
}
.error-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}
.error-text {
  flex: 1;
}
.error-text strong {
  color: #f44;
  font-size: 1.13em;
  display: block;
}
.error-text p {
  margin: 4px 0 6px 0;
  color: #333;
  font-size: 0.98em;
}
.error-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0 2px;
  transition: color 0.2s;
}
.error-close:hover {
  color: #111;
}

.error-bar-wrapper {
  width: 100%;
  background: #eef0f4;
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-top: 4px;
}
.error-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff4444 40%, #ffa444 100%);
  border-radius: 99px;
  animation: errorprogress 3s linear forwards;
}
@keyframes errorprogress {
  0% { width: 0%; }
  100% { width: 100%; }
}

@media (max-width: 1200px) {
  .center-panel { width: 96vw; }
}
@media (max-width: 700px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); max-width: calc(2 * 330px + 1 * 14px); }
  .center-panel { width: 99vw; padding: 6vw 0; min-height: 320px; }
  .center-title, .subtitle { width: 94%; }
  .center-content { width: 98%; min-height: 180px; }
  .error-notification { right: 10px; left: 10px; max-width: none; }
  .telegram-link { right: 16px; top: 16px; width: 34px; height: 34px; }
  .arrow-img { width: 26px; height: 26px; }
  .data-table { font-size: 0.8em; }
  .data-table th, .data-table td { padding: 8px 4px; }
  .ztk-search { flex-direction: column; }
  .ztk-search .search-input { min-width: 100%; }
}
