/* frontend/css/app.css */

.auth-layout{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  align-items:start;
}


@media (max-width: 1024px){
  .auth-layout{ grid-template-columns: 1fr; }
}

.auth-tabs{
  display:flex;
  gap:8px;
  margin-bottom:16px;
}

.auth-tab.active{
  border-color: var(--primary);
  color: var(--primary);
}

.feature-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  color: var(--text-secondary);
}

.app-error{
  background: var(--error-bg);
  color: var(--error);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

/* modal */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 9999;
  padding: 20px;
}

.modal-card{
  width: 520px;
  max-width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  overflow:hidden;
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-title{
  font-weight: 700;
}

.modal-body{
  padding: 18px;
}

.status-line{
  margin-top:12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.status-line.success{ background: var(--success-bg); color: var(--success); }
.status-line.error{ background: var(--error-bg); color: var(--error); }
.status-line.info{ background: var(--info-bg); color: var(--info); }

/* Pricing items inside SPA */
.pricing-items{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.pricing-item{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.pricing-item-header{
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.pricing-item-title{
  font-weight: 600;
}

.pricing-item-sub{
  color: var(--text-secondary);
  font-size: 13px;
}

.pricing-item-actions{
  margin-left:auto;
  display:flex;
  gap:8px;
}

.pricing-badge{
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pricing-badge.matched{ background: var(--success-bg); color:#059669; }
.pricing-badge.review{ background: var(--warning-bg); color:#D97706; }
.pricing-badge.not_found{ background: var(--error-bg); color:#DC2626; }

.pricing-meta{
  display:flex;
  justify-content:space-between;
  margin-top:10px;
  padding-top:10px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}

/* Object passport — spec card inline */
.spec-card-inline{
  display:flex;
  justify-content:space-between;
  align-items:center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  transition: border-color .2s;
}
.spec-card-inline:hover{
  border-color: var(--primary);
}
.spec-card-inline .spec-info h4{
  margin: 0 0 4px;
  font-size: 14px;
}
.spec-card-inline .spec-info p{
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.spec-card-inline .spec-actions{
  display:flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Summary rows (used in pricing & passport) */
.summary-row{
  display:flex;
  justify-content:space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.summary-label{ color: var(--text-secondary); }
.summary-value{ font-weight: 600; }

/* Admin tab content */
.admin-tab-content{ /* used in admin page */ }
.admin-tab-btn.active{
  background: var(--primary);
  color: #fff;
}

/* Responsive: passport grid */
@media (max-width: 768px){
  #page-object-passport [style*="grid-template-columns:1fr 2fr"]{
    grid-template-columns: 1fr !important;
  }
}

/* ========== Calc Details Modal ========== */

.calc-details-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

/* Фильтр-табы в модалке расчёта */
.calc-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.calc-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.calc-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.calc-filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.calc-filter-count {
  background: rgba(0,0,0,0.12);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.calc-filter-btn.active .calc-filter-count {
  background: rgba(255,255,255,0.25);
}

.calc-items-table td {
  padding: 8px 10px;
  font-size: 13px;
  vertical-align: top;
}

.calc-items-table th {
  padding: 8px 10px;
  font-size: 11px;
}

/* Ячейка сопоставления */
.calc-item-matched-display {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.calc-item-matched-text {
  font-size: 12px;
  line-height: 1.4;
  flex: 1;
}

.calc-edit-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity .2s;
}

.calc-edit-btn:hover {
  opacity: 1;
  border-color: var(--primary);
}

.calc-approve-btn {
  background: none;
  border: 1px solid var(--success);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}

.calc-approve-btn:hover {
  background: var(--success-bg);
}

/* Поиск норм часов (autocomplete) */
.norm-search-wrap {
  position: relative;
}

.norm-search-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  outline: none;
  background: var(--bg-card);
}

.norm-search-input:focus {
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.15);
}

.norm-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
}

.norm-search-dropdown:empty {
  display: none;
}

.norm-dropdown-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.norm-dropdown-item:last-child {
  border-bottom: none;
}

.norm-dropdown-item:hover {
  background: var(--primary-bg);
}

.norm-dropdown-name {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-primary);
}

.norm-dropdown-meta {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.norm-dropdown-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
