/* АВИОР CMS — общие стили. Палитра совпадает с фирменной формой сметы. */

:root{
  --navy:#152a4e;
  --navy-dark:#0e1e3a;
  --gold:#d4a63a;
  --bg:#f4f6fa;
  --border:#dde3ec;
  --text:#1c2436;
  --muted:#6b7385;
  --danger:#c0392b;
  --good:#1e7e34;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:"Segoe UI", Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  padding:24px;
}
a{color:inherit;}

.sheet{
  max-width:1100px;
  margin:0 auto;
  background:#fff;
  border-radius:10px;
  box-shadow:0 2px 14px rgba(20,30,60,.08);
}

header{
  background:linear-gradient(135deg,var(--navy),var(--navy-dark));
  color:#fff;
  padding:18px 32px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
  border-top-left-radius:10px;
  border-top-right-radius:10px;
}
.brand-link{text-decoration:none;color:inherit;}
.brand h1{
  margin:0;
  font-size:22px;
  letter-spacing:3px;
  color:var(--gold);
}
.brand p{
  margin:2px 0 0;
  font-size:12px;
  color:#cfd6e6;
}

.topnav{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.topnav a{
  text-decoration:none;
  color:#dfe4ef;
  font-size:14px;
  padding:8px 14px;
  border-radius:6px;
  transition:background .15s ease;
}
.topnav a:hover{background:rgba(255,255,255,.08);}
.topnav a.active{background:rgba(255,255,255,.14);color:#fff;font-weight:600;}

.header-user{
  display:flex;
  align-items:center;
  gap:12px;
  font-size:13px;
  color:#cfd6e6;
}
.logout-link{
  color:#cfd6e6;
  text-decoration:none;
  border:1px solid rgba(255,255,255,.3);
  padding:5px 10px;
  border-radius:6px;
  font-size:12px;
}
.logout-link:hover{color:#fff;border-color:#fff;}

.content{padding:24px 32px 36px;}

.page-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:18px;
}
.page-title h2{margin:0;font-size:20px;color:var(--navy);}

footer.legal{
  text-align:center;
  font-size:12px;
  color:var(--muted);
  padding:10px 0 26px;
}

/* Flash-сообщения */
.flash{
  padding:10px 14px;
  border-radius:6px;
  font-size:14px;
  margin-bottom:16px;
}
.flash-info{background:#e8eef8;color:var(--navy);}
.flash-success{background:#e6f4ea;color:var(--good);}
.flash-error{background:#fbe9e7;color:var(--danger);}

/* Кнопки */
.btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 16px;
  border-radius:6px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  font-size:14px;
  color:var(--text);
  text-decoration:none;
  line-height:1.2;
}
.btn:hover{background:#f2f4f9;}
.btn-primary{background:var(--navy);color:#fff;border-color:var(--navy);}
.btn-primary:hover{background:var(--navy-dark);}
.btn-warn{color:var(--danger);border-color:#f0c4bd;}
.btn-sm{padding:5px 10px;font-size:12px;}

/* Формы */
.field{display:flex;flex-direction:column;font-size:12px;color:var(--muted);margin-bottom:14px;}
.field input, .field select, .field textarea{
  margin-top:5px;
  padding:9px 10px;
  border:1px solid var(--border);
  border-radius:6px;
  font-size:14px;
  color:var(--text);
  font-family:inherit;
}
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px 20px;
}
.form-grid .field.full{grid-column:1 / -1;}

/* Таблицы */
table{width:100%;border-collapse:collapse;font-size:14px;background:#fff;}
thead th{
  text-align:left;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--muted);
  border-bottom:2px solid var(--border);
  padding:10px 8px;
}
tbody td{
  padding:10px 8px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}
tbody tr:hover{background:#fafbfd;}
.table-card{
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
}

/* Карточки модулей на панели */
.modules{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:16px;
}
.module-card{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:20px;
  border:1px solid var(--border);
  border-radius:10px;
  text-decoration:none;
  color:var(--text);
  background:#fff;
  transition:box-shadow .15s ease, transform .15s ease, border-color .15s ease;
  position:relative;
}
.module-card.active{cursor:pointer;}
.module-card.active:hover{
  box-shadow:0 8px 24px rgba(20,30,60,.12);
  border-color:var(--navy);
  transform:translateY(-2px);
}
.module-card.disabled{opacity:.55;cursor:not-allowed;background:#fafbfd;}
.module-icon{
  width:44px;height:44px;
  border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  font-size:22px;
  background:linear-gradient(135deg,var(--navy),var(--navy-dark));
  color:var(--gold);
}
.module-card.disabled .module-icon{background:#e7eaf1;color:#9aa2b5;}
.module-title{font-size:16px;font-weight:700;color:var(--navy);}
.module-card.disabled .module-title{color:var(--muted);}
.module-desc{font-size:13px;color:var(--muted);line-height:1.4;}
.module-badge{
  position:absolute;top:14px;right:14px;
  font-size:11px;text-transform:uppercase;letter-spacing:.4px;
  padding:3px 8px;border-radius:20px;font-weight:600;
  background:#f5f0e2;color:#8a6d1f;
}
.module-arrow{margin-top:auto;font-size:13px;font-weight:600;color:var(--navy);}

/* Статус-бейджи заказов */
.status-badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:20px;
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}
.status-badge[data-status="принят"]{background:#e8eef8;color:var(--navy);}
.status-badge[data-status="диагностика"]{background:#f5f0e2;color:#8a6d1f;}
.status-badge[data-status="согласование"]{background:#f5f0e2;color:#8a6d1f;}
.status-badge[data-status="в ремонте"]{background:#e6f0fb;color:#1c5faa;}
.status-badge[data-status="готов"]{background:#e6f4ea;color:var(--good);}
.status-badge[data-status="выдан"]{background:#eef1f4;color:var(--muted);}
.status-badge[data-status="отказ"]{background:#fbe9e7;color:var(--danger);}

/* Строки-услуги в таблице комплектующих (совпадает со сметой) */
tr[data-category="service"]{background:#fdf7e8;}

/* Логин / установка — центрированная карточка */
.auth-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.auth-card{
  width:100%;
  max-width:360px;
  background:#fff;
  border-radius:10px;
  box-shadow:0 10px 40px rgba(20,30,60,.12);
  overflow:hidden;
}
.auth-card header{border-radius:0;justify-content:center;text-align:center;}
.auth-card .auth-body{padding:24px 28px 28px;}
.auth-card .btn-primary{width:100%;justify-content:center;margin-top:6px;}
.auth-hint{font-size:12px;color:var(--muted);margin-top:14px;text-align:center;line-height:1.5;}

@media (max-width: 720px){
  body{padding:10px;}
  header{padding:16px 18px;}
  .content{padding:18px;}
  .form-grid{grid-template-columns:1fr;}
  table, thead, tbody, tr, td{display:block;width:100%;}
  thead{display:none;}
  tbody tr{border:1px solid var(--border);border-radius:8px;margin-bottom:10px;padding:8px 12px;}
  tbody td{border-bottom:none;padding:6px 0;}
  tbody td[data-label]::before{
    content:attr(data-label);
    display:block;
    font-size:11px;
    text-transform:uppercase;
    color:var(--muted);
    margin-bottom:2px;
  }
}
