* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f6f8;
  color: #222;
}

button {
  font-family: inherit;
}

.header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-size: 22px;
  font-weight: 700;
}

.header-subtitle {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}

.language-buttons {
  display: flex;
  gap: 6px;
}

.language-button {
  border: 1px solid #d1d5db;
  background: #ffffff;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.language-button.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 50px;
}

.loading {
  text-align: center;
  padding: 80px 20px;
  color: #6b7280;
}

.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.section-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.section-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 24px;
  cursor: pointer;
  transition: 0.15s ease;
}

.section-box:hover {
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.section-box.active {
  border-color: #111827;
  box-shadow: 0 0 0 1px #111827;
}

.section-box-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-box-count {
  color: #6b7280;
  font-size: 14px;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
}

.section-description {
  color: #6b7280;
  margin: 0;
}

.category-wrapper {
  margin-bottom: 24px;
}

.category-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(150px, 1fr)
  );
  gap: 10px;
}

.category-box {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  text-align: left;
  transition: 0.15s ease;
}

.category-box:hover {
  border-color: #9ca3af;
}

.category-box.active {
  border-color: #111827;
  box-shadow: 0 0 0 1px #111827;
}

.category-name {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.category-count {
  margin-top: 5px;
  color: #6b7280;
  font-size: 12px;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 14px;
}

.button {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button:hover {
  background: #f3f4f6;
}

.button.primary {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.button.primary:hover {
  background: #1f2937;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.empty {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  color: #6b7280;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(260px, 1fr)
  );
  gap: 16px;
}

.product-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f3f4f6;
  display: block;
}

.product-content {
  padding: 18px;
}

.product-category {
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 6px;
}

.product-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}

.product-description {
  color: #4b5563;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-content .button {
  margin-top: 14px;
  width: 100%;
}

.updated-at {
  margin-top: 30px;
  text-align: right;
  color: #9ca3af;
  font-size: 12px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
  padding: 30px;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 100%;
  max-width: 720px;
  max-height: 100%;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-title {
  font-weight: 700;
  font-size: 15px;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  color: #374151;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-line;
}

@media (max-width: 800px) {
  .section-boxes {
    grid-template-columns: 1fr;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .container {
    padding: 20px 14px 40px;
  }

  .modal {
    padding: 10px;
  }
}


/* Login page */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 48px 32px;
  text-align: center;
}

.login-button {
  margin-top: 32px;
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.login-button:hover {
  background: #1f2937;
}

.login-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.login-note {
  margin: 14px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.login-card .error {
  margin: 20px 0 0;
  text-align: left;
}
