:root {
  --font: 'Inter', sans-serif;
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-accent: #00A288;
  --color-accent-dark: #004D66;
  --color-border: #ddd;
  --color-card: #f9f9f9;
}

body.dark {
  --color-bg: #1e1e1e;
  --color-text: #f5f5f5;
  --color-accent: #00A288;
  --color-accent-dark: #007060;
  --color-border: #444;
  --color-card: #2a2a2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

header {
  padding: 1.5rem;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
  background: linear-gradient(to right, var(--color-accent), var(--color-accent-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  gap: 0.5rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 24px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: var(--color-accent);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

main {
  padding: 2rem 1rem;
  max-width: 700px;
  margin: auto;
}

label {
  display: block;
  margin-top: 1rem;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 0.7rem;
  margin-top: 0.3rem;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  appearance: none;
  background-color: var(--color-bg);
  color: var(--color-text);
}

button {
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background: var(--color-accent);
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  display: block;
  width: 100%;
}

button:hover {
  background: var(--color-accent-dark);
}

.item-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.item-row input {
  flex: 1;
  min-width: 30%;
}

.item-row button.remove-item {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.item-row button.remove-item:hover {
  background: #c0392b;
}

.invoice-preview {
  background: var(--color-card);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  margin-top: 2rem;
}

.invoice-preview table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.invoice-preview th,
.invoice-preview td {
  border: 1px solid var(--color-border);
  padding: 0.5rem;
  text-align: left;
}

.invoice-preview p {
  margin: 0.5rem 0;
}

.output-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

#copyInvoice {
  background: #555;
  width: auto;
}

#copyInvoice:hover {
  background: #333;
}

#printInvoice {
  background: #4b7bec;
  width: auto;
}

#printInvoice:hover {
  background: #3867d6;
}

footer {
  text-align: center;
  font-size: 0.9rem;
  padding: 1rem;
  color: #666;
}
