@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
  --bg-color: #0f172a; /* Slate 900 */
  --surface-color: rgba(30, 41, 59, 0.7); /* Slate 800 */
  --surface-highlight: rgba(51, 65, 85, 0.8);
  --primary-color: #10b981; /* Emerald 500 - Finance theme */
  --primary-hover: #059669;
  --danger-color: #ef4444;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-border: 1px solid rgba(255, 255, 255, 0.05);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.2rem;
}

.header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card {
  background: var(--surface-color);
  backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

h2 {
  font-size: 1.2rem;
  color: #fff;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
}

h2:first-of-type {
  margin-top: 0;
}

.form-group {
  margin-bottom: 1.2rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

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

.btn {
  display: inline-block;
  width: 100%;
  padding: 0.8rem;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

/* Tabelas e Comparativos Financeiros */
.finance-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.finance-table th,
.finance-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.finance-table th {
  background-color: rgba(0,0,0,0.3);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.finance-table td input {
  width: 100px;
  padding: 0.4rem;
  font-size: 0.9rem;
}

.finance-table td.difference {
  font-weight: bold;
}

.diff-positive { color: var(--primary-color); }
.diff-negative { color: var(--danger-color); }
.diff-zero { color: var(--text-muted); }

.sub-row td {
  background-color: rgba(255, 255, 255, 0.02);
  padding-left: 1.5rem !important;
}

/* Ocorrências Dinâmicas */
.occurrence-item {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* Câmera e Fotos */
.camera-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

video {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  margin-bottom: 1rem;
}

canvas.hidden, video.hidden, .hidden {
  display: none !important;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
}

.photo-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Assinatura */
.signature-wrapper {
  background: white;
  border-radius: 6px;
  padding: 5px;
  margin-bottom: 0.5rem;
  height: 150px;
  position: relative;
}

canvas#signature-pad {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .finance-table td input {
    width: 70px;
  }
  .finance-table th, .finance-table td {
    padding: 0.5rem 0.2rem;
    font-size: 0.85rem;
  }
}
