* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: white;
  min-height: 100vh;
}

/* ===== LOGIN PAGE ===== */

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

.login-box {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-box h1 {
  margin-bottom: 10px;
  color: #333;
  font-size: 28px;
}

.subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 14px;
}

/* ===== COMMON STYLES ===== */

.input-field {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 15px;
  transition: border-color 0.3s;
}

.input-field:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.btn-primary {
  background-color: #4CAF50;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background-color: #45a049;
}

.btn-secondary {
  background-color: #2196F3;
  color: white;
}

.btn-secondary:hover {
  background-color: #0b7dda;
}

.btn-pagination {
  padding: 8px 12px;
  background-color: #f0f0f0;
  color: #333;
  margin: 0 4px;
}

.btn-pagination:hover,
.btn-pagination.active {
  background-color: #4CAF50;
  color: white;
}

/* ===== LIST PAGE ===== */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.writer-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.writer-info span {
  font-size: 16px;
  font-weight: 500;
}

.writer-info strong {
  color: #4CAF50;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.list-table thead {
  background-color: #f9f9f9;
  border-bottom: 2px solid #ddd;
}

.list-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #555;
}

.list-table td {
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.list-row {
  cursor: pointer;
  transition: background-color 0.2s;
}

.list-row:hover {
  background-color: #f5f5f5;
}

.col-number {
  width: 80px;
  text-align: center;
}

.col-date {
  flex: 1;
}

.col-type {
  width: 150px;
}

.sort-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  margin-left: 5px;
  color: #4CAF50;
}

.error {
  color: #f44336;
  text-align: center;
  padding: 20px;
}

.pagination {
  text-align: center;
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* ===== DETAIL PAGE ===== */

.detail-container {
  padding: 30px;
}

.detail-title {
  font-size: 32px;
  margin-bottom: 30px;
  text-align: center;
  color: #333;
}

.info-header {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 4px;
}

.info-section {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.info-label {
  font-weight: 600;
  color: #555;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.info-value {
  font-size: 14px;
  color: #333;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.info-input {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}

.info-input:focus {
  outline: none;
  border-color: #4CAF50;
}

.save-status {
  text-align: right;
  font-size: 14px;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 4px;
  background-color: #e8f5e9;
  color: #2e7d32;
}

.save-status.saving {
  background-color: #fff3e0;
  color: #f57c00;
}

.save-status.error {
  background-color: #ffebee;
  color: #c62828;
}

.checklist-table-wrapper {
  overflow-x: auto;
  margin-bottom: 30px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

.checklist-table thead {
  background-color: #f9f9f9;
  border-bottom: 2px solid #ddd;
  position: sticky;
  top: 0;
}

.checklist-table th {
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  color: #555;
  font-size: 13px;
  white-space: nowrap;
}

.checklist-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.col-category {
  min-width: 100px;
  text-align: left;
}

.col-item {
  min-width: 300px;
  text-align: left;
  font-size: 14px;
}

.col-date-cell {
  width: 60px;
  font-size: 12px;
}

.col-check {
  width: 70px;
}

.check-select {
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  background-color: white;
  transition: border-color 0.2s;
}

.check-select:focus {
  outline: none;
  border-color: #4CAF50;
}

.bottom-buttons {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.bottom-buttons .btn {
  min-width: 150px;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .info-header {
    gap: 15px;
    padding: 12px;
  }

  .info-label {
    font-size: 13px;
  }

  .info-value {
    font-size: 13px;
  }

  .info-input {
    font-size: 13px;
  }

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

  .writer-info {
    width: 100%;
  }

  .writer-info button {
    flex: 1;
  }

  .detail-title {
    font-size: 24px;
  }

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

  .info-row label {
    width: auto;
  }

  .info-row span,
  .info-row input {
    width: 100%;
    max-width: none;
  }

  .checklist-table-wrapper {
    margin: 0 -15px;
  }

  .col-category,
  .col-item {
    min-width: auto;
  }

  .col-item {
    width: 150px;
    font-size: 12px;
  }

  .checklist-table th,
  .checklist-table td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .col-date-cell {
    width: 50px;
  }

  .check-select {
    padding: 4px;
    font-size: 12px;
  }

  .list-table th,
  .list-table td {
    padding: 10px;
    font-size: 13px;
  }

  .col-number {
    width: 60px;
  }

  .col-type {
    width: 100px;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 20px;
  }

  .login-box h1 {
    font-size: 22px;
  }

  .info-header {
    flex-direction: column;
    gap: 12px;
    padding: 10px;
  }

  .info-section {
    gap: 6px;
  }

  .info-label {
    font-size: 12px;
  }

  .info-value {
    font-size: 12px;
  }

  .info-input {
    padding: 5px 8px;
    font-size: 12px;
  }

  .detail-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .checklist-table th,
  .checklist-table td {
    padding: 6px 4px;
    font-size: 11px;
  }

  .col-date-cell {
    width: 45px;
  }

  .check-select {
    padding: 3px;
    font-size: 11px;
  }

  .col-item {
    width: 120px;
  }
}
