/* Нормо-часы Alanar Производство — стиль как inout.arrka.cc */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: #2d2925;
  background-color: #f5f2ed;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* ─── Top Bar ─── */
.top-bar {
  background: #b3aa9e;
  padding: 14px 24px;
  margin: 0 -24px 28px -24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar .brand {
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.top-bar .brand span {
  font-weight: 400;
  opacity: 0.7;
}

.top-bar nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 22px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.top-bar nav a:hover { border-bottom-color: #fff; }
.top-bar nav a.active { border-bottom-color: #fff; }

/* ─── Typography ─── */
h1 {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2d2925;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: #8a8072;
}

h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 18px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: #b3aa9e;
  color: #fff;
  transition: opacity 0.15s;
  letter-spacing: 0.3px;
  line-height: 1;
}

.btn:hover { opacity: 0.85; }

.btn-badge {
  background: #2d2925;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  padding: 9px 18px;
}

.btn-badge:hover { opacity: 0.85; }

.btn-sm { padding: 7px 14px; font-size: 0.7rem; }

.btn-danger {
  background: #a0524a !important;
  color: #fff !important;
}

.btn-outline {
  background: transparent;
  color: #2d2925;
  border: 1.5px solid #2d2925;
}

.btn-outline:hover { background: #ede4d5; }

/* ─── Cards — простые, без теней и миллиметровки ─── */
.card {
  background: #fff;
  border: 1px solid #e0dbd0;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card-title {
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0dbd0;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #8a8072;
}

/* ─── Grid моделей ─── */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.model-card {
  background: #fff;
  border: 1px solid #e0dbd0;
  padding: 18px 20px;
  text-decoration: none;
  color: #2d2925;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.model-card:hover { border-color: #b3aa9e; }

.model-card-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.model-card-meta {
  font-size: 0.7rem;
  color: #8a8072;
}

/* ─── Tables ─── */
.table-wrap {
  background: #fff;
  border: 1px solid #e0dbd0;
  margin-bottom: 20px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead th {
  background: #ede4d5;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #2d2925;
  border-bottom: 2px solid #2d2925;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #e0dbd0;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #faf8f5; }

/* ─── Workshop sections ─── */
.workshop-section { margin-bottom: 16px; }

.workshop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #ede4d5;
  border: 1px solid #e0dbd0;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

.workshop-header h3 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.workshop-body { padding: 0; }

.op-list { list-style: none; }
.op-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid #eee;
  font-size: 0.82rem;
}
.op-list li:last-child { border-bottom: none; }
.op-name { flex: 1; }
.op-name .option-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #b3aa9e;
  margin-left: 6px;
}
.op-actions { display: flex; gap: 4px; }

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

.form-group label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: #8a8072;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.85rem;
  border: 1px solid #c8c2b0;
  background: #fff;
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: #b3aa9e;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%238a8072'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

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

/* ─── Order cards ─── */
.order-list { display: flex; flex-direction: column; gap: 6px; }

.order-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #e0dbd0;
  padding: 12px 18px;
  text-decoration: none;
  color: #2d2925;
  transition: border-color 0.15s;
}

.order-card:hover { border-color: #b3aa9e; }

.order-card-label { font-weight: 600; font-size: 0.9rem; }
.order-card-meta { font-size: 0.72rem; color: #8a8072; margin-top: 2px; }

/* ─── Time input ─── */
.time-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.time-input {
  width: 70px;
  padding: 5px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  border: 1px solid #c8c2b0;
  background: #fff;
  text-align: center;
}

.time-submit {
  padding: 5px 12px;
  font-size: 0.7rem;
}

.time-set {
  font-weight: 700;
  color: #4a7a4a;
  font-size: 0.82rem;
  margin-right: 6px;
}

/* ─── Badge ─── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #f5ede4;
  color: #8a6a3a;
  border: none;
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #b3aa9e;
}

.empty-state p { margin: 12px 0; font-size: 0.9rem; }

/* ─── Stats row ─── */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e0dbd0;
  padding: 14px 20px;
  text-align: center;
  min-width: 110px;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2d2925;
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8a8072;
  margin-top: 2px;
}

/* ─── Footer ─── */
.footer {
  text-align: center;
  padding: 28px 0 8px;
  font-size: 0.68rem;
  color: #b3aa9e;
  border-top: 1px solid #e0dbd0;
  margin-top: 32px;
  letter-spacing: 0.3px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 -16px 20px -16px;
  }
  .top-bar nav a { margin: 0 8px; font-size: 0.72rem; }
  .container { padding: 0 16px 30px; }
  .form-row { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.35rem; }
  .stats-row { flex-direction: column; gap: 10px; }
}

/* ─── Model blocks (новый layout) ─── */
.model-block {
  margin-bottom: 0;
}
.model-block + .model-block {
  margin-top: 16px;
}

.model-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid #e0dbd0;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s;
}

.model-header:hover { border-color: #b3aa9e; }

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

.model-arrow {
  font-size: 0.75rem;
  color: #b3aa9e;
  width: 14px;
}

.model-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.model-count {
  font-size: 0.68rem;
  color: #8a8072;
}

.model-body {
  border: 1px solid #e0dbd0;
  border-top: none;
  padding: 12px;
  background: #faf8f5;
}

/* ─── Operation table ─── */
.op-name-text { font-weight: 500; }

.ws-tag {
  display: inline-block;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  background: #ede4d5;
  color: #8a6a3a;
  margin-left: 6px;
  vertical-align: middle;
}

.na-cell {
  color: #d5cdc0;
  font-size: 0.75rem;
}

.del-btn {
  padding: 2px 6px !important;
  font-size: 0.65rem !important;
  background: transparent !important;
  color: #a0524a !important;
  border: 1px solid #a0524a !important;
  opacity: 0.5;
}

.del-btn:hover { opacity: 1; }

.add-op-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e0dbd0;
}
