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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #2d3748;
  line-height: 1.6;
  background-color: #fff;
}

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

/* ——— Header ——— */
header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}
header img {
  margin-bottom: 16px;
}
header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #092c66;
  margin-bottom: 8px;
}
header p {
  color: #4a5568;
  font-size: 1.05rem;
  margin: 0 auto 4px;
}

input{
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* ——— Stats ——— */
.stats {
  text-align: center;
  margin-bottom: 24px;
  color: #4a5568;
  font-size: 1.1rem;
}
.stats strong {
  color: #092c66;
  font-weight: 600;
}

/* ——— Cards ——— */
.card {
  background: #ffffff;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 2px solid #092c66;
}
.card h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: #092c66;
  font-weight: 600;
}
.card p {
  color: #718096;
  margin-bottom: 16px;
}

/* ——— Forms ——— */
#builder-form {
  display: grid;
  gap: 16px;
}
#builder-form input[type="text"],
#builder-form input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}
#builder-form input:focus {
  outline: none;
  border-color: #092c66;
  box-shadow: 0 0 0 2px rgba(9, 44, 102, 0.15);
}
#builder-form label {
  display: block;
  margin-top: 8px;
  font-weight: 500;
  color: #4a5568;
}
#builder-form input[type="file"] {
  margin-top: 6px;
}
#logo-preview {
  max-height: 60px;
  margin-top: 8px;
  border-radius: 4px;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #092c66;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover {
  background: #072252;
}
button:active {
  transform: translateY(1px);
}

/* ——— Estimate Table ——— */
#estimate-table {
  width: 100%;
  margin: 16px 0;
}
#estimate-table th,
#estimate-table td {
  padding: 5px 0px;
  text-align: left;
  border-bottom: 1px solid #edf2f7;
}
#estimate-table th {
  background: #f8fafc;
  color: #4a5568;
  font-weight: 600;
  font-size: 0.95rem;
}
#estimate-table td {
  vertical-align: top;
}
#estimate-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.95rem;
}
#estimate-table .unit-input {
  width: 60px;
}
#estimate-table .qty-input,
#estimate-table .price-input {
  width: 90px;
}

#estimate-table .btn-copy,
#estimate-table .btn-move-up,
#estimate-table .btn-move-down {
    width: 28px;
    height: 28px;
    font-size: 12px;
    margin: 2px;
    padding: 0;
    border: 1px solid #ccc;
    background: #f8f9fa;
    cursor: pointer;
    border-radius: 4px;
    color: #222;
}

#estimate-table .btn-copy:hover,
#estimate-table .btn-move-up:hover,
#estimate-table .btn-move-down:hover {
    background: #e9ecef;
}

.sum-cell {
  text-align: right;
  font-weight: 500;
  color: #2d3748;
}
tfoot td {
  padding-top: 12px;
  border: none;
}
#total-sum {
  font-weight: 700;
  color: #092c66;
  font-size: 1.1rem;
}

.btn-remove {
  background: #e53e3e;
  color: white;
  width: 28px;
  height: 28px;
  font-size: 16px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
}
.btn-remove:hover {
  background: #c53030;
}

/* ——— Export & My Estimates ——— */
.export-section {
  text-align: center;
  margin: 24px 0;
  display: flex;
  justify-content: center;
}
.export-section button {
  min-width: 140px;
  margin: 0 8px;
  font-size: 1.05rem;
    background: #b00;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    color: white;
    cursor: pointer;
}
.export-section button:hover {
  background: rgb(204, 78, 5);
}

#my-estimates ul {
  list-style: none;
  padding: 0;
}
#my-estimates li {
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
  color: #4a5568;
}
#my-estimates li:last-child {
  border-bottom: none;
}
#my-estimates a {
  color: #092c66;
  text-decoration: none;
  font-weight: 500;
  margin-right: 8px;
}
#my-estimates a:hover {
  text-decoration: underline;
}

/* ——— Suggestions ——— */
.suggestions {
  position: absolute;
  background: white;
  border: 1px solid #cbd5e0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  width: 460px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.suggestion-item {
    padding: 5px 15px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 20px;
}
.suggestion-item:hover,
.suggestion-item:focus {
  background: #ebf4ff;
  outline: none;
}

.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #eee;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ——— Responsive ——— */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  header h1 {
    font-size: 1.7rem;
  }
  #estimate-table thead {
    display: none;
  }
  #estimate-table tr {
    display: block;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf2f7;
  }
  #estimate-table td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
  }
  #estimate-table td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: #4a5568;
    flex: 0 0 100px;
  }
  #estimate-table .sum-cell::before {
    content: "Сумма: ";
  }
  #estimate-table .btn-remove {
    margin-left: auto;
  }
  .export-section button {
    display: block;
    width: 100%;
    margin: 8px auto;
  }
}