:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f1724;
  --muted: #556574;
  --accent: #155bd6;
  --success: #10b981;
  --danger: #ef4444;
  --glass: rgba(255, 255, 255, 0.72);
  --hover: rgba(230, 240, 255, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: Roboto;
}

body {
  background: var(--bg);
  color: var(--muted);
  margin: 0;
  padding: 28px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.weeks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.week-card {
  background: linear-gradient(180deg, var(--card), #fbfdff);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(22, 78, 144, 0.06);
  min-width: 220px;
  box-shadow: 0 6px 18px rgba(15, 23, 36, 0.04);
  transition: transform .18s ease, box-shadow .18s ease;
}

.week-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 23, 36, 0.08);
}

.week-card.active {
  border-color: rgba(21, 91, 214, 0.18);
  transform: translateY(-6px);
  background: var(--hover);
}

.week-link {
  display: block;
  color: inherit;
  text-decoration: none;
  text-align: center;
}

.week-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
}

.week-range {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 6px;
}

main {
  margin-top: 6px;
}

.group {
  background: var(--card);
  border: 1px solid rgba(14, 41, 64, 0.04);
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 6px 12px rgba(12, 18, 28, 0.03);
  overflow: hidden;
  transition: all .2s ease;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.9), rgba(248, 250, 255, 0.95));
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
}

.group-header .date {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.group-address {
  font-size: 1.2rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
  text-align: right;
}

.task {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(14, 41, 64, 0.03);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  margin: 5px;
  transition: background .2s, transform .2s;
}

.task:hover {
  background: var(--hover);
  transform: translateY(-2px);
}

.task-top {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.serial {
  color: var(--muted);
  min-width: 160px;
}

.model {
  font-weight: 700;
  color: var(--accent);
}

.отменен .task-top .status,
.отменен .task-mid,
.отменен .model .serial,
.отменен .model {
  color: #cccccc;
}

.status {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 1rem;
}

/* .status-open { */
.status-открыт {
  background: rgba(21, 91, 214, 0.08);
  color: var(--accent);
}

.status-closing {
  background: rgba(249, 115, 22, 0.06);
  color: #b45309;
}

.status-закрыт {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
}

.status-отменен {
  background: rgba(239, 239, 239, 0.06);
  color: var(--muted);
}

.task-mid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 600;
  /* перенесено из .counters */
}

.act {
  background: var(--accent);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(21, 91, 214, 0.08);
  display: inline-block;
  transition: background .2s, transform .2s;
}

.act:hover {
  transform: translateY(-2px);
}

.task-summary {
  margin-top: 12px;
  color: var(--muted);
}

.parts-block {
  margin-top: 12px;
}

.parts-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}

.parts-table thead th {
  background: transparent;
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid rgba(14, 41, 64, 0.06);
  font-weight: 700;
  color: var(--muted);
}

.parts-table tbody td {
  padding: 10px;
  border-bottom: 1px solid rgba(14, 41, 64, 0.04);
  color: var(--muted);
}

.parts-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 36, 0.02);
}

.no-tasks {
  color: var(--muted);
  padding: 1rem;
  margin-bottom: 5rem;
  text-align: center;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background .18s ease, transform .12s ease, color .12s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

/* Выход */
.logout-btn {
  margin-left: 1rem;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}

.logout-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Страница входа */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg);
  margin: 0;
}

.login-wrap {
  background: var(--card);
  padding: 40px 48px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 36, 0.08);
  width: 100%;
  max-width: 400px;
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 24px;
}

.login-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.login-form label {
  font-weight: 600;
  color: var(--muted);
  font-size: 1rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  padding: 10px 12px;
  border: 1px solid rgba(14, 41, 64, 0.1);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 91, 214, 0.12);
}

.login-btn {
  margin-top: 1rem;
}

.login-btn:hover {
  background: var(--bg);
  color: var(--accent);
}

/* ---------- FOOTER: тёмный, минималистичный, во всю ширину ---------- */
.page-footer {
  width: 100%;
  padding: 2rem;
  background: #757e8c;
  color: #fff;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-col {
  flex: 1 1 320px;
  min-width: 220px;
}

.footer-note p {
  margin: 0;
  line-height: 1.45;
  opacity: 0.95;
}

.footer-meta {
  text-align: right;
  margin: 6px 0;
  font-weight: 700;
  font-size: 0.9rem;
}
