:root {
  --mm-bg: #f7f8fa;
  --mm-card: #ffffff;
  --mm-border: #e8eaed;
  --mm-line: #eceff3;
  --mm-primary: #2563eb;
  --mm-success: #16a34a;
  --mm-danger: #dc2626;
  --mm-text: #1f2937;
  --mm-muted: #6b7280;
}

body {
  background: var(--mm-bg);
  color: var(--mm-text);
  font-size: 0.95rem;
}

.auth-body {
  min-height: 100vh;
  background: linear-gradient(160deg, #eef3f9 0%, #f8fafc 50%, #e9eef5 100%);
}

.auth-card {
  background: var(--mm-card);
}

.app-navbar {
  min-height: 52px;
}

.app-navbar .nav-link {
  padding: 0.4rem 0.65rem;
  font-size: 0.875rem;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 650;
}

.summary-card {
  border: 1px solid var(--mm-border) !important;
  border-left-width: 3px !important;
  background: var(--mm-card);
  box-shadow: none;
}

.summary-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.summary-label {
  font-size: 0.78rem;
  color: var(--mm-muted);
  margin-top: 0.2rem;
}

.progress-thin,
.progress {
  height: 6px;
  background: #e9edf3;
}

.progress-lg {
  height: 8px;
}

.phase-toolbar {
  position: sticky;
  top: 52px;
  z-index: 1020;
  background: rgba(247, 248, 250, 0.97);
  backdrop-filter: blur(8px);
  padding: 0.75rem 0 0.85rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--mm-line);
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

@media (min-width: 768px) {
  .filter-bar {
    grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
  }
}

.checklist-list {
  background: var(--mm-card);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  overflow: hidden;
}

.module-header {
  padding: 0.55rem 0.85rem;
  background: #f3f5f8;
  border-bottom: 1px solid var(--mm-line);
  color: #374151;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.checklist-head {
  grid-template-columns: 44px minmax(0, 1fr) 40px 40px 40px 52px;
  gap: 0.35rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: #fafbfc;
  border-bottom: 1px solid var(--mm-line);
  color: var(--mm-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.checklist-row {
  border-bottom: 1px solid var(--mm-line);
}

.checklist-row:last-child {
  border-bottom: 0;
}

.checklist-row.is-open {
  background: #fbfcfe;
}

.checklist-main {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px 36px 36px auto;
  gap: 0.25rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
}

@media (min-width: 768px) {
  .checklist-main {
    grid-template-columns: 44px minmax(0, 1fr) 40px 40px 40px 52px;
    gap: 0.35rem;
    padding: 0.7rem 0.85rem;
  }
}

.row-num {
  color: var(--mm-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.row-title-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  min-width: 0;
  color: inherit;
}

.row-title {
  font-size: 0.95rem;
  font-weight: 550;
  line-height: 1.35;
}

.status-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
}

.check-toggle {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: var(--mm-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.row-check {
  display: flex;
  justify-content: center;
  position: static;
  padding-bottom: 0;
}

.check-toggle:not(:disabled):hover {
  border-color: var(--mm-primary);
  background: #eff6ff;
  color: var(--mm-primary);
}

.check-toggle.is-on {
  border-color: var(--mm-success);
  background: #ecfdf3;
  color: #166534;
  font-size: 0.9rem;
}

.check-toggle:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.row-actions .btn-link {
  color: var(--mm-muted);
  text-decoration: none;
  font-size: 0.8rem;
}

.row-actions .btn-link:hover {
  color: var(--mm-primary);
}

.checklist-detail {
  display: none;
  padding: 0 0.85rem 0.9rem 0.85rem;
  margin: 0 0.5rem 0.65rem 2.4rem;
  border-left: 2px solid #e5e7eb;
  color: #374151;
  font-size: 0.88rem;
}

.checklist-row.is-open .checklist-detail {
  display: block;
}

.detail-label {
  color: var(--mm-muted);
  font-weight: 600;
}

.revize-note {
  background: #fef2f2;
  color: #991b1b;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card {
  background: var(--mm-card);
  border-color: var(--mm-border);
  box-shadow: none;
}

.tracking-wide {
  letter-spacing: 0.35em;
  font-size: 1.5rem !important;
}

@media print {
  .no-print,
  .app-navbar,
  .modal,
  #appToast,
  .phase-toolbar,
  .detail-actions,
  .row-actions {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .checklist-detail {
    display: block !important;
  }
}
