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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  min-height: 100vh;
  padding: 20px;
  color: #e0e0e0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.card {
  background: #2d3436;
  border-radius: 2px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

.card h2 {
  color: #74b9ff;
  margin-bottom: 20px;
  font-size: 1.5rem;
  border-bottom: 2px solid #636e72;
  padding-bottom: 10px;
}

.card h3 {
  color: #b2bec3;
  margin: 20px 0 15px;
  font-size: 1.2rem;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #dfe6e9;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="month"],
.form-group input[type="file"],
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #636e72;
  border-radius: 2px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background: #2d3436;
  color: #dfe6e9;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="number"]::placeholder,
.form-group input[type="month"]::placeholder {
  color: #636e72;
  opacity: 1;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #74b9ff;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.period-item {
  border: 1px solid #636e72;
  border-radius: 2px;
  padding: 15px;
  margin-bottom: 15px;
  position: relative;
  background: #2d3436;
}

.period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.period-number {
  font-weight: bold;
  color: #74b9ff;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 2px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.btn-primary {
  background: #2c3e50;
  color: white;
}

.btn-primary:hover {
  background: #1a252f;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(44, 62, 80, 0.3);
}

.btn-success {
  background: #00b894;
  color: white;
}

.btn-success:hover {
  background: #00a383;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 184, 148, 0.3);
}

.btn-secondary {
  background: #636e72;
  color: #dfe6e9;
}

.btn-secondary:hover {
  background: #2d3436;
}

.btn-danger {
  background: #f56565;
  color: white;
  padding: 5px 10px;
  font-size: 0.9rem;
}

.btn-danger:hover {
  background: #e53e3e;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

.contrib-mode {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.contrib-mode label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.contrib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 15px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: #2d3436;
  border-radius: 2px;
}

.contrib-field {
  display: flex;
  flex-direction: column;
}

.contrib-field label {
  font-size: 0.85rem;
  margin-bottom: 3px;
}

.contrib-field input {
  padding: 6px;
  font-size: 0.9rem;
}

.year-section {
  margin-bottom: 15px;
  border: 1px solid #636e72;
  border-radius: 2px;
  background: #2d3436;
}

.year-header {
  padding: 12px 15px;
  background: #636e72;
  cursor: pointer;
  user-select: none;
  border-radius: 2px;
}

.year-toggle {
  color: #74b9ff;
  font-weight: bold;
  cursor: pointer;
}

.year-header:hover {
  background: #2d3436;
}

.year-content {
  padding: 15px;
}

.pdf-results-summary {
  margin-top: 15px;
  padding: 15px;
  background: #2d3436;
  border-radius: 2px;
  border: 1px solid #636e72;
}

.pdf-results-summary h4 {
  color: #00b894;
  margin-bottom: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-radius: 2px;
  color: white;
}

.summary-item .label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 5px;
}

.summary-item .value {
  font-size: 1.8rem;
  font-weight: bold;
}

.table-container {
  overflow-x: auto;
  margin-top: 15px;
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid #636e72;
  border-radius: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: #2c3e50;
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

th,
td {
  padding: 12px;
  text-align: right;
  border-bottom: 1px solid #636e72;
  white-space: nowrap;
  min-width: 100px;
  resize: horizontal;
  overflow: hidden;
}

th:first-child,
td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #2d3436;
  z-index: 5;
}

th.master-column,
td.master-column {
  background: #1a252f;
  font-weight: 600;
}

thead th:first-child {
  background: #2c3e50;
  z-index: 15;
}

thead th.master-column {
  background: #1a252f;
  z-index: 15;
}

th.resizable {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

th.resizable:hover {
  background: #34495e;
}

th.hidden,
td.hidden {
  display: none;
}

tbody tr:hover {
  background: #636e72;
}

tbody tr:hover td:first-child,
tbody tr:hover td.master-column {
  background: #4a5568;
}

.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
/* Custom Modal Dialog */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-in;
}

.modal-content {
  background: #2d3436;
  border-radius: 3px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-out;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #34495e;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: #74b9ff;
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  color: #b2bec3;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #ff6b6b;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  color: #dfe6e9;
  line-height: 1.6;
}

.modal-body ol,
.modal-body ul {
  margin: 12px 0;
  padding-left: 24px;
}

.modal-body li {
  margin: 6px 0;
}

.modal-body p {
  margin: 12px 0;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #34495e;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.spinner {
  border: 4px solid #636e72;
  border-top: 4px solid #2c3e50;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading p {
  color: white;
  margin-top: 15px;
  font-size: 1.2rem;
}

.info-text {
  background: #2d3436;
  border-left: 4px solid #74b9ff;
  padding: 12px 15px;
  margin: 15px 0;
  border-radius: 2px;
  font-size: 0.95rem;
  color: #b2bec3;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }

  header h1 {
    font-size: 2rem;
  }
}
