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

:root {
  --brand-color: #1a1a2e;
  --accent-color: #667eea;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--accent-color) 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* Login Section */
.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  margin: 100px auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo h1 {
  font-size: 28px;
  color: var(--brand-color);
  margin-bottom: 5px;
}

.logo p {
  color: #666;
  font-size: 14px;
}

/* Header */
header {
  background: white;
  border-radius: 12px;
  padding: 20px 30px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-logo {
  height: 40px;
  width: auto;
}

.header-content h1 {
  font-size: 24px;
  color: var(--brand-color);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info span {
  color: #666;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 12px 24px;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
  background: white;
  color: var(--brand-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 18px;
  color: var(--brand-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 5px;
  color: #444;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.hint {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

.select-with-btn {
  display: flex;
  gap: 10px;
}

.select-with-btn select {
  flex: 1;
}

/* Date Range Picker */
.date-range-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-range-picker input[type="date"] {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.date-range-picker input[type="date"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-range-separator {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

/* Info Boxes */
.info-box {
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
}

.info-box strong {
  display: block;
  margin-bottom: 5px;
}

.info-box p {
  font-size: 13px;
  margin: 0;
}

.info-reverse {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

.info-vat {
  background: #d4edda;
  border: 1px solid #28a745;
  color: #155724;
}

/* Line Items */
.line-item {
  display: grid;
  grid-template-columns: 2fr 80px 100px 40px;
  gap: 15px;
  align-items: end;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
}

.line-item .form-group {
  margin-bottom: 0;
}

.line-item textarea {
  min-height: 60px;
}

@media (max-width: 700px) {
  .line-item {
    grid-template-columns: 1fr;
  }
}

.btn-remove {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  background: #ff4757;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-remove:hover {
  background: #ff3344;
}

.btn-remove-small {
  padding: 8px 16px;
  font-size: 12px;
  background: #ff4757;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-remove-small:hover {
  background: #ff3344;
}

/* Totals */
.totals-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.total-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
  font-size: 14px;
  color: #666;
  font-weight: 400;
}

.total-row span {
  color: #666;
  font-weight: 400;
}

.total-row span:last-child {
  min-width: 120px;
  text-align: right;
}



#vat-row.hidden {
  display: none;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-color) 0%, #764ba2 100%);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-large {
  padding: 18px 30px;
  font-size: 16px;
  margin-top: 10px;
}

/* Clients List */
.client-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
}

.client-info h3 {
  font-size: 16px;
  color: var(--brand-color);
  margin-bottom: 5px;
}

.client-info p {
  font-size: 13px;
  color: #666;
  margin: 2px 0;
}

.client-info .vat-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 5px;
}

.client-actions {
  display: flex;
  gap: 10px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
}

/* Invoices List */
.invoice-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
}

.invoice-info h3 {
  font-size: 16px;
  color: var(--brand-color);
  margin-bottom: 5px;
}

.invoice-info p {
  font-size: 13px;
  color: #666;
  margin: 2px 0;
}

.invoice-info .invoice-generated {
  font-size: 11px;
  color: #999;
  margin-top: 5px;
}

.invoice-actions {
  display: flex;
  gap: 10px;
}

.vat-badge.reverse {
  background: #fff3cd;
  color: #856404;
}

.vat-badge.vat {
  background: #d4edda;
  color: #155724;
}

.client-actions {
  display: flex;
  gap: 10px;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 40px;
}

/* Logo Upload */
.logo-upload-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.logo-preview {
  width: 200px;
  height: 100px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  overflow: hidden;
}

.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-preview span {
  color: #999;
  font-size: 13px;
}

.logo-controls {
  display: flex;
  gap: 10px;
}

/* Color Input */
.color-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-input input[type="color"] {
  width: 50px;
  height: 40px;
  padding: 2px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
}

.color-input input[type="text"] {
  flex: 1;
}

/* Error */
.error {
  color: #ff4757;
  font-size: 14px;
  margin-top: 15px;
  text-align: center;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeIn 0.5s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}
