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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
}

#app {
  min-height: 100vh;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-size: 1.25rem;
  color: #666;
}

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

.sidebar {
  width: 250px;
  background: #fff;
  border-right: 1px solid #ddd;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 1rem;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.main-content {
  margin-left: 250px;
  padding: 1rem;
}

/* Hamburger button - hidden on desktop */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.hamburger-icon {
  display: block;
  width: 20px;
  height: 2px;
  background-color: #333;
  border-radius: 1px;
}

/* Sidebar overlay - hidden on desktop */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    padding-top: 4rem;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .sidebar-overlay.visible {
    pointer-events: auto;
  }

  .main-content {
    margin-left: 0;
    padding-top: 4rem;
  }
}

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: #009b4f;
  color: #fff;
}

.btn-primary:hover {
  background-color: #007a3f;
}

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

.btn-secondary:hover {
  background-color: #d0d0d0;
}

input, select, textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #009b4f;
  box-shadow: 0 0 0 2px rgba(0,155,79,0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

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

tr:hover {
  background-color: #f5f5f5;
}

/* Navigation */
.sidebar h2 {
  margin-bottom: 1.5rem;
  color: #009b4f;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 0.25rem;
}

.sidebar li.nav-section {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

.sidebar a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.sidebar a:hover {
  background-color: #f0f0f0;
}

.sidebar a.active {
  background-color: #009b4f;
  color: #fff;
}

/* Modal */
.modal-overlay {
  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: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  min-width: 400px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content h2 {
  margin-bottom: 1rem;
}

/* Form layout */
.form-group {
  margin-bottom: 1rem;
}

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

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Form row for side-by-side inputs */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

/* Card header with title and action */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-header h1 {
  margin: 0;
}

/* Empty state */
.empty-state {
  color: #666;
  font-style: italic;
  padding: 2rem;
  text-align: center;
}

/* Table actions column */
td.actions {
  white-space: nowrap;
}

td.actions .btn {
  margin-left: 0.25rem;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-danger {
  background-color: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-large {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* Hint text */
.hint {
  display: block;
  color: #666;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Calculated field display */
.calculated-field {
  padding: 0.5rem;
  background-color: #f0f0f0;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Calculator layout */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 1200px) {
  .calculator-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

.calculator .card h2 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

.calculator .card h3 {
  margin: 1rem 0 0.75rem;
  font-size: 0.9rem;
  color: #666;
}

.calculator hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 1rem 0;
}

/* Selected ink info */
.selected-ink-info {
  background-color: #e8f4fd;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.selected-ink-info p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
}

/* Calculate section */
.calculate-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.calculate-section .btn-large {
  flex-shrink: 0;
}

/* Result card */
.result-card {
  flex: 1;
  min-width: 250px;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid #28a745;
}

.result-card h3 {
  margin: 0 0 0.75rem;
  color: #28a745;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.result-row.overhead {
  color: #666;
  font-size: 0.875rem;
}

.result-row.total {
  font-weight: 600;
  font-size: 1.1rem;
}

.result-label {
  color: #555;
}

.result-value {
  font-weight: 500;
}

.result-card hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 0.5rem 0;
}

/* Input with unit suffix */
.input-with-unit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-with-unit input {
  flex: 1;
}

.input-unit {
  color: #666;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Value display with unit */
.value-display {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.5rem;
  background-color: #f8f9fa;
  border-radius: 4px;
}

/* Warning hint */
.hint.warning {
  color: #856404;
  background-color: #fff3cd;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Status message cards */
.card-success {
  border: 2px solid #28a745;
  background-color: #d4edda;
}

.card-success p {
  color: #155724;
}

.card-error {
  border: 2px solid #dc3545;
  background-color: #f8d7da;
}

.card-error p {
  color: #721c24;
}
