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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
  background: #f8fafc;
  min-height: 100vh;
  padding: 40px 20px;
  color: #1f2937;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #4c1d95 0%, #3730a3 50%, #1e1b4b 100%);
  padding: 60px 40px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.header .logo {
  position: absolute;
  top: 0rem;
  left: 2rem;
  height: 6rem;
  width: auto;
  z-index: 2;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
}

.header h1 {
  font-size: 3.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  top: 2rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.header p {
  font-size: 1.25rem;
  opacity: 0.9;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.content {
  padding: 40px;
  background: white;
}

.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.sheet-tab {
  background: #e5e7eb;
  border: 1px solid #9ca3af;
  color: #374151;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.sheet-tab:hover {
  background: #d1d5db;
  border-color: #6b7280;
  color: #1f2937;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sheet-tab.active {
  background: linear-gradient(135deg, #4c1d95 0%, #3730a3 100%);
  color: white;
  border-color: #3730a3;
  box-shadow: 0 4px 12px rgba(75, 0, 130, 0.4);
}

.sheet-tab.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(75, 0, 130, 0.5);
}

.sheet-tab.form-tab {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  border-color: #059669;
  text-decoration: none;
}

.sheet-tab.form-tab:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  border-color: #047857;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.table-container {
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-top: 24px;
  border: 1px solid #e5e7eb;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 600px;
}

th {
  background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%);
  color: white;
  padding: 16px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: none;
  vertical-align: middle;
}

th:first-child {
  border-top-left-radius: 16px;
}

th:last-child {
  border-top-right-radius: 16px;
}


/* Mobile layout with headers on top */
@media (max-width: 480px) {
  .content {
    padding: 24px;
  }
  
  .table-container {
    margin-top: 16px;
  }
  
  table, thead, tbody, th, td, tr {
    display: block;
  }
  
  /* Show headers at the top */
  thead tr {
    display: block;
    padding: 4px;
    background: rgba(76, 29, 149, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
  }
  
  th {
    border: none !important;
    padding: 6px 8px !important;
    text-align: center !important;
    font-size: 0.95rem !important;
    max-width: none !important;
    display: inline-block;
    width: 48%;
    margin-right: 2%;
    margin-bottom: 4px;
    vertical-align: top;
    background: linear-gradient(135deg, #4c1d95 0%, #3730a3 100%);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    word-wrap: break-word;
    line-height: 1.3;
  }
  
  tbody tr {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
    padding: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  tbody tr:nth-child(even) {
    background: #f8f6ff;
  }
  
  td {
    border: none !important;
    padding: 4px 2px !important;
    text-align: center !important;
    font-size: 1rem !important;
    max-width: none !important;
    display: inline-block;
    width: 48%;
    margin-right: 2%;
    margin-bottom: 6px;
    vertical-align: top;
    word-wrap: break-word;
    line-height: 1.3;
  }
  
  /* Remove the labels - show only values */
  td::before {
    content: none;
  }
  
  /* Clear float every 2 items to create new rows */
  td:nth-child(2n+1) {
    clear: left;
  }
}

/* Tablet/small desktop view - allow scrolling */
@media (max-width: 768px) and (min-width: 481px) {
  table {
    min-width: 600px;
  }
  
  .table-container {
    overflow-x: auto;
  }
}

td {
  padding: 12px 16px;
  border: none;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #374151;
  vertical-align: middle;
  font-weight: bold;
}

tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  background: white;
}

tbody tr:nth-child(even) {
  background: #f8f6ff;
}

tbody tr:nth-child(odd) {
  background: white;
}

tbody tr:hover {
  background: linear-gradient(135deg, #f3f0ff 0%, #ede9fe 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:last-child td:first-child {
  border-bottom-left-radius: 16px;
}

tbody tr:last-child td:last-child {
  border-bottom-right-radius: 16px;
}

.loading {
  text-align: center;
  padding: 60px;
  font-size: 1.1rem;
  color: #6b7280;
  font-weight: 500;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-left: 12px;
  border: 3px solid #e5e7eb;
  border-radius: 50%;
  border-top-color: #6b7280;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  text-align: center;
  padding: 40px;
  color: #dc2626;
  background: #fef2f2;
  border-radius: 12px;
  margin: 20px 0;
  border: 1px solid #fecaca;
  font-weight: 500;
}

@media (max-width: 768px) {
  body {
    padding: 20px 15px;
  }
  
  .header {
    padding: 40px 24px;
  }
  
  .header .logo {
    height: 4rem;
    top: 0.5rem;
    left: 1rem;
  }
  
  .header h1 {
    font-size: 2.5rem;
  }
  
  .content {
    padding: 24px;
  }
  
  .table-container {
    border-radius: 12px;
    margin: 0 -24px;
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px 10px;
  }
  
  .header {
    padding: 32px 20px;
  }
  
  .header .logo {
    height: 3rem;
    top: 0.5rem;
    left: 1rem;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .header p {
    font-size: 1.1rem;
  }
  
  .content {
    padding: 20px;
  }
  
  .table-container {
    margin: 0 -20px;
    margin-top: 20px;
    border-radius: 8px;
  }
  
  table {
    min-width: 320px;
  }
  
  
  tbody tr {
    height: auto;
    min-height: 50px;
  }
  
  th:first-child, tbody tr:last-child td:first-child {
    border-radius: 8px 0 0 8px;
  }
  
  th:last-child, tbody tr:last-child td:last-child {
    border-radius: 0 8px 8px 0;
  }
}

.footer {
  background: linear-gradient(135deg, #4c1d95 0%, #3730a3 50%, #1e1b4b 100%);
  color: white;
  padding: 24px 40px;
  text-align: center;
  margin: 0px auto 0 auto;
  max-width: 1200px;
  border-radius: 24px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer-content p {
  margin: 4px 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.footer-content p:first-child {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
}