* {
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f5f5f5;
  color: #333;
}

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

header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

header .logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

header .header-text h1 {
  margin: 0;
  color: #c65d1a;
}

header .tagline {
  margin: 4px 0 0;
  color: #666;
  font-size: 16px;
  font-weight: 500;
}

.hero {
  background: linear-gradient(135deg, #fff 0%, #fef9f6 100%);
  padding: 32px 24px;
  margin-bottom: 24px;
  border-radius: 12px;
  border: 1px solid #f0e6de;
  text-align: center;
}

.hero-title {
  margin: 0 0 12px;
  font-size: 1.75rem;
  color: #2c2c2c;
  font-weight: 600;
  line-height: 1.3;
}

.hero-subtitle {
  margin: 0 auto 24px;
  max-width: 700px;
  font-size: 1.05rem;
  color: #555;
  line-height: 1.6;
}

.hero-benefits {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}

.benefit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  color: #444;
}

.benefit-icon {
  font-size: 18px;
}

@media (max-width: 768px) {
  .hero {
    padding: 24px 16px;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-benefits {
    flex-direction: column;
    align-items: stretch;
  }

  .benefit {
    justify-content: center;
  }

  .extraction-mode {
    flex-direction: column;
  }

  .extraction-mode label {
    width: 100%;
  }
}

.section {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section h2 {
  margin: 0 0 15px;
  font-size: 1.2rem;
}

.hidden {
  display: none !important;
}

.token-input {
  display: flex;
  gap: 10px;
}

.token-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  background: #c65d1a;
  color: white;
}

button:hover {
  background: #a34d15;
}

button.danger {
  background: #cc3300;
}

button.danger:hover {
  background: #a32900;
}

.dropzone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #c65d1a;
}

.dropzone input {
  display: none;
}

.dropzone-main {
  font-size: 16px;
  font-weight: 500;
  color: #444;
  margin: 0;
}

.dropzone-hint {
  font-size: 13px;
  color: #999;
  margin: 8px 0 0;
}

.extraction-mode {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.extraction-mode label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  padding: 12px 16px;
  background: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  flex: 1;
  transition: all 0.2s;
}

.extraction-mode label:hover {
  background: #f5f5f5;
  border-color: #c65d1a;
}

.extraction-mode label:has(input:checked) {
  background: #fef9f6;
  border-color: #c65d1a;
  box-shadow: 0 2px 4px rgba(198, 93, 26, 0.1);
}

.extraction-mode input[type="radio"] {
  margin: 3px 0 0 0;
  accent-color: #c65d1a;
}

.extraction-mode label > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-hint {
  font-size: 12px;
  color: #777;
  font-weight: normal;
}

.actions {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.file-button {
  padding: 8px 16px;
  background: #c65d1a;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.file-button:hover {
  background: #a34d15;
}

.file-button input {
  display: none;
}

#invoices-table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f9f9f9;
  font-weight: 600;
}

tr:hover {
  background: #f5f5f5;
}

td button {
  margin-right: 6px;
  padding: 4px 10px;
  font-size: 12px;
}

td button:last-child {
  margin-right: 0;
}

td .actions-cell {
  white-space: nowrap;
}

.status-pending {
  color: #999;
}

.status-ocr {
  color: #cc9900;
}

.status-extracted {
  color: #c65d1a;
}

.status-calculated {
  color: #009900;
}

.status-error {
  color: #cc0000;
}

.status-extracting {
  color: #9933cc;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin: 0 0 15px;
}

.close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: flex-end;
}

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

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-group select {
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

#token-status {
  font-size: 14px;
  margin-top: 10px;
}

#token-status.success {
  color: #009900;
}

#token-status.error {
  color: #cc0000;
}

.verified-badge {
  color: #009900;
  font-weight: 500;
}

.verified-badge::before {
  content: "\2713 ";
}

.link-button {
  background: none;
  color: #c65d1a;
  padding: 0;
  margin-left: 15px;
  text-decoration: underline;
}

.link-button:hover {
  background: none;
  color: #a34d15;
}

#auth-verified {
  display: flex;
  align-items: center;
}

.hint {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px;
}
