/* Global styles - complete copy from HTML prototype */
:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --muted: #666666;
  --text: #000000;
  --accent: #000000;
  --border: #e0e0e0;
  --border-dark: #333333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 90%;
  margin: 32px auto;
  padding: 0 16px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-dark);
}

.logo-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo-img {
  max-width: 150px;
  height: auto;
  display: block;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

h1 {
  font-size: clamp(22px, 3vw, 28px);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2 {
  position: relative;
  padding-left: 16px;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--border-dark);
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--border-dark);
}

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

.variant-row {
  display: grid;
  grid-template-columns: 150px 150px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 8px;
}

.variant-row input {
  margin: 0;
}

.variant-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.row {
  display: grid;
  grid-template-columns: 250px 32px 1fr 1fr 90px 1fr 1fr 1fr 1fr 1fr 1fr 1.2fr 32px;
  gap: 8px;
  align-items: center;
}

.row.header {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  border-bottom: 2px solid var(--border-dark);
  padding-bottom: 8px;
}

.row > div,
.row > button {
  white-space: nowrap;
}

.btn {
  cursor: pointer;
  border: 2px solid var(--border-dark);
  background: var(--panel);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--border-dark);
  color: var(--panel);
}

.btn.primary {
  background: var(--border-dark);
  color: var(--panel);
  border: none;
}

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

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

.btn.ghost:hover {
  border-color: var(--border-dark);
  background: var(--bg);
  color: var(--text);
}

.btn.small {
  padding: 6px 10px;
  border-radius: 2px;
}

.delete-icon {
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  user-select: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
}

.delete-icon:hover {
  opacity: 1;
  border-color: #E53935;
  background: #E53935;
  color: white;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 2px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-weight: 600;
}

.pill strong {
  color: var(--border-dark);
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.total {
  font-weight: 700;
}

.right {
  text-align: right;
}

.sep {
  height: 2px;
  background: var(--border-dark);
  margin: 16px 0;
}

.note-icon {
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  user-select: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
}

.note-icon.has-note {
  opacity: 1;
  border-color: #FFA726;
  background: #FFA726;
  color: white;
}

.note-icon:hover {
  opacity: 1;
  border-color: var(--border-dark);
}

.help-icon {
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  user-select: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
}

.help-icon:hover {
  opacity: 1;
  border-color: var(--border-dark);
  background: var(--border-dark);
  color: white;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--panel);
  border: 2px solid var(--border-dark);
  border-radius: 4px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
}

.modal-content h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

.modal-content textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.modal-content textarea:focus {
  outline: none;
  border-color: var(--border-dark);
}

.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}

/* Responsive breakpoints */
@media (max-width: 1600px) {
  .row {
    grid-template-columns: 1fr 110px 110px 80px 90px 90px 90px 90px 90px 90px 90px 30px 30px;
  }
}

@media (max-width: 1400px) {
  .row {
    grid-template-columns: 1fr 100px 100px 70px 80px 80px 80px 80px 80px 80px 80px 30px 30px;
  }
}

/* Mobile-only elements - hidden on desktop */
.mobile-only {
  display: none;
}

/* Service wrappers - visible as flex on desktop for grid layout */
.service-inputs,
.service-totals {
  display: contents; /* Makes wrapper disappear on desktop */
}

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

  .row.header {
    display: none;
  }

  .row > * {
    width: 100%;
  }
}

